@themoltnet/pi-runtime 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,30 @@
1
+ /**
2
+ * Every input modality Pi understands. Canonical for the repo: daemon
3
+ * validation, CLI parsing and wire schemas derive their allowed values from
4
+ * this list so they cannot drift from what Pi actually accepts.
5
+ */
6
+ export declare const PI_MODEL_MODALITIES: readonly ["text", "image"];
7
+
8
+ /** Input modalities Pi understands for a model entry. */
9
+ export declare type PiModelModality = (typeof PI_MODEL_MODALITIES)[number];
10
+
11
+ /**
12
+ * A model entry in Pi's `models.json`. `input` declares the modalities the
13
+ * model accepts. Pi treats an entry with no `input` as text-only, so a vision
14
+ * model must declare `['text', 'image']` or image content parts never reach
15
+ * the provider.
16
+ */
17
+ export declare interface PiModelSpec {
18
+ id: string;
19
+ input?: readonly PiModelModality[];
20
+ }
21
+
1
22
  export declare interface WriteMultiProviderPiConfigInput extends WritePiConfigBase {
2
23
  /** Provider registry keyed by Pi provider id. */
3
24
  providers: Readonly<Record<string, WritePiProviderInput>>;
4
25
  provider?: never;
5
26
  model?: never;
27
+ input?: never;
6
28
  baseUrl?: never;
7
29
  apiKeyEnvRef?: never;
8
30
  }
@@ -27,8 +49,8 @@ export declare interface WritePiProviderInput {
27
49
  api: string;
28
50
  /** Provider base URL. */
29
51
  baseUrl: string;
30
- /** Model ids exposed by this provider. */
31
- models: readonly string[];
52
+ /** Models exposed by this provider. */
53
+ models: readonly PiModelSpec[];
32
54
  /** Optional Pi environment placeholder, e.g. `$OLLAMA_API_KEY`. */
33
55
  apiKeyEnvRef?: string;
34
56
  }
@@ -38,6 +60,8 @@ export declare interface WriteSingleProviderPiConfigInput extends WritePiConfigB
38
60
  provider: string;
39
61
  /** Pi model id, e.g. `qwen3-coder:480b-cloud`. */
40
62
  model: string;
63
+ /** Input modalities for `model`. Omitted leaves Pi's text-only default. */
64
+ input?: readonly PiModelModality[];
41
65
  /**
42
66
  * OpenAI-completions base URL for the provider. Defaults to Ollama Cloud.
43
67
  */
package/dist/pi-config.js CHANGED
@@ -3,6 +3,22 @@ import { join } from "node:path";
3
3
  //#region src/pi-config.ts
4
4
  /** Node-only writer used by daemon serve runs and live evals. */
5
5
  /**
6
+ * Every input modality Pi understands. Canonical for the repo: daemon
7
+ * validation, CLI parsing and wire schemas derive their allowed values from
8
+ * this list so they cannot drift from what Pi actually accepts.
9
+ */
10
+ var PI_MODEL_MODALITIES = ["text", "image"];
11
+ /**
12
+ * Normalise a model entry to Pi's on-disk shape. `input` is emitted only when
13
+ * declared, so a text-only model serializes as a bare `{ id }`.
14
+ */
15
+ function toPiModel(entry) {
16
+ return {
17
+ id: entry.id,
18
+ ...entry.input && entry.input.length > 0 ? { input: [...entry.input] } : {}
19
+ };
20
+ }
21
+ /**
6
22
  * Write Pi `models.json` + `settings.json`. Eval callers use the single-provider
7
23
  * form so scores stay attributable; serve callers may supply many providers.
8
24
  */
@@ -12,12 +28,15 @@ function writePiConfig(input) {
12
28
  api: provider.api,
13
29
  ...provider.apiKeyEnvRef ? { apiKey: provider.apiKeyEnvRef } : {},
14
30
  baseUrl: provider.baseUrl,
15
- models: provider.models.map((id) => ({ id }))
31
+ models: provider.models.map(toPiModel)
16
32
  }])) : { [input.provider]: {
17
33
  api: "openai-completions",
18
34
  apiKey: input.apiKeyEnvRef ?? "$OLLAMA_API_KEY",
19
35
  baseUrl: input.baseUrl ?? "https://ollama.com/v1",
20
- models: [{ id: input.model }]
36
+ models: [toPiModel({
37
+ id: input.model,
38
+ input: input.input
39
+ })]
21
40
  } };
22
41
  writeFileSync(join(input.piDir, "models.json"), JSON.stringify({ providers }, null, 2) + "\n", "utf8");
23
42
  const defaultSettings = multiProvider ? { enableInstallTelemetry: false } : {
@@ -35,4 +54,4 @@ function writePiConfig(input) {
35
54
  }, null, 2) + "\n", "utf8");
36
55
  }
37
56
  //#endregion
38
- export { writePiConfig };
57
+ export { PI_MODEL_MODALITIES, writePiConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/pi-runtime",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Composable MoltNet runtime kernel for Pi agents in Gondolin VMs",
@@ -36,9 +36,9 @@
36
36
  "multiformats": "^13.3.0",
37
37
  "typebox": "^1.2.8",
38
38
  "@themoltnet/agent-runtime": "1.0.3",
39
- "@themoltnet/os-keyring": "0.3.0",
40
39
  "@themoltnet/sdk": "0.142.0",
41
40
  "@themoltnet/shell-command-analyzer": "0.3.0",
41
+ "@themoltnet/os-keyring": "0.3.0",
42
42
  "@themoltnet/sandbox-gondolin": "0.5.1"
43
43
  },
44
44
  "peerDependencies": {
@@ -56,10 +56,10 @@
56
56
  "vite": "^8.0.0",
57
57
  "vite-plugin-dts": "^4.5.4",
58
58
  "vitest": "^3.0.0",
59
- "@moltnet/models": "0.1.0",
60
- "@moltnet/runtime-profiles": "0.1.0",
61
59
  "@moltnet/crypto-service": "0.1.0",
62
- "@moltnet/tasks": "0.1.0"
60
+ "@moltnet/models": "0.1.0",
61
+ "@moltnet/tasks": "0.1.0",
62
+ "@moltnet/runtime-profiles": "0.1.0"
63
63
  },
64
64
  "engines": {
65
65
  "node": ">=24"