@canonmsg/agent-sdk 12.3.1 → 12.4.1

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.
@@ -2,7 +2,7 @@ import {
2
2
  createMlsDevCredentialVerifier,
3
3
  mlsDevDeviceHttpConfiguration,
4
4
  parseMlsDevClientConfiguration
5
- } from "./chunk-5MI6Q3VS.js";
5
+ } from "./chunk-GWQF4WFT.js";
6
6
  export {
7
7
  createMlsDevCredentialVerifier,
8
8
  mlsDevDeviceHttpConfiguration,
package/dist/cli.js CHANGED
@@ -3,6 +3,7 @@ import {
3
3
  MLS_SETUP_ACTIONS,
4
4
  assertPrivateHome,
5
5
  awaitErrand,
6
+ bundledMlsCustodyHelper,
6
7
  checkCodex,
7
8
  claudeDriver,
8
9
  codeDriver,
@@ -15,6 +16,7 @@ import {
15
16
  loadInstructions,
16
17
  loadMlsDevConfiguration,
17
18
  loadRelayConfiguration,
19
+ managedMlsDevice,
18
20
  queueErrand,
19
21
  readRelayCredential,
20
22
  relayRunnerHome,
@@ -22,7 +24,7 @@ import {
22
24
  runnerLockName,
23
25
  startRelayChannel,
24
26
  writeRelayCredential
25
- } from "./chunks/chunk-HI2SVCUL.js";
27
+ } from "./chunks/chunk-NXL4C2R6.js";
26
28
  import {
27
29
  CanonApiError,
28
30
  CanonClient,
@@ -33,11 +35,12 @@ import {
33
35
  resolveCanonRuntimeConnection,
34
36
  runCli,
35
37
  verifyCanonRuntimeConnection
36
- } from "./chunks/chunk-SKFI2MJA.js";
38
+ } from "./chunks/chunk-6PKXASSK.js";
37
39
  import {
38
40
  __name,
39
- isCanonClientVersion
40
- } from "./chunks/chunk-5MI6Q3VS.js";
41
+ isCanonClientVersion,
42
+ isMlsEnvironmentId
43
+ } from "./chunks/chunk-GWQF4WFT.js";
41
44
 
42
45
  // src/cli.ts
43
46
  import { realpathSync } from "node:fs";
@@ -66,9 +69,9 @@ Usage:
66
69
  canon-agent run --driver codex [--cwd <dir>] [--model <id>] [--sandbox <mode>]
67
70
  [--approval-policy <policy>] [--codex-path <path>] [--profile <name>]
68
71
  [--environment <id>]
69
- canon-agent run --driver connector --relay-config <path> --mls-dev-config <path>
72
+ canon-agent run --driver connector --relay-config <path> [--mls-dev-config <path>]
70
73
  [--profile <name>] [--environment <id>]
71
- canon-agent mls --action <action> --mls-dev-config <path> [--room <id>]
74
+ canon-agent mls --action <action> [--mls-dev-config <path>] [--room <id>]
72
75
  [--relay-config <path>] [--profile <name>] [--environment <id>]
73
76
  canon-agent tell --room <id> --text <text> (--agent <id> | --profile <name>)
74
77
  [--environment <id>] [--wait]
@@ -80,10 +83,12 @@ Usage:
80
83
  canon-agent errands [--follow] [--cancel <errand id>] (--agent <id> | --profile <name>)
81
84
  [--environment <id>]
82
85
 
83
- Every run command also takes --mls-dev-config <path>, which gives the agent its MLS
84
- device so it can take part in encrypted rooms. Without it, the agent refuses encrypted
85
- rooms and logs each one once; where Canon encrypts every new conversation, it does not
86
- start.
86
+ Encrypted rooms need the agent's MLS device. On macOS (Apple silicon) and Linux
87
+ (x64, arm64) the runner keeps it in $CANON_HOME with the custody helper this package
88
+ ships, and sets it up on the agent's first start: nothing to configure. Every run
89
+ command also takes --mls-dev-config <path>, an operator's own custody instead. With
90
+ neither, the agent refuses encrypted rooms, and where Canon encrypts every new
91
+ conversation it does not start.
87
92
 
88
93
  Team rooms (an owner's agents working together): claude and codex also take
89
94
  [--instructions <file>] [--trust-agent <agentId>]...; every run command takes
@@ -146,20 +151,22 @@ Flags:
146
151
  marks destructive (Claude Code's default-to-no prompts,
147
152
  Codex's risky commands and deletions) for the rest of the
148
153
  session. Off by default: each such action asks.
149
- --relay-config <path> connector (Dev only): run as Canon's class-C relay for one agent
154
+ --relay-config <path> connector: run as Canon's class-C relay for one agent
150
155
  connected through Canon's MCP connector. A private JSON file
151
156
  naming the agent, where the channel to Canon's Functions
152
157
  listens, and the path of the channel secret. Canon delivers
153
158
  the relay's own credential over that channel when the owner
154
159
  enables the relay (no API key is used); it is kept in
155
160
  $CANON_HOME/relay. The relay serves only encrypted rooms,
156
- which are then not end-to-end encrypted to that agent. With
157
- "mls", it sets up the relay's device with that credential.
158
- --mls-dev-config <p> The operator's MLS configuration: an absolute path to a private
159
- JSON file with the environment's issuer pins and the custody
160
- helper (no keys or credentials).
161
- --action <action> mls: status (public device state), provision (create the
162
- portable vault, once), enroll, renew, publish (this device's
161
+ which are then not end-to-end encrypted to that agent. It sets
162
+ up the relay's device with that credential.
163
+ --mls-dev-config <p> An operator's own MLS configuration, instead of the device the
164
+ runner keeps itself: an absolute path to a private JSON file
165
+ with the environment's issuer pins and the custody helper (no
166
+ keys or credentials).
167
+ --action <action> mls: status (public device state), setup (whatever is left of
168
+ provision then enroll), provision (create the portable vault,
169
+ once), enroll, renew, publish (this device's
163
170
  KeyPackage for --room) or refresh (catch up --room). It never
164
171
  starts a model, and uses the same home as "run": stop the
165
172
  agent first.
@@ -232,7 +239,6 @@ async function main() {
232
239
  }
233
240
  if (values.driver === "code" && !values.module) throw new UsageError("--driver code needs --module <path>.");
234
241
  if (values.driver === "connector" !== !!values["relay-config"]) throw new UsageError("--relay-config goes with --driver connector, which needs it.");
235
- if (values.driver === "connector" && !values["mls-dev-config"]) throw new UsageError("--driver connector needs --mls-dev-config <path>: the relay holds the agent's MLS device.");
236
242
  if (!["claude", "codex"].includes(values.driver) && (values.instructions !== void 0 || values["trust-agent"]?.length)) {
237
243
  throw new UsageError("--instructions and --trust-agent go with --driver claude or codex.");
238
244
  }
@@ -254,7 +260,7 @@ async function main() {
254
260
  if (trustedAgents.some((id) => !/^[\w.:-]{1,200}$/.test(id))) throw new UsageError("--trust-agent takes an agent id.");
255
261
  const instructions = values.instructions !== void 0 ? await loadInstructions(resolve(values.instructions)) : void 0;
256
262
  const { environmentId, home, profile, apiKey } = await settings(values);
257
- const mls = values["mls-dev-config"] ? await loadMlsDevConfiguration(values["mls-dev-config"], { environmentId }) : void 0;
263
+ const mls = await mlsDevice(values, environmentId, home);
258
264
  const baseUrl = process.env.CANON_BASE_URL || profile?.baseUrl;
259
265
  const streamUrl = process.env.CANON_STREAM_URL || profile?.streamUrl;
260
266
  let driver;
@@ -352,7 +358,8 @@ async function runRelay(values, team) {
352
358
  channel.serve(void 0);
353
359
  await current?.stop();
354
360
  current = void 0;
355
- const mls = await loadMlsDevConfiguration(values["mls-dev-config"], { environmentId });
361
+ const mls = await mlsDevice(values, environmentId, relayRunnerHome(home, stored2.installationId));
362
+ if (!mls) throw new Error(`this host has no MLS custody helper (${process.platform}-${process.arch}): give the relay --mls-dev-config <path>`);
356
363
  const driver = connectorDriver();
357
364
  const runner = await createRunner({
358
365
  apiKey: stored2.credential,
@@ -455,11 +462,17 @@ async function settings(values, { key = true } = {}) {
455
462
  return { environmentId, home, profile, apiKey: process.env.CANON_API_KEY || profile?.apiKey || "" };
456
463
  }
457
464
  __name(settings, "settings");
465
+ async function mlsDevice(values, environmentId, home) {
466
+ if (values["mls-dev-config"]) return loadMlsDevConfiguration(values["mls-dev-config"], { environmentId });
467
+ if (!isMlsEnvironmentId(environmentId)) return void 0;
468
+ const helper = bundledMlsCustodyHelper();
469
+ return helper ? managedMlsDevice({ home, environmentId, helper }) : void 0;
470
+ }
471
+ __name(mlsDevice, "mlsDevice");
458
472
  async function mlsSetup(values) {
459
473
  const action = values.action;
460
474
  if (!action || !MLS_SETUP_ACTIONS.includes(action)) throw new UsageError(`--action must be one of ${MLS_SETUP_ACTIONS.join(", ")}.`);
461
475
  if ((action === "publish" || action === "refresh") !== !!values.room) throw new UsageError("--room is needed for publish and refresh, and only for them.");
462
- if (!values["mls-dev-config"]) throw new UsageError("--mls-dev-config <path> is required.");
463
476
  const settled = await settings(values, { key: !values["relay-config"] });
464
477
  const { environmentId, profile } = settled;
465
478
  const relay = values["relay-config"] ? await loadRelayConfiguration(values["relay-config"], { environmentId }) : void 0;
@@ -469,7 +482,8 @@ async function mlsSetup(values) {
469
482
  }
470
483
  const apiKey = stored ? stored.credential : settled.apiKey;
471
484
  const home = stored ? relayRunnerHome(settled.home, stored.installationId) : settled.home;
472
- const config = await loadMlsDevConfiguration(values["mls-dev-config"], { environmentId });
485
+ const config = await mlsDevice(values, environmentId, home);
486
+ if (!config) throw new Error(`@canonmsg/agent-sdk ships no MLS custody helper for ${process.platform}-${process.arch}: give --mls-dev-config <path>.`);
473
487
  let client;
474
488
  let lock;
475
489
  try {
@@ -489,7 +503,7 @@ async function mlsSetup(values) {
489
503
  });
490
504
  const me = await client.getAgentMe();
491
505
  lock = acquireLock(runnerLockName(environmentId, me.agentId), home);
492
- console.log(JSON.stringify(await runMlsDevSetup(await client.getEndpoint(), action, values.room, config.provision)));
506
+ console.log(JSON.stringify(await runMlsDevSetup(await client.getEndpoint(), action, values.room, config.provision, config.provisioned)));
493
507
  } finally {
494
508
  try {
495
509
  await client?.close();
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export type { Runner, RunnerOptions } from './runner/runner.js';
3
3
  export { ConnectorRelayError, DriverSessionError } from './runner/types.js';
4
4
  export { loadMlsDevConfiguration, MLS_SETUP_ACTIONS, mlsDevRoomPackageId, runMlsDevSetup } from './runner/mls.js';
5
5
  export type { MlsSetupAction, RunnerMlsOptions } from './runner/mls.js';
6
+ export { bundledMlsCustodyHelper, MLS_ENVIRONMENT_PINS } from './runner/mls-bundled.js';
7
+ export { managedMlsDevice, type ManagedMlsDevice, type ManagedMlsDeviceOptions } from './runner/mls-managed.js';
6
8
  export type { ActivityEvent, AskAnswer, AskRequest, DriverCapabilities, DriverResult, DriverState, DriverTurn, ErrandFacts, RuntimeDriver, ToolDefinition, ToolResult, TurnInput, TurnInputMessage, TurnTools, } from './runner/types.js';
7
9
  export { errandJournal, errandsDirectory, queueErrand } from './runner/errands.js';
8
10
  export type { ErrandCommand, ErrandInput, ErrandKind, ErrandRecord, ErrandStatus } from './runner/errands.js';
package/dist/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  import {
2
2
  ConnectorRelayError,
3
3
  DriverSessionError,
4
+ MLS_ENVIRONMENT_PINS,
4
5
  MLS_SETUP_ACTIONS,
6
+ bundledMlsCustodyHelper,
5
7
  checkCodex,
6
8
  claudeDriver,
7
9
  codeDriver,
@@ -13,12 +15,13 @@ import {
13
15
  loadClaudeQuery,
14
16
  loadMlsDevConfiguration,
15
17
  loadRelayConfiguration,
18
+ managedMlsDevice,
16
19
  mlsDevRoomPackageId,
17
20
  queueErrand,
18
21
  runMlsDevSetup,
19
22
  runtimeDescriptor,
20
23
  startRelayChannel
21
- } from "./chunks/chunk-HI2SVCUL.js";
24
+ } from "./chunks/chunk-NXL4C2R6.js";
22
25
  import {
23
26
  CanonApiError,
24
27
  DEFAULT_ANTHROPIC_REQUEST_HEADROOM_BYTES,
@@ -43,8 +46,8 @@ import {
43
46
  toAnthropicImageBlock,
44
47
  toAnthropicImageBlocksWithinBudget,
45
48
  uploadMediaFile
46
- } from "./chunks/chunk-SKFI2MJA.js";
47
- import "./chunks/chunk-5MI6Q3VS.js";
49
+ } from "./chunks/chunk-6PKXASSK.js";
50
+ import "./chunks/chunk-GWQF4WFT.js";
48
51
  export {
49
52
  CanonApiError,
50
53
  ConnectorRelayError,
@@ -55,7 +58,9 @@ export {
55
58
  MAX_ANTHROPIC_IMAGE_RAW_BYTES,
56
59
  MAX_ANTHROPIC_REQUEST_BYTES,
57
60
  MAX_CANON_MEDIA_BYTES,
61
+ MLS_ENVIRONMENT_PINS,
58
62
  MLS_SETUP_ACTIONS,
63
+ bundledMlsCustodyHelper,
59
64
  checkCodex,
60
65
  claudeDriver,
61
66
  clearPendingRegistration,
@@ -74,6 +79,7 @@ export {
74
79
  loadClaudeQuery,
75
80
  loadMlsDevConfiguration,
76
81
  loadRelayConfiguration,
82
+ managedMlsDevice,
77
83
  materializeAttachment,
78
84
  materializeMessageMedia,
79
85
  materializeReplyContextMedia,
@@ -8,6 +8,11 @@ export type EndpointContentLane = 'operation.request' | 'operation.receipt' | 'q
8
8
  * authenticated encrypted protocol before they can operate on a protected room.
9
9
  * Their routing fields remain public metadata; classification is not authority. */
10
10
  export declare const MLS_DEV_UNSUPPORTED_CONTENT_ACTIONS: readonly ["forward_message"];
11
+ /** Operations that send their private content to a named processor in an encrypted room too, disclosed where the
12
+ * app offers them, with the fields reviewed for that: an image's description and source photo go through Canon to
13
+ * Google (image-generation.md). The fields stay classified as private; only the encrypted room's plaintext fence lets
14
+ * them through, and any other field still keeps the operation out. */
15
+ export declare const MLS_DEV_DISCLOSED_PROCESSING_FIELDS: Readonly<Record<string, readonly string[]>>;
11
16
  export declare const ENDPOINT_CONTENT_ACTIONS: readonly ["mls_application", "mls_group_control", "initialize_endpoint", "append_artifact_command", "retain_artifact_asset", "sync_phone_contacts", "update_agent_behavior_policy", "update_conversation_agent_behavior_policy", "send_message", "delete_message", "forward_message", "react", "verb_execute", "send_contextual_message", "create_interaction", "consume_interaction", "start_conversation", "create_conversation", "add_member", "remove_member", "leave_conversation", "update_member_role", "update_conversation", "rename_conversation", "update_topic", "update_group_avatar", "mark_read", "cancel_queued_message", "set_conversation_preferences", "set_block", "save_contact", "remove_contact", "respond_interaction", "session_control", "approve_contact_request", "reject_contact_request", "cancel_direct_request", "update_message_disposition", "create_upload", "finalize_upload", "delete_upload", "retry_video_processing", "stage_media_message", "cancel_media_message", "renew_media_message_upload", "finalize_memo_stream", "abort_memo_stream", "create_voice_session", "join_voice_session", "decline_voice_session", "end_voice_session", "consume_runtime_signal", "consume_runtime_primitive", "generate_image"];
12
17
  export declare const ENDPOINT_CONTENT_FUNCTION_QUERIES: readonly ["mls_group_feed", "mls_group_controls", "mls_group_admissions", "mls_interactions", "list_artifacts", "get_artifact_log", "get_artifact_asset", "discover_agents", "get_unread_summary", "peek_runtime_signal", "list_runtime_primitives", "get_agent_behavior_policy", "get_conversation_agent_behavior_policy", "get_ephemeral", "list_voice_sessions", "list_contact_requests", "list_conversations", "list_messages", "get_messages", "admission_fences", "list_contacts", "get_contact", "get_members", "resolve_admission", "resolve_group_admission", "get_runtime_card_state", "conversation", "conversation_changes", "get_upload", "get_media_message", "get_voice_session", "get_image_generation", "get_image_generation_status", "same_owner_agents"];
13
18
  export declare const ENDPOINT_CONTENT_QUERIES: readonly ["mls_group_feed", "mls_group_controls", "mls_group_admissions", "mls_interactions", "list_artifacts", "get_artifact_log", "get_artifact_asset", "discover_agents", "get_unread_summary", "peek_runtime_signal", "list_runtime_primitives", "get_agent_behavior_policy", "get_conversation_agent_behavior_policy", "get_ephemeral", "list_voice_sessions", "list_contact_requests", "list_conversations", "list_messages", "get_messages", "admission_fences", "list_contacts", "get_contact", "get_members", "resolve_admission", "resolve_group_admission", "get_runtime_card_state", "conversation", "conversation_changes", "get_upload", "get_media_message", "get_voice_session", "get_image_generation", "get_image_generation_status", "same_owner_agents", "admit_messages"];
@@ -105,6 +105,14 @@ export interface MlsDevGroupClient {
105
105
  operationId?: string;
106
106
  }): Promise<EndpointOperation>;
107
107
  refresh(conversationId: string): Promise<MlsDevGroupView | undefined>;
108
+ /** Whether a room snapshot Canon just returned shows nothing this device lacks of the room's feed: no entry past its
109
+ * cursor, the membership it last fetched under, and no held removal. Then there is nothing to fetch, and this counts
110
+ * as catching up on the room. */
111
+ heldCurrent(conversationId: string, snapshot: {
112
+ mlsFeedOrdinal?: unknown;
113
+ membershipRevision?: unknown;
114
+ mlsRemoval?: unknown;
115
+ }): Promise<boolean>;
108
116
  read(conversationId: string): Promise<MlsDevGroupView | undefined>;
109
117
  readVerifiedMessageBinding(input: {
110
118
  conversationId: string;
package/dist/media.js CHANGED
@@ -18,8 +18,8 @@ import {
18
18
  toAnthropicImageBlock,
19
19
  toAnthropicImageBlocksWithinBudget,
20
20
  uploadMediaFile
21
- } from "./chunks/chunk-SKFI2MJA.js";
22
- import "./chunks/chunk-5MI6Q3VS.js";
21
+ } from "./chunks/chunk-6PKXASSK.js";
22
+ import "./chunks/chunk-GWQF4WFT.js";
23
23
  export {
24
24
  DEFAULT_ANTHROPIC_REQUEST_HEADROOM_BYTES,
25
25
  DEFAULT_MEDIA_CACHE_DIR,
@@ -0,0 +1,25 @@
1
+ import type { MlsEnvironmentId } from '../internal/backend-contracts/index.js';
2
+ /**
3
+ * Each environment's Cloud KMS issuer and feed-receipt key versions (public keys, raw Ed25519 in base64url). During an
4
+ * issuer rotation `issuerKeys` holds both versions (docs/mls-dev-activation.md, "Planned issuer rotation"), and an SDK
5
+ * release carrying the new one ships before issuance switches.
6
+ */
7
+ export declare const MLS_ENVIRONMENT_PINS: Readonly<Record<MlsEnvironmentId, {
8
+ issuerKeys: ReadonlyArray<{
9
+ keyVersion: string;
10
+ signaturePublicKey: string;
11
+ }>;
12
+ receiptKeys: ReadonlyArray<{
13
+ keyVersion: string;
14
+ signaturePublicKey: string;
15
+ }>;
16
+ }>>;
17
+ /**
18
+ * The custody helper this package ships for this host (`dist/mls/<platform>/canon-mls-custody`), checked against its
19
+ * pin, or undefined where it ships none: an Intel Mac, musl, Windows, or a build of this package without helpers. A
20
+ * file that is there but differs from its pin is refused.
21
+ */
22
+ export declare function bundledMlsCustodyHelper(): {
23
+ path: string;
24
+ sha256: string;
25
+ } | undefined;
@@ -0,0 +1,31 @@
1
+ import type { MlsDevDeviceContext, MlsEnvironmentId } from '../internal/backend-contracts/index.js';
2
+ import type { RunnerMlsOptions } from './mls.js';
3
+ export interface ManagedMlsDeviceOptions {
4
+ /** The runner's home (CANON_HOME, or a relay installation's home). */
5
+ home: string;
6
+ environmentId: MlsEnvironmentId;
7
+ /** Another helper than this package's for the host, such as one built from mls/native. */
8
+ helper?: {
9
+ path: string;
10
+ sha256: string;
11
+ };
12
+ /** Other public pins than this package's for the environment. */
13
+ pins?: {
14
+ issuerKeys: ReadonlyArray<{
15
+ keyVersion: string;
16
+ signaturePublicKey: string;
17
+ }>;
18
+ receiptKeys: ReadonlyArray<{
19
+ keyVersion: string;
20
+ signaturePublicKey: string;
21
+ }>;
22
+ };
23
+ timeoutMs?: number;
24
+ }
25
+ export type ManagedMlsDevice = RunnerMlsOptions & {
26
+ provision(context: MlsDevDeviceContext): Promise<void>;
27
+ /** Whether this context's vault exists: its device was provisioned here. */
28
+ provisioned(context: MlsDevDeviceContext): boolean;
29
+ close(): Promise<void>;
30
+ };
31
+ export declare function managedMlsDevice(options: ManagedMlsDeviceOptions): ManagedMlsDevice;
@@ -1,9 +1,14 @@
1
1
  import { type CanonEndpoint, type CanonMlsDevOptions, type MlsDevCurrentAudience } from '../internal/core/index.js';
2
2
  import { type MlsDevDeviceContext } from '../internal/backend-contracts/index.js';
3
3
  import type { ToolDefinition } from './types.js';
4
- /** What `createRunner({ mls })` takes: issuer pins and custody, plus the custody's own shutdown. */
4
+ /**
5
+ * What `createRunner({ mls })` takes: issuer pins and custody, plus the custody's own shutdown. With `provisioned`
6
+ * (managed custody, `managedMlsDevice`) the runner sets the device up itself at start.
7
+ */
5
8
  export type RunnerMlsOptions = CanonMlsDevOptions & {
6
9
  close?(): Promise<void>;
10
+ provision?(context: MlsDevDeviceContext): Promise<void>;
11
+ provisioned?(context: MlsDevDeviceContext): boolean;
7
12
  };
8
13
  /** A closed copy of the public audience (no provider input or key material), in a fixed field order. */
9
14
  export declare function snapshotMlsAudience(value: unknown): MlsDevCurrentAudience;
@@ -70,7 +75,7 @@ export declare function loadMlsDevConfiguration(filePath: string, input: {
70
75
  provision?: (context: MlsDevDeviceContext) => Promise<void>;
71
76
  close(): Promise<void>;
72
77
  }>;
73
- export declare const MLS_SETUP_ACTIONS: readonly ["status", "provision", "enroll", "renew", "publish", "refresh"];
78
+ export declare const MLS_SETUP_ACTIONS: readonly ["status", "setup", "provision", "enroll", "renew", "publish", "refresh"];
74
79
  export type MlsSetupAction = typeof MLS_SETUP_ACTIONS[number];
75
80
  /** The KeyPackage an agent publishes for one room: stable for its installation, so a repeated publish is the same intent. */
76
81
  export declare function mlsDevRoomPackageId(identity: {
@@ -81,13 +86,15 @@ export declare function mlsDevRoomPackageId(identity: {
81
86
  }, room: string): string;
82
87
  /**
83
88
  * One operator step for the agent's device (`canon-agent mls`), on the same engine store the runner uses. It never
84
- * starts a model, and prints only public device state: no credentials, proofs, envelopes or history.
89
+ * starts a model, and prints only public device state: no credentials, proofs, envelopes or history. `setup` does what
90
+ * is left of provision then enroll, so it also finishes a setup that stopped part way; it never replaces a vault, and
91
+ * with `provisioned` (managed custody) it provisions only where this installation has none.
85
92
  */
86
- export declare function runMlsDevSetup(endpoint: CanonEndpoint, action: MlsSetupAction, room?: string, provision?: (context: MlsDevDeviceContext) => Promise<void>): Promise<{
93
+ export declare function runMlsDevSetup(endpoint: CanonEndpoint, action: MlsSetupAction, room?: string, provision?: (context: MlsDevDeviceContext) => Promise<void>, provisioned?: (context: MlsDevDeviceContext) => boolean): Promise<{
87
94
  conversationId?: string | undefined;
88
95
  version: number;
89
- action: "status" | "publish" | "enroll" | "renew" | "provision" | "refresh";
90
- environmentId: "canon-dev-v1" | "canon-prod-v1";
96
+ action: "status" | "publish" | "enroll" | "renew" | "provision" | "setup" | "refresh";
97
+ environmentId: string;
91
98
  principalId: string;
92
99
  installationId: string;
93
100
  ownershipVersion: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/agent-sdk",
3
- "version": "12.3.1",
3
+ "version": "12.4.1",
4
4
  "description": "Canon Agent SDK — build AI agents that participate in Canon conversations",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "scripts": {
25
25
  "build": "node ../../scripts/build-agent-sdk.mjs",
26
26
  "dev": "tsc --watch --noEmit",
27
- "prepack": "npm run build"
27
+ "prepack": "node ../../scripts/build-agent-sdk.mjs --pack"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1 <27"