@akagilnc/pi-workflow-roles 0.1.5475 → 0.1.5478

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.
@@ -12,12 +12,15 @@ export function acpStdioArgs(description, model, seat) {
12
12
  }
13
13
  /**
14
14
  * The modelId the host addresses the seat model by.
15
- * "argv" hosts address by bare model name; "set_model" hosts address by the
16
- * `provider:model` modelId the ACP catalog exposes (seat provider after host
17
- * alias projection, concatenated — never a package provider map).
15
+ * "argv" hosts use the bare model on the CLI flag. "set_model" hosts use the
16
+ * host-native catalog form in `setModelId` (hermes `provider:model` after seat
17
+ * provider / host-alias projection; grok bare model — never a package map).
18
18
  */
19
- export function acpModelId(modelPassing, model) {
19
+ export function acpModelId(description, model) {
20
20
  if (model?.model === undefined)
21
21
  return undefined;
22
- return modelPassing === "set_model" ? `${model.provider}:${model.model}` : model.model;
22
+ if (description.modelPassing !== "set_model")
23
+ return model.model;
24
+ const form = description.setModelId ?? "provider:model";
25
+ return form === "bare" ? model.model : `${model.provider}:${model.model}`;
23
26
  }
@@ -44,15 +44,19 @@ var init_host_descriptions = __esm({
44
44
  "use strict";
45
45
  DEFAULT_ROLE_TURN_HOST = "pi";
46
46
  HOST_DESCRIPTIONS = Object.freeze({
47
- /** Operator home `~/.grok`, native session/load resume, `agent [--model X] stdio`. */
47
+ /**
48
+ * Operator home `~/.grok`, native session/load resume, `agent stdio`.
49
+ * Model arrives as ACP `session/set_model` with bare modelId (grok catalog);
50
+ * argv `--model` is ignored by current grok (#1146 probe).
51
+ */
48
52
  "grok-build": Object.freeze({
49
53
  binaryFromHome: Object.freeze([".grok", "bin", "grok"]),
50
54
  argv: Object.freeze({
51
55
  prefix: Object.freeze(["agent"]),
52
- suffix: Object.freeze(["stdio"]),
53
- modelFlag: "--model"
56
+ suffix: Object.freeze(["stdio"])
54
57
  }),
55
- modelPassing: "argv",
58
+ modelPassing: "set_model",
59
+ setModelId: "bare",
56
60
  sessionBindingFile: "grok-acp-session.json"
57
61
  }),
58
62
  /**
@@ -70,6 +74,7 @@ var init_host_descriptions = __esm({
70
74
  thinkingFlag: "--reasoning"
71
75
  }),
72
76
  modelPassing: "set_model",
77
+ setModelId: "provider:model",
73
78
  sessionBindingFile: "hermes-acp-session.json",
74
79
  seatProfileSoul: Object.freeze({
75
80
  flag: "-p",
@@ -24837,9 +24842,11 @@ function acpStdioArgs(description, model, seat) {
24837
24842
  ...suffix
24838
24843
  ];
24839
24844
  }
24840
- function acpModelId(modelPassing, model) {
24845
+ function acpModelId(description, model) {
24841
24846
  if (model?.model === void 0) return void 0;
24842
- return modelPassing === "set_model" ? `${model.provider}:${model.model}` : model.model;
24847
+ if (description.modelPassing !== "set_model") return model.model;
24848
+ const form = description.setModelId ?? "provider:model";
24849
+ return form === "bare" ? model.model : `${model.provider}:${model.model}`;
24843
24850
  }
24844
24851
 
24845
24852
  // src/acp-host/role-turn-host.ts
@@ -25226,7 +25233,7 @@ function createAcpRoleTurnHost(config) {
25226
25233
  });
25227
25234
  const initializeMeta = initialized._meta;
25228
25235
  const availableModels = Array.isArray(initializeMeta?.modelState?.availableModels) ? initializeMeta.modelState.availableModels : void 0;
25229
- if (request.model !== void 0 && availableModels !== void 0 && !availableModels.some((entry) => typeof entry === "object" && entry !== null && entry.modelId === acpModelId(config.modelPassing, request.model))) {
25236
+ if (request.model !== void 0 && availableModels !== void 0 && !availableModels.some((entry) => typeof entry === "object" && entry !== null && entry.modelId === acpModelId(config, request.model))) {
25230
25237
  outcome = externalHostFailure("activation", "AcpHostModelMismatch", "host-model-mismatch", {
25231
25238
  provider: request.model.provider,
25232
25239
  model: request.model.model
@@ -25291,7 +25298,7 @@ function createAcpRoleTurnHost(config) {
25291
25298
  if (config.modelPassing === "set_model" && request.model !== void 0 && sessionId !== void 0) {
25292
25299
  await rpc("session/set_model", {
25293
25300
  sessionId,
25294
- modelId: acpModelId(config.modelPassing, request.model)
25301
+ modelId: acpModelId(config, request.model)
25295
25302
  });
25296
25303
  sessionId = await loadSession(sessionId);
25297
25304
  }
@@ -25512,6 +25519,7 @@ function createProductionAcpRoleTurnHost(options) {
25512
25519
  hostName,
25513
25520
  sessionIdentity: createSessionIdentityAuthority(principalAuthority, description.sessionBindingFile),
25514
25521
  modelPassing: description.modelPassing,
25522
+ ...description.setModelId === void 0 ? {} : { setModelId: description.setModelId },
25515
25523
  roleRuntimeDependencies: createRoleRuntimeDependencies(packageRoot),
25516
25524
  async connect(request) {
25517
25525
  const seatProfile = description.seatProfileSoul;
@@ -44,15 +44,19 @@ var init_host_descriptions = __esm({
44
44
  "use strict";
45
45
  DEFAULT_ROLE_TURN_HOST = "pi";
46
46
  HOST_DESCRIPTIONS = Object.freeze({
47
- /** Operator home `~/.grok`, native session/load resume, `agent [--model X] stdio`. */
47
+ /**
48
+ * Operator home `~/.grok`, native session/load resume, `agent stdio`.
49
+ * Model arrives as ACP `session/set_model` with bare modelId (grok catalog);
50
+ * argv `--model` is ignored by current grok (#1146 probe).
51
+ */
48
52
  "grok-build": Object.freeze({
49
53
  binaryFromHome: Object.freeze([".grok", "bin", "grok"]),
50
54
  argv: Object.freeze({
51
55
  prefix: Object.freeze(["agent"]),
52
- suffix: Object.freeze(["stdio"]),
53
- modelFlag: "--model"
56
+ suffix: Object.freeze(["stdio"])
54
57
  }),
55
- modelPassing: "argv",
58
+ modelPassing: "set_model",
59
+ setModelId: "bare",
56
60
  sessionBindingFile: "grok-acp-session.json"
57
61
  }),
58
62
  /**
@@ -70,6 +74,7 @@ var init_host_descriptions = __esm({
70
74
  thinkingFlag: "--reasoning"
71
75
  }),
72
76
  modelPassing: "set_model",
77
+ setModelId: "provider:model",
73
78
  sessionBindingFile: "hermes-acp-session.json",
74
79
  seatProfileSoul: Object.freeze({
75
80
  flag: "-p",
@@ -13,15 +13,19 @@ export function resolveHostBinary(description, operatorHome) {
13
13
  }
14
14
  export const DEFAULT_ROLE_TURN_HOST = "pi";
15
15
  export const HOST_DESCRIPTIONS = Object.freeze({
16
- /** Operator home `~/.grok`, native session/load resume, `agent [--model X] stdio`. */
16
+ /**
17
+ * Operator home `~/.grok`, native session/load resume, `agent stdio`.
18
+ * Model arrives as ACP `session/set_model` with bare modelId (grok catalog);
19
+ * argv `--model` is ignored by current grok (#1146 probe).
20
+ */
17
21
  "grok-build": Object.freeze({
18
22
  binaryFromHome: Object.freeze([".grok", "bin", "grok"]),
19
23
  argv: Object.freeze({
20
24
  prefix: Object.freeze(["agent"]),
21
25
  suffix: Object.freeze(["stdio"]),
22
- modelFlag: "--model",
23
26
  }),
24
- modelPassing: "argv",
27
+ modelPassing: "set_model",
28
+ setModelId: "bare",
25
29
  sessionBindingFile: "grok-acp-session.json",
26
30
  }),
27
31
  /**
@@ -39,6 +43,7 @@ export const HOST_DESCRIPTIONS = Object.freeze({
39
43
  thinkingFlag: "--reasoning",
40
44
  }),
41
45
  modelPassing: "set_model",
46
+ setModelId: "provider:model",
42
47
  sessionBindingFile: "hermes-acp-session.json",
43
48
  seatProfileSoul: Object.freeze({
44
49
  flag: "-p",
@@ -14736,15 +14736,19 @@ var init_host_descriptions = __esm({
14736
14736
  "src/host-descriptions.ts"() {
14737
14737
  "use strict";
14738
14738
  HOST_DESCRIPTIONS = Object.freeze({
14739
- /** Operator home `~/.grok`, native session/load resume, `agent [--model X] stdio`. */
14739
+ /**
14740
+ * Operator home `~/.grok`, native session/load resume, `agent stdio`.
14741
+ * Model arrives as ACP `session/set_model` with bare modelId (grok catalog);
14742
+ * argv `--model` is ignored by current grok (#1146 probe).
14743
+ */
14740
14744
  "grok-build": Object.freeze({
14741
14745
  binaryFromHome: Object.freeze([".grok", "bin", "grok"]),
14742
14746
  argv: Object.freeze({
14743
14747
  prefix: Object.freeze(["agent"]),
14744
- suffix: Object.freeze(["stdio"]),
14745
- modelFlag: "--model"
14748
+ suffix: Object.freeze(["stdio"])
14746
14749
  }),
14747
- modelPassing: "argv",
14750
+ modelPassing: "set_model",
14751
+ setModelId: "bare",
14748
14752
  sessionBindingFile: "grok-acp-session.json"
14749
14753
  }),
14750
14754
  /**
@@ -14762,6 +14766,7 @@ var init_host_descriptions = __esm({
14762
14766
  thinkingFlag: "--reasoning"
14763
14767
  }),
14764
14768
  modelPassing: "set_model",
14769
+ setModelId: "provider:model",
14765
14770
  sessionBindingFile: "hermes-acp-session.json",
14766
14771
  seatProfileSoul: Object.freeze({
14767
14772
  flag: "-p",
@@ -15805,15 +15805,19 @@ var init_host_descriptions = __esm({
15805
15805
  "use strict";
15806
15806
  DEFAULT_ROLE_TURN_HOST = "pi";
15807
15807
  HOST_DESCRIPTIONS = Object.freeze({
15808
- /** Operator home `~/.grok`, native session/load resume, `agent [--model X] stdio`. */
15808
+ /**
15809
+ * Operator home `~/.grok`, native session/load resume, `agent stdio`.
15810
+ * Model arrives as ACP `session/set_model` with bare modelId (grok catalog);
15811
+ * argv `--model` is ignored by current grok (#1146 probe).
15812
+ */
15809
15813
  "grok-build": Object.freeze({
15810
15814
  binaryFromHome: Object.freeze([".grok", "bin", "grok"]),
15811
15815
  argv: Object.freeze({
15812
15816
  prefix: Object.freeze(["agent"]),
15813
- suffix: Object.freeze(["stdio"]),
15814
- modelFlag: "--model"
15817
+ suffix: Object.freeze(["stdio"])
15815
15818
  }),
15816
- modelPassing: "argv",
15819
+ modelPassing: "set_model",
15820
+ setModelId: "bare",
15817
15821
  sessionBindingFile: "grok-acp-session.json"
15818
15822
  }),
15819
15823
  /**
@@ -15831,6 +15835,7 @@ var init_host_descriptions = __esm({
15831
15835
  thinkingFlag: "--reasoning"
15832
15836
  }),
15833
15837
  modelPassing: "set_model",
15838
+ setModelId: "provider:model",
15834
15839
  sessionBindingFile: "hermes-acp-session.json",
15835
15840
  seatProfileSoul: Object.freeze({
15836
15841
  flag: "-p",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.5475",
3
+ "version": "0.1.5478",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -18,11 +18,17 @@ export type AcpHostDescription = HostIdentityDescription & Readonly<{
18
18
  }>;
19
19
  /**
20
20
  * How the seat model reaches the agent:
21
- * - "argv": passed as the CLI `--model` flag (grok);
22
- * - "set_model": sent as an ACP `session/set_model` RPC with modelId
23
- * `provider:model` (hermes).
21
+ * - "argv": passed as the CLI `--model` flag;
22
+ * - "set_model": sent as an ACP `session/set_model` RPC after session new/load
23
+ * and before prompt. Catalog modelId shape is `setModelId` (host-native).
24
24
  */
25
25
  modelPassing: "argv" | "set_model";
26
+ /**
27
+ * Host-native `session/set_model` modelId form when `modelPassing` is
28
+ * `"set_model"`. hermes catalogs are `provider:model`; grok catalogs are bare
29
+ * model ids. Ignored for `"argv"` hosts.
30
+ */
31
+ setModelId?: "bare" | "provider:model";
26
32
  /**
27
33
  * When set, the production factory ensures a seat profile whose SOUL.md is a
28
34
  * symlink to the packaged role soul, and prefixes argv with `flag <name>`.
@@ -51,14 +57,19 @@ export function acpStdioArgs(
51
57
 
52
58
  /**
53
59
  * The modelId the host addresses the seat model by.
54
- * "argv" hosts address by bare model name; "set_model" hosts address by the
55
- * `provider:model` modelId the ACP catalog exposes (seat provider after host
56
- * alias projection, concatenated — never a package provider map).
60
+ * "argv" hosts use the bare model on the CLI flag. "set_model" hosts use the
61
+ * host-native catalog form in `setModelId` (hermes `provider:model` after seat
62
+ * provider / host-alias projection; grok bare model — never a package map).
57
63
  */
58
64
  export function acpModelId(
59
- modelPassing: AcpHostDescription["modelPassing"],
65
+ description: {
66
+ readonly modelPassing: AcpHostDescription["modelPassing"];
67
+ readonly setModelId?: AcpHostDescription["setModelId"] | undefined;
68
+ },
60
69
  model?: { readonly model?: string; readonly provider?: string },
61
70
  ): string | undefined {
62
71
  if (model?.model === undefined) return undefined;
63
- return modelPassing === "set_model" ? `${model.provider}:${model.model}` : model.model;
72
+ if (description.modelPassing !== "set_model") return model.model;
73
+ const form = description.setModelId ?? "provider:model";
74
+ return form === "bare" ? model.model : `${model.provider}:${model.model}`;
64
75
  }
@@ -63,6 +63,7 @@ export function createProductionAcpRoleTurnHost(options: ProductionAcpHostOption
63
63
  hostName,
64
64
  sessionIdentity: createSessionIdentityAuthority(principalAuthority, description.sessionBindingFile),
65
65
  modelPassing: description.modelPassing,
66
+ ...(description.setModelId === undefined ? {} : { setModelId: description.setModelId }),
66
67
  roleRuntimeDependencies: createRoleRuntimeDependencies(packageRoot),
67
68
  async connect(request) {
68
69
  const seatProfile = description.seatProfileSoul;
@@ -98,10 +98,13 @@ export type AcpRoleTurnHostConfig = Readonly<{
98
98
  hostName: string;
99
99
  /**
100
100
  * How the seat model reaches the agent: "set_model" sends an ACP
101
- * `session/set_model` RPC with modelId `provider:model` once the session
102
- * exists (new or loaded); "argv" leaves it to the connect argv (--model).
101
+ * `session/set_model` RPC once the session exists (new or loaded); "argv"
102
+ * leaves it to the connect argv (--model). Catalog modelId shape is
103
+ * `setModelId` (host-native).
103
104
  */
104
105
  modelPassing: AcpHostDescription["modelPassing"];
106
+ /** Host-native set_model catalog id; see AcpHostDescription.setModelId. */
107
+ setModelId?: AcpHostDescription["setModelId"];
105
108
  connect(request: RoleTurnRequest): Promise<AcpConnection>;
106
109
  prepare(request: RoleTurnRequest): Promise<PreparedRoleTurn>;
107
110
  }>;
@@ -296,7 +299,7 @@ export function createAcpRoleTurnHost(config: AcpRoleTurnHostConfig): RoleTurnHo
296
299
  : undefined;
297
300
  if (request.model !== undefined && availableModels !== undefined && !availableModels.some((entry) =>
298
301
  typeof entry === "object" && entry !== null
299
- && (entry as { modelId?: unknown }).modelId === acpModelId(config.modelPassing, request.model))) {
302
+ && (entry as { modelId?: unknown }).modelId === acpModelId(config, request.model))) {
300
303
  outcome = failure("activation", "AcpHostModelMismatch", "host-model-mismatch", {
301
304
  provider: request.model.provider,
302
305
  model: request.model.model,
@@ -354,11 +357,11 @@ export function createAcpRoleTurnHost(config: AcpRoleTurnHostConfig): RoleTurnHo
354
357
  }
355
358
 
356
359
  if (sessionReady) {
357
- // set_model seat provider:model (#778); may rebuild agent — re-bind via loadSession.
360
+ // set_model host-native catalog id (#778 / #1146); may rebuild agent — re-bind via loadSession.
358
361
  if (config.modelPassing === "set_model" && request.model !== undefined && sessionId !== undefined) {
359
362
  await rpc("session/set_model", {
360
363
  sessionId,
361
- modelId: acpModelId(config.modelPassing, request.model),
364
+ modelId: acpModelId(config, request.model),
362
365
  });
363
366
  sessionId = await loadSession(sessionId);
364
367
  }
@@ -32,15 +32,19 @@ export const DEFAULT_ROLE_TURN_HOST = "pi" as const;
32
32
  export type HostFamily = "acp" | "headless";
33
33
 
34
34
  export const HOST_DESCRIPTIONS: Readonly<Record<string, AcpHostDescription>> = Object.freeze({
35
- /** Operator home `~/.grok`, native session/load resume, `agent [--model X] stdio`. */
35
+ /**
36
+ * Operator home `~/.grok`, native session/load resume, `agent stdio`.
37
+ * Model arrives as ACP `session/set_model` with bare modelId (grok catalog);
38
+ * argv `--model` is ignored by current grok (#1146 probe).
39
+ */
36
40
  "grok-build": Object.freeze({
37
41
  binaryFromHome: Object.freeze([".grok", "bin", "grok"]),
38
42
  argv: Object.freeze({
39
43
  prefix: Object.freeze(["agent"]),
40
44
  suffix: Object.freeze(["stdio"]),
41
- modelFlag: "--model",
42
45
  }),
43
- modelPassing: "argv",
46
+ modelPassing: "set_model",
47
+ setModelId: "bare",
44
48
  sessionBindingFile: "grok-acp-session.json",
45
49
  }),
46
50
  /**
@@ -58,6 +62,7 @@ export const HOST_DESCRIPTIONS: Readonly<Record<string, AcpHostDescription>> = O
58
62
  thinkingFlag: "--reasoning",
59
63
  }),
60
64
  modelPassing: "set_model",
65
+ setModelId: "provider:model",
61
66
  sessionBindingFile: "hermes-acp-session.json",
62
67
  seatProfileSoul: Object.freeze({
63
68
  flag: "-p",