# hostStorageContext

A host storage context record carrying schema, schemaVersion, hostFamily, applicationDataRoot, source, and related state.

Last updated: 2026-09-09

Package: host.storage | Status: source-declared

Tags: cpu, host, host.storage, method, source-example, storage, thing, yeho

Read and write bounded application storage through the host contract.

```yh
external thing hostStorageContext
```

- text schema: Stores schema as text.
- int schemaVersion: Stores schema version as int.
- text hostFamily: Stores host family as text.
- text applicationDataRoot: Stores application data root as text.
- text source: Stores source as text.
- bool available: Stores available as bool.
- hostStorageContext(text hostFamily, text applicationDataRoot, text source): Host storage context.
- ApplicationDataPath(text vendor, text application) returns text: Application data path.
- Describe() returns text: Describe.

## Use hostStorageContext

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using host.storage

// Read and write bounded application storage through the host contract.
hostStorageContext sample = hostStorageContext("host Family", "application Data Root", "example")
Console.Log(Text.From(sample.schema))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.host_storage__hoststoragecontext"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "host.storage"
version = "0.1.0"
path = "../../../yeho/packages/host/storage"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/host.storage--hostStorageContext/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## hostStorageContext.ApplicationDataPath

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using host.storage

// Application data path.
hostStorageContext instance = hostStorageContext("host Family", "application Data Root", "example")
text argument_vendor = "argument vendor"
text argument_application = "argument application"
text result = instance.ApplicationDataPath(argument_vendor, argument_application)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.host_storage__hoststoragecontext"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "host.storage"
version = "0.1.0"
path = "../../../yeho/packages/host/storage"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/host.storage--hostStorageContext/method-ApplicationDataPath-7 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## hostStorageContext.Describe

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using host.storage

// Describe.
hostStorageContext instance = hostStorageContext("host Family", "application Data Root", "example")
text result = instance.Describe()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.host_storage__hoststoragecontext"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "host.storage"
version = "0.1.0"
path = "../../../yeho/packages/host/storage"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/host.storage--hostStorageContext/method-Describe-8 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

Source: yeho/packages/host/storage/storage.yh

AI training permission: https://demonhunterlabs.com/ai-use
