@canonmsg/agent-sdk 12.0.0 → 12.1.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.
- package/README.md +97 -7
- package/dist/chunks/{chunk-FPQFTTND.js → chunk-7N6OPPW4.js} +1616 -1085
- package/dist/chunks/chunk-N722GWCP.js +4897 -0
- package/dist/chunks/{chunk-OLJ7H4E2.js → chunk-QZ4PPRQW.js} +6462 -6920
- package/dist/chunks/{mls-crypto-NZDNSPAO.js → mls-crypto-LMNQZOS6.js} +3 -3
- package/dist/cli.js +403 -29
- package/dist/drivers/claude.d.ts +8 -2
- package/dist/drivers/codex.d.ts +11 -2
- package/dist/drivers/connector.d.ts +34 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +26 -4
- package/dist/internal/backend-contracts/artifactActions.d.ts +0 -151
- package/dist/internal/backend-contracts/clientFloor.d.ts +41 -0
- package/dist/internal/backend-contracts/communication.d.ts +15 -0
- package/dist/internal/backend-contracts/connectorRelay.d.ts +179 -0
- package/dist/internal/backend-contracts/endpoint.d.ts +17 -0
- package/dist/internal/backend-contracts/endpointContentPolicy.d.ts +15 -4
- package/dist/internal/backend-contracts/index.d.ts +7 -1
- package/dist/internal/backend-contracts/media-url.d.ts +14 -0
- package/dist/internal/backend-contracts/message.d.ts +1 -1
- package/dist/internal/backend-contracts/mlsDevApplication.d.ts +90 -2
- package/dist/internal/backend-contracts/mlsDevCredential.d.ts +5 -2
- package/dist/internal/backend-contracts/mlsDevDeviceCustody.d.ts +2 -1
- package/dist/internal/backend-contracts/mlsDevEnrollment.d.ts +3 -2
- package/dist/internal/backend-contracts/mlsDevFeedReceipt.d.ts +43 -0
- package/dist/internal/backend-contracts/mlsDevGroup.d.ts +129 -5
- package/dist/internal/backend-contracts/mlsDevGroupFeed.d.ts +6 -2
- package/dist/internal/backend-contracts/mlsDevInteraction.d.ts +159 -0
- package/dist/internal/backend-contracts/mlsEnvironment.d.ts +35 -0
- package/dist/internal/backend-contracts/mlsPrincipalAlias.d.ts +23 -0
- package/dist/internal/backend-contracts/runtimeCardFields.d.ts +2 -2
- package/dist/internal/backend-contracts/upload-mime-types.d.ts +17 -0
- package/dist/internal/backend-contracts/verbContract.d.ts +15 -7
- package/dist/internal/backend-contracts/verbSchemas.d.ts +35 -25
- package/dist/internal/core/agent-profiles.d.ts +0 -4
- package/dist/internal/core/approval-format.d.ts +1 -5
- package/dist/internal/core/approval-types.d.ts +1 -2
- package/dist/internal/core/client.d.ts +2 -56
- package/dist/internal/core/constants.d.ts +0 -3
- package/dist/internal/core/endpoint-client.d.ts +14 -1
- package/dist/internal/core/execution-environment-mode.d.ts +0 -2
- package/dist/internal/core/gifs.d.ts +0 -6
- package/dist/internal/core/host-runtime.d.ts +2 -206
- package/dist/internal/core/index.d.ts +21 -60
- package/dist/internal/core/registration.d.ts +1 -17
- package/dist/internal/core/retry.d.ts +0 -9
- package/dist/internal/core/rtdb-rest.d.ts +0 -4
- package/dist/internal/core/runtime-cards.d.ts +0 -45
- package/dist/internal/core/runtime-descriptor.d.ts +1 -60
- package/dist/internal/core/runtime-presentation.d.ts +1 -27
- package/dist/internal/core/runtime-request-manager.d.ts +0 -1
- package/dist/internal/core/self-context.d.ts +0 -39
- package/dist/internal/core/silent-turn.d.ts +1 -38
- package/dist/internal/core/stream.d.ts +2 -1
- package/dist/internal/core/turn-protocol.d.ts +0 -5
- package/dist/internal/core/turn-verbosity.d.ts +0 -12
- package/dist/internal/core/types.d.ts +0 -111
- package/dist/internal/endpoint/engine.d.ts +31 -1
- package/dist/internal/endpoint/index.d.ts +1 -1
- package/dist/internal/endpoint/media.d.ts +5 -0
- package/dist/internal/endpoint/mls-crypto.d.ts +12 -5
- package/dist/internal/endpoint/mls-dev-client.d.ts +9 -1
- package/dist/internal/endpoint/mls-dev-device.d.ts +2 -0
- package/dist/internal/endpoint/mls-dev-groups.d.ts +65 -5
- package/dist/internal/endpoint/mls-dev-interactions.d.ts +99 -0
- package/dist/internal/endpoint/mls-dev-key-package-service.d.ts +13 -0
- package/dist/internal/endpoint/mls-dev-key-packages.d.ts +23 -3
- package/dist/internal/endpoint/mls-dev-text.d.ts +67 -0
- package/dist/internal/endpoint/mls-dev-transport.d.ts +2 -1
- package/dist/internal/endpoint/node-mls-custody-protocol.d.ts +5 -0
- package/dist/internal/endpoint/transport.d.ts +6 -1
- package/dist/media.js +2 -2
- package/dist/runner/errands.d.ts +118 -0
- package/dist/runner/mls.d.ts +97 -0
- package/dist/runner/relay.d.ts +87 -0
- package/dist/runner/runner.d.ts +61 -0
- package/dist/runner/types.d.ts +51 -4
- package/package.json +1 -1
- package/dist/chunks/chunk-6VK4UZHJ.js +0 -2806
- package/dist/internal/backend-contracts/workSessions.d.ts +0 -205
- package/dist/internal/core/agent-resolver.d.ts +0 -49
- package/dist/internal/core/agent-session.d.ts +0 -12
- package/dist/internal/core/artifacts.d.ts +0 -262
- package/dist/internal/core/attached-native-session.d.ts +0 -174
- package/dist/internal/core/attached-session-file-store.d.ts +0 -3
- package/dist/internal/core/control-poller.d.ts +0 -221
- package/dist/internal/core/exclusive-json-file-store.d.ts +0 -7
- package/dist/internal/core/execution-environment.d.ts +0 -55
- package/dist/internal/core/group-context.d.ts +0 -25
- package/dist/internal/core/inbound-frame.d.ts +0 -64
- package/dist/internal/core/local-runtime-catalog.d.ts +0 -131
- package/dist/internal/core/message-format.d.ts +0 -13
- package/dist/internal/core/native-session-interaction.d.ts +0 -44
- package/dist/internal/core/provenance.d.ts +0 -31
- package/dist/internal/core/registration-cli.d.ts +0 -40
- package/dist/internal/core/turn-output-controller.d.ts +0 -69
- package/dist/internal/core/typing-status-publisher.d.ts +0 -14
- package/dist/internal/core/work-session-provider.d.ts +0 -29
- package/dist/internal/core/workspace-discovery.d.ts +0 -17
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { type MlsDevInteractionBinding, type MlsDevInteractionKind, type MlsDevItemPayload, type MlsDevTextPayload } from './mlsDevApplication.js';
|
|
2
|
+
import { type MlsDevGroupHead } from './mlsDevGroup.js';
|
|
3
|
+
/**
|
|
4
|
+
* Encrypted approvals and questions in `canon.mls.dev-text.v2` rooms (docs/design/encrypted-interactions.md §2.3–§2.4).
|
|
5
|
+
* The MLS plaintext is a closed union on `kind`; every variant carries the text payload's shared ids. These parsers run
|
|
6
|
+
* in the sender's endpoint before encryption and in every recipient after decryption. Native custody treats an
|
|
7
|
+
* interaction body as canonical JSON and checks only the shared ids, kind and size.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MLS_DEV_INTERACTION_LIMITS: Readonly<{
|
|
10
|
+
title: 200;
|
|
11
|
+
details: 8000;
|
|
12
|
+
options: 10;
|
|
13
|
+
optionLabel: 120;
|
|
14
|
+
text: 4000;
|
|
15
|
+
}>;
|
|
16
|
+
/** RFC 9180 base mode, DHKEM(X25519, HKDF-SHA256), HKDF-SHA256, AES-128-GCM: MLS suite 1's primitives. */
|
|
17
|
+
export declare const MLS_DEV_SECRET_ANSWER_SUITE: "x25519-hkdf-sha256-aes128gcm";
|
|
18
|
+
/** UTF-8 of at most 4,000 code points (4 bytes each) plus the AES-GCM tag. */
|
|
19
|
+
export declare const MLS_DEV_SECRET_ANSWER_MAX_BYTES: number;
|
|
20
|
+
export declare const MLS_DEV_INTERACTION_WITHDRAW_REASONS: readonly ["stopped", "turn_ended", "expired", "restart"];
|
|
21
|
+
export type MlsDevInteractionWithdrawReason = typeof MLS_DEV_INTERACTION_WITHDRAW_REASONS[number];
|
|
22
|
+
export interface MlsDevInteractionOption {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly label: string;
|
|
25
|
+
}
|
|
26
|
+
export interface MlsDevInteractionRequestBody {
|
|
27
|
+
readonly requestId: string;
|
|
28
|
+
readonly kind: MlsDevInteractionKind;
|
|
29
|
+
readonly title: string;
|
|
30
|
+
readonly details?: string;
|
|
31
|
+
readonly options?: readonly MlsDevInteractionOption[];
|
|
32
|
+
readonly multiple?: boolean;
|
|
33
|
+
readonly risk?: 'normal' | 'destructive';
|
|
34
|
+
readonly allowSession?: boolean;
|
|
35
|
+
readonly scopeKey?: string;
|
|
36
|
+
readonly responderIds: readonly [string];
|
|
37
|
+
readonly expiresAtMs: number;
|
|
38
|
+
/** A secret request's one-time HPKE recipient key, generated and held by the requesting device's custody (§2.5). */
|
|
39
|
+
readonly secretKey?: {
|
|
40
|
+
readonly kem: 'x25519';
|
|
41
|
+
readonly publicKey: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export type MlsDevInteractionAnswer = {
|
|
45
|
+
readonly decision: 'allow' | 'deny';
|
|
46
|
+
readonly scope: 'once' | 'session';
|
|
47
|
+
} | {
|
|
48
|
+
readonly choices: readonly string[];
|
|
49
|
+
} | {
|
|
50
|
+
readonly text: string;
|
|
51
|
+
} | {
|
|
52
|
+
readonly sealed: {
|
|
53
|
+
readonly enc: string;
|
|
54
|
+
readonly ciphertext: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** The responder's Cancel/Skip on a question or secret card (review of #1081). */
|
|
58
|
+
| {
|
|
59
|
+
readonly cancelled: true;
|
|
60
|
+
};
|
|
61
|
+
export interface MlsDevInteractionResponseBody {
|
|
62
|
+
readonly requestId: string;
|
|
63
|
+
readonly agentId: string;
|
|
64
|
+
readonly answer: MlsDevInteractionAnswer;
|
|
65
|
+
}
|
|
66
|
+
export interface MlsDevInteractionWithdrawBody {
|
|
67
|
+
readonly requestId: string;
|
|
68
|
+
readonly reason: MlsDevInteractionWithdrawReason;
|
|
69
|
+
}
|
|
70
|
+
interface MlsDevApplicationPayloadIds {
|
|
71
|
+
readonly version: 1;
|
|
72
|
+
readonly conversationId: string;
|
|
73
|
+
readonly groupId: string;
|
|
74
|
+
readonly messageId: string;
|
|
75
|
+
readonly operationId: string;
|
|
76
|
+
readonly senderDeviceId: string;
|
|
77
|
+
}
|
|
78
|
+
export type MlsDevInteractionPayload = (MlsDevApplicationPayloadIds & {
|
|
79
|
+
readonly kind: 'interaction.request';
|
|
80
|
+
readonly interaction: MlsDevInteractionRequestBody;
|
|
81
|
+
}) | (MlsDevApplicationPayloadIds & {
|
|
82
|
+
readonly kind: 'interaction.response';
|
|
83
|
+
readonly interaction: MlsDevInteractionResponseBody;
|
|
84
|
+
}) | (MlsDevApplicationPayloadIds & {
|
|
85
|
+
readonly kind: 'interaction.withdraw';
|
|
86
|
+
readonly interaction: MlsDevInteractionWithdrawBody;
|
|
87
|
+
});
|
|
88
|
+
export type MlsDevApplicationPayload = MlsDevTextPayload | MlsDevItemPayload | MlsDevInteractionPayload;
|
|
89
|
+
export type MlsDevInteractionPayloadKind = MlsDevInteractionPayload['kind'];
|
|
90
|
+
export declare const MLS_DEV_INTERACTION_PAYLOAD_KINDS: readonly ["interaction.request", "interaction.response", "interaction.withdraw"];
|
|
91
|
+
/** The server's metadata-only record (§2.4): no title, options, decision, scope or answer. */
|
|
92
|
+
export interface MlsDevInteractionRecord {
|
|
93
|
+
readonly version: 1;
|
|
94
|
+
readonly conversationId: string;
|
|
95
|
+
readonly agentId: string;
|
|
96
|
+
readonly requesterDeviceId: string;
|
|
97
|
+
readonly requestId: string;
|
|
98
|
+
readonly kind: MlsDevInteractionKind;
|
|
99
|
+
readonly responderIds: readonly [string];
|
|
100
|
+
readonly expiresAtMs: number;
|
|
101
|
+
readonly status: 'pending' | 'answered' | 'withdrawn';
|
|
102
|
+
readonly binding: {
|
|
103
|
+
readonly groupId: string;
|
|
104
|
+
readonly head: MlsDevGroupHead;
|
|
105
|
+
readonly membershipRevision: number;
|
|
106
|
+
readonly requestMessageId: string;
|
|
107
|
+
readonly requestOrdinal: number;
|
|
108
|
+
};
|
|
109
|
+
readonly answer?: {
|
|
110
|
+
readonly responderId: string;
|
|
111
|
+
readonly responderDeviceId: string;
|
|
112
|
+
readonly messageId: string;
|
|
113
|
+
readonly ordinal: number;
|
|
114
|
+
readonly acceptedAtMs: number;
|
|
115
|
+
};
|
|
116
|
+
readonly withdrawal?: {
|
|
117
|
+
readonly messageId: string;
|
|
118
|
+
readonly ordinal: number;
|
|
119
|
+
readonly acceptedAtMs: number;
|
|
120
|
+
};
|
|
121
|
+
readonly createdAtMs: number;
|
|
122
|
+
}
|
|
123
|
+
export interface MlsDevInteractionsQuery {
|
|
124
|
+
readonly version: 1;
|
|
125
|
+
readonly conversationId?: string;
|
|
126
|
+
}
|
|
127
|
+
/** The caller's answerable pending requests, for badges and web's content-free waiting notice. */
|
|
128
|
+
export interface MlsDevInteractionsResult {
|
|
129
|
+
readonly version: 1;
|
|
130
|
+
readonly interactions: readonly {
|
|
131
|
+
readonly conversationId: string;
|
|
132
|
+
readonly agentId: string;
|
|
133
|
+
readonly requestId: string;
|
|
134
|
+
readonly kind: MlsDevInteractionKind;
|
|
135
|
+
readonly expiresAtMs: number;
|
|
136
|
+
}[];
|
|
137
|
+
}
|
|
138
|
+
export declare const MLS_DEV_INTERACTIONS_QUERY_MAX = 50;
|
|
139
|
+
export declare class MlsDevInteractionValidationError extends Error {
|
|
140
|
+
readonly code = "INVALID_MLS_DEV_INTERACTION";
|
|
141
|
+
constructor();
|
|
142
|
+
}
|
|
143
|
+
export declare function parseMlsDevInteractionRequestBody(value: unknown): MlsDevInteractionRequestBody;
|
|
144
|
+
export declare function parseMlsDevInteractionAnswer(value: unknown): MlsDevInteractionAnswer;
|
|
145
|
+
export declare function parseMlsDevInteractionResponseBody(value: unknown): MlsDevInteractionResponseBody;
|
|
146
|
+
export declare function parseMlsDevInteractionWithdrawBody(value: unknown): MlsDevInteractionWithdrawBody;
|
|
147
|
+
/** The closed v2 plaintext union. A v1 room accepts only `kind: 'text'` (`parseMlsDevTextPayload`). */
|
|
148
|
+
export declare function parseMlsDevApplicationPayload(value: unknown): MlsDevApplicationPayload;
|
|
149
|
+
/** Receipt-time check (`applyApplication`): the encrypted payload repeats exactly what its public binding announced. */
|
|
150
|
+
export declare function assertMlsDevInteractionPayloadBinding(payload: MlsDevApplicationPayload, binding: MlsDevInteractionBinding | undefined): void;
|
|
151
|
+
/**
|
|
152
|
+
* Whether an answer has the shape its request allows. A session-scoped decision needs a request that offered a session
|
|
153
|
+
* rule (`allowSession`; a destructive action never does, §3); the runner also counts one only from the agent's owner.
|
|
154
|
+
*/
|
|
155
|
+
export declare function isMlsDevInteractionAnswerAllowed(request: MlsDevInteractionRequestBody, answer: MlsDevInteractionAnswer): boolean;
|
|
156
|
+
export declare function parseMlsDevInteractionRecord(value: unknown): MlsDevInteractionRecord;
|
|
157
|
+
export declare function parseMlsDevInteractionsQuery(value: unknown): MlsDevInteractionsQuery;
|
|
158
|
+
export declare function parseMlsDevInteractionsResult(value: unknown): MlsDevInteractionsResult;
|
|
159
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Each environment's MLS identity: the values signed into its credentials, group controls and application AAD. A
|
|
3
|
+
* production device, credential or group can never verify as Dev (or the reverse) because these differ. Dev's values
|
|
4
|
+
* are today's literals, so Dev bytes are unchanged. A declared profile only defines the wire; whether an environment
|
|
5
|
+
* runs MLS is decided by its deployment (Functions gates, configuration, native builds), never here.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MLS_ENVIRONMENT_PROFILES: Readonly<{
|
|
8
|
+
readonly 'canon-dev-v1': Readonly<{
|
|
9
|
+
issuer: "canon-mls-dev-v1";
|
|
10
|
+
credentialType: "canon-mls-dev-credential+jws";
|
|
11
|
+
issuerKeyPath: "projects/canonmail-dev/locations/europe-west1/keyRings/canon-mls/cryptoKeys/device-issuer";
|
|
12
|
+
receiptKeyPath: "projects/canonmail-dev/locations/europe-west1/keyRings/canon-mls/cryptoKeys/feed-receipt";
|
|
13
|
+
}>;
|
|
14
|
+
readonly 'canon-prod-v1': Readonly<{
|
|
15
|
+
issuer: "canon-mls-prod-v1";
|
|
16
|
+
credentialType: "canon-mls-prod-credential+jws";
|
|
17
|
+
issuerKeyPath: "projects/canonmail-prod/locations/europe-west1/keyRings/canon-mls/cryptoKeys/device-issuer";
|
|
18
|
+
receiptKeyPath: "projects/canonmail-prod/locations/europe-west1/keyRings/canon-mls/cryptoKeys/feed-receipt";
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
export type MlsEnvironmentId = keyof typeof MLS_ENVIRONMENT_PROFILES;
|
|
22
|
+
export type MlsEnvironmentProfile = (typeof MLS_ENVIRONMENT_PROFILES)[MlsEnvironmentId];
|
|
23
|
+
export type MlsIssuerId = MlsEnvironmentProfile['issuer'];
|
|
24
|
+
/**
|
|
25
|
+
* Exact match only: no trimming or case folding, so an alias never reaches signed bytes. Throws the shared internal
|
|
26
|
+
* parser error, which each public boundary replaces with its own.
|
|
27
|
+
*/
|
|
28
|
+
export declare function requireMlsEnvironmentId(value: unknown): MlsEnvironmentId;
|
|
29
|
+
/** The same exact match as a predicate, for callers that refuse with their own error. */
|
|
30
|
+
export declare function isMlsEnvironmentId(value: unknown): value is MlsEnvironmentId;
|
|
31
|
+
export declare function mlsEnvironmentProfile(environmentId: MlsEnvironmentId): MlsEnvironmentProfile;
|
|
32
|
+
/** The environment whose issuer key a KMS key-version path names, or undefined for any other path. */
|
|
33
|
+
export declare function mlsEnvironmentOfIssuerKeyVersion(value: string): MlsEnvironmentId | undefined;
|
|
34
|
+
/** The environment whose feed-receipt key (mls-signed-acceptance.md) a KMS key-version path names, or undefined. */
|
|
35
|
+
export declare function mlsEnvironmentOfReceiptKeyVersion(value: string): MlsEnvironmentId | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type MlsEnvironmentId } from './mlsEnvironment.js';
|
|
2
|
+
export declare const MLS_PRINCIPAL_ALIAS_PREFIX = "mlsa_";
|
|
3
|
+
export interface MlsPrincipalOpening {
|
|
4
|
+
readonly type: 'human' | 'ai_agent';
|
|
5
|
+
readonly accountId: string;
|
|
6
|
+
/** 32 random bytes, canonical base64url. */
|
|
7
|
+
readonly salt: string;
|
|
8
|
+
}
|
|
9
|
+
/** An alias's shape; whether it opens to an account needs its opening. Account IDs never have it. */
|
|
10
|
+
export declare function isMlsPrincipalAlias(value: unknown): value is string;
|
|
11
|
+
export declare function parseMlsPrincipalOpening(value: unknown): MlsPrincipalOpening;
|
|
12
|
+
/**
|
|
13
|
+
* SHA-256 over the domain above, LP environment, u8 type (human 0/agent 1), LP account ID and the raw 32-byte salt,
|
|
14
|
+
* where LP is a u32 big-endian byte length followed by UTF-8, as in the enrollment proof.
|
|
15
|
+
*/
|
|
16
|
+
export declare function encodeMlsPrincipalAliasInput(environmentId: MlsEnvironmentId, opening: MlsPrincipalOpening): Uint8Array;
|
|
17
|
+
export declare function mlsPrincipalAlias(environmentId: MlsEnvironmentId, opening: MlsPrincipalOpening): Promise<string>;
|
|
18
|
+
/** Whether `opening` opens `alias` in this environment. A malformed opening opens nothing. */
|
|
19
|
+
export declare function opensMlsPrincipalAlias(environmentId: MlsEnvironmentId, alias: string, opening: unknown): Promise<boolean>;
|
|
20
|
+
/** A fresh opening for an account: Canon's server makes one the first time the account needs an alias. */
|
|
21
|
+
export declare function createMlsPrincipalOpening(type: MlsPrincipalOpening['type'], id: string): MlsPrincipalOpening;
|
|
22
|
+
/** A room's openings, `{[alias]: opening}`: the shape only. Readers still check each opening against its alias. */
|
|
23
|
+
export declare function parseMlsRoomIdentities(value: unknown): Readonly<Record<string, MlsPrincipalOpening>>;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* type cannot drift.
|
|
5
5
|
*
|
|
6
6
|
* ORDER IS LOAD-BEARING: scripts/generate-skill-bundles.mjs renders this list
|
|
7
|
-
* verbatim (via @canonmsg/rich-cards) into
|
|
8
|
-
* `npm run check:skill-bundles` fails on a byte change.
|
|
7
|
+
* verbatim (via @canonmsg/rich-cards) into the Hermes plugin's committed
|
|
8
|
+
* rich-cards SKILL.md, and `npm run check:skill-bundles` fails on a byte change.
|
|
9
9
|
*/
|
|
10
10
|
export declare const RUNTIME_CARD_FIELD_TYPES: readonly ["text", "textarea", "select", "multiSelect", "boolean", "date", "number", "currency", "searchSelect", "lineItems"];
|
|
11
11
|
export type RuntimeCardFieldType = (typeof RUNTIME_CARD_FIELD_TYPES)[number];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** The media types Canon accepts for an upload, resolved the same way on a device and on the server. */
|
|
2
|
+
export type AllowedUploadKind = 'image' | 'audio' | 'video' | 'file';
|
|
3
|
+
export declare const SAFE_IMAGE_MIME_TYPES: Set<string>;
|
|
4
|
+
export declare const SAFE_AUDIO_MIME_TYPES: Set<string>;
|
|
5
|
+
export declare const SAFE_VIDEO_MIME_TYPES: Set<string>;
|
|
6
|
+
export declare const SAFE_FILE_MIME_TYPES: Set<string>;
|
|
7
|
+
export declare function normalizeMimeType(value: unknown): string | null;
|
|
8
|
+
export declare function classifyAllowedUploadMimeType(value: unknown): AllowedUploadKind | null;
|
|
9
|
+
export declare function normalizeAllowedUploadMimeType(value: unknown): string | null;
|
|
10
|
+
export declare function resolveAllowedUploadMimeType(input: {
|
|
11
|
+
mimeType?: unknown;
|
|
12
|
+
fileName?: unknown;
|
|
13
|
+
}): string | null;
|
|
14
|
+
export declare function getAllowedUploadExtension(input: {
|
|
15
|
+
mimeType: string;
|
|
16
|
+
fileName?: unknown;
|
|
17
|
+
}): string;
|
|
@@ -51,8 +51,7 @@ export declare const CANON_VERB_NAMESPACE = "canon";
|
|
|
51
51
|
/**
|
|
52
52
|
* $id of the canonical canon.card.v1 document schema
|
|
53
53
|
* (@canonmsg/rich-cards RUNTIME_CARD_JSON_SCHEMA_V1). The verbs bundle only
|
|
54
|
-
* validates the card ENVELOPE
|
|
55
|
-
* verbs via `getVerbInputSchema(verb, { cardSchema })`.
|
|
54
|
+
* validates the card ENVELOPE.
|
|
56
55
|
*/
|
|
57
56
|
export declare const CANON_CARD_SCHEMA_ID = "https://canonmsg.com/schemas/canon.card.v1.json";
|
|
58
57
|
/**
|
|
@@ -308,14 +307,23 @@ export type SendToResult = {
|
|
|
308
307
|
created?: boolean;
|
|
309
308
|
reused?: boolean;
|
|
310
309
|
sessionSelection?: string;
|
|
310
|
+
}
|
|
311
|
+
/** The room is encrypted, so Canon stored no opening text: the sender sends it encrypted under `messageId`. */
|
|
312
|
+
| {
|
|
313
|
+
status: 'opened';
|
|
314
|
+
conversationId: string;
|
|
315
|
+
messageId: string;
|
|
316
|
+
openingText: 'deferred';
|
|
317
|
+
created?: boolean;
|
|
318
|
+
reused?: boolean;
|
|
311
319
|
} | {
|
|
312
|
-
status: 'requested';
|
|
313
|
-
requestId: string | null;
|
|
314
|
-
deferredIntentId?: string | null;
|
|
315
|
-
} | {
|
|
316
|
-
status: 'pending';
|
|
320
|
+
status: 'requested' | 'pending';
|
|
317
321
|
requestId: string | null;
|
|
318
322
|
deferredIntentId?: string | null;
|
|
323
|
+
/** An encrypted room stores no opener: the sender sends it into `conversationId` under `messageId`. */
|
|
324
|
+
conversationId?: string;
|
|
325
|
+
messageId?: string;
|
|
326
|
+
openingText?: 'deferred';
|
|
319
327
|
} | {
|
|
320
328
|
status: 'setup_required';
|
|
321
329
|
reason: string;
|
|
@@ -714,6 +714,31 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
714
714
|
readonly type: "string";
|
|
715
715
|
};
|
|
716
716
|
};
|
|
717
|
+
}, {
|
|
718
|
+
readonly type: "object";
|
|
719
|
+
readonly required: readonly ["status", "conversationId", "messageId", "openingText"];
|
|
720
|
+
readonly additionalProperties: true;
|
|
721
|
+
readonly description: "The room is encrypted, so Canon stored no opening text: the sender sends it encrypted under messageId.";
|
|
722
|
+
readonly properties: {
|
|
723
|
+
readonly status: {
|
|
724
|
+
readonly const: "opened";
|
|
725
|
+
};
|
|
726
|
+
readonly conversationId: {
|
|
727
|
+
readonly type: "string";
|
|
728
|
+
};
|
|
729
|
+
readonly messageId: {
|
|
730
|
+
readonly type: "string";
|
|
731
|
+
};
|
|
732
|
+
readonly openingText: {
|
|
733
|
+
readonly const: "deferred";
|
|
734
|
+
};
|
|
735
|
+
readonly created: {
|
|
736
|
+
readonly type: "boolean";
|
|
737
|
+
};
|
|
738
|
+
readonly reused: {
|
|
739
|
+
readonly type: "boolean";
|
|
740
|
+
};
|
|
741
|
+
};
|
|
717
742
|
}, {
|
|
718
743
|
readonly type: "object";
|
|
719
744
|
readonly required: readonly ["status", "requestId"];
|
|
@@ -729,6 +754,16 @@ export declare const CANON_VERBS_JSON_SCHEMA: {
|
|
|
729
754
|
readonly type: readonly ["string", "null"];
|
|
730
755
|
readonly description: "Present when the send is deferred until the contact request resolves.";
|
|
731
756
|
};
|
|
757
|
+
readonly conversationId: {
|
|
758
|
+
readonly type: "string";
|
|
759
|
+
};
|
|
760
|
+
readonly messageId: {
|
|
761
|
+
readonly type: "string";
|
|
762
|
+
};
|
|
763
|
+
readonly openingText: {
|
|
764
|
+
readonly const: "deferred";
|
|
765
|
+
readonly description: "The room is encrypted, so Canon stored no opening text: the sender sends it encrypted under messageId.";
|
|
766
|
+
};
|
|
732
767
|
};
|
|
733
768
|
}, {
|
|
734
769
|
readonly type: "object";
|
|
@@ -1678,30 +1713,5 @@ export interface CanonVerbSchemaRefs {
|
|
|
1678
1713
|
export declare const CANON_VERB_SCHEMA_REFS: Record<CanonVerbName, CanonVerbSchemaRefs>;
|
|
1679
1714
|
/** A verb subschema extracted from the bundle, self-contained for embedding. */
|
|
1680
1715
|
export type CanonVerbJsonSchema = Record<string, unknown>;
|
|
1681
|
-
export interface GetVerbSchemaOptions {
|
|
1682
|
-
/**
|
|
1683
|
-
* The full canon.card.v1 document schema (@canonmsg/rich-cards
|
|
1684
|
-
* RUNTIME_CARD_JSON_SCHEMA_V1) to compose into card-carrying verbs. When
|
|
1685
|
-
* provided, the envelope-only `runtimeCard` definition is replaced so block
|
|
1686
|
-
* structures validate too. backend-contracts deliberately does not depend
|
|
1687
|
-
* on rich-cards (build-order/dependency direction), so the binding supplies
|
|
1688
|
-
* the schema.
|
|
1689
|
-
*
|
|
1690
|
-
* The card schema is REBASED, not nested: its own `$defs` are merged into
|
|
1691
|
-
* the verb schema's `$defs` under `card__`-prefixed names and every
|
|
1692
|
-
* internal `#/$defs/...` ref (including `<card $id>#/$defs/...` forms) is
|
|
1693
|
-
* rewritten accordingly. The result is a single self-contained schema
|
|
1694
|
-
* resource with plain internal refs — no embedded `$id` — so it compiles
|
|
1695
|
-
* on naive validators and never conflicts with a separately registered
|
|
1696
|
-
* canon.card.v1 resource on the same Ajv instance.
|
|
1697
|
-
*
|
|
1698
|
-
* Ajv note: the real card schema uses spec-valid union types
|
|
1699
|
-
* (min/max: number | date-string), so compile composed schemas with
|
|
1700
|
-
* `{ strict: true, allowUnionTypes: true }`.
|
|
1701
|
-
*/
|
|
1702
|
-
cardSchema?: Record<string, unknown>;
|
|
1703
|
-
}
|
|
1704
|
-
/** Self-contained input schema for a verb (for embedding into tool definitions). */
|
|
1705
|
-
export declare function getVerbInputSchema(verb: CanonVerbName, options?: GetVerbSchemaOptions): CanonVerbJsonSchema;
|
|
1706
1716
|
/** Self-contained result schema for a verb. */
|
|
1707
1717
|
export declare function getVerbResultSchema(verb: CanonVerbName): CanonVerbJsonSchema;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared agent profile management — loading, locking, and resolution.
|
|
3
|
-
* Used by both host.ts and server.ts.
|
|
4
3
|
*/
|
|
5
4
|
import type { CanonEnvironmentId } from '../backend-contracts/index.js';
|
|
6
5
|
import type { AgentClientType } from './types.js';
|
|
7
|
-
import { type CanonRuntimeConnectionOptions } from './runtime-endpoints.js';
|
|
8
6
|
export interface AgentProfileInput {
|
|
9
7
|
apiKey: string;
|
|
10
8
|
agentId: string;
|
|
@@ -64,6 +62,4 @@ export interface PendingRegistration {
|
|
|
64
62
|
}
|
|
65
63
|
export declare function loadPendingRegistrations(): Record<string, PendingRegistration>;
|
|
66
64
|
export declare function savePendingRegistrations(pending: Record<string, PendingRegistration>): void;
|
|
67
|
-
export declare function getOrCreatePendingRegistration(profile: string, clientType?: AgentClientType, connectionOptions?: CanonRuntimeConnectionOptions): PendingRegistration;
|
|
68
|
-
export declare function updatePendingRegistration(profile: string, patch: Partial<Pick<PendingRegistration, 'requestId' | 'pollToken' | 'clientType'>>): PendingRegistration;
|
|
69
65
|
export declare function clearPendingRegistration(profile: string): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApprovalRequestCategory, ApprovalRequestDetail, ApprovalRequestMetadata, ApprovalNativeRequestMetadata, ApprovalRisk
|
|
1
|
+
import type { ApprovalRequestCategory, ApprovalRequestDetail, ApprovalRequestMetadata, ApprovalNativeRequestMetadata, ApprovalRisk } from './approval-types.js';
|
|
2
2
|
import type { CanonUnifiedDiff } from './types.js';
|
|
3
3
|
export declare function generateApprovalId(): string;
|
|
4
4
|
export declare function redactSecrets(text: string, patterns: string[]): string;
|
|
@@ -19,8 +19,4 @@ export declare function buildApprovalRequest(approvalId: string, toolName: strin
|
|
|
19
19
|
text: string;
|
|
20
20
|
metadata: ApprovalRequestMetadata;
|
|
21
21
|
};
|
|
22
|
-
export declare function buildApprovalReply(approvalId: string, decision: 'allow' | 'deny', sessionRule?: SessionRule): {
|
|
23
|
-
text: string;
|
|
24
|
-
metadata: ApprovalReplyMetadata;
|
|
25
|
-
};
|
|
26
22
|
export declare function buildApprovalOutcome(approvalId: string, toolName: string, toolSummary: string, decision: 'allow' | 'deny', reason: 'replied' | 'timeout' | 'session-rule'): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { VerbNativeMetadata } from '../backend-contracts/index.js';
|
|
2
2
|
import type { CanonUnifiedDiff } from './types.js';
|
|
3
3
|
export interface ApprovalRequestMetadata {
|
|
4
4
|
type: 'approval_request';
|
|
@@ -71,4 +71,3 @@ export interface ApprovalConfig {
|
|
|
71
71
|
export declare const DEFAULT_APPROVAL_CONFIG: ApprovalConfig;
|
|
72
72
|
export declare function parseSessionRule(value: unknown): SessionRule | null;
|
|
73
73
|
export declare function parseApprovalReplyMetadata(value: unknown): ApprovalReplyMetadata | null;
|
|
74
|
-
export declare function parseApprovalRequestMetadata(value: unknown): ApprovalRequestMetadata | null;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { type CanonMessage, type CanonConversation, type CanonUnifiedDiff, type CanonContact, type CanonConversationsPage, type CanonConversationsPageOptions, type CanonMessagesPage, type CanonResolveAdmissionResult, type ResolveAdmissionTargetInput, type AppendMemoStreamChunkOptions, type CanonVoiceSession, type CanonVoiceSessionToken, type CreateMemoStreamOptions, type CreateMemoStreamResult, type CreateVoiceSessionOptions, type MemoStreamChunkAck, type AgentContext, type AddMemberResult, type CreateGroupResult, type MediaAttachment, type SendMessageOptions, type CreateGroupOptions, type JoinVoiceSessionOptions, type RegistrationStatus, type AgentOriginDeclaration, type SetRuntimeTurnOptions, type SetStreamingOptions
|
|
2
|
-
import type { CanonGifSearchOptions, CanonGifSearchResponse } from './gifs.js';
|
|
1
|
+
import { type CanonMessage, type CanonConversation, type CanonUnifiedDiff, type CanonContact, type CanonConversationsPage, type CanonConversationsPageOptions, type CanonMessagesPage, type CanonResolveAdmissionResult, type ResolveAdmissionTargetInput, type AppendMemoStreamChunkOptions, type CanonVoiceSession, type CanonVoiceSessionToken, type CreateMemoStreamOptions, type CreateMemoStreamResult, type CreateVoiceSessionOptions, type MemoStreamChunkAck, type AgentContext, type AddMemberResult, type CreateGroupResult, type MediaAttachment, type SendMessageOptions, type CreateGroupOptions, type JoinVoiceSessionOptions, type RegistrationStatus, type AgentOriginDeclaration, type SetRuntimeTurnOptions, type SetStreamingOptions } from './types.js';
|
|
3
2
|
import type { RuntimeInputKind } from './runtime-cards.js';
|
|
4
3
|
import type { ApprovalNativeRequestMetadata, ApprovalRequestCategory, ApprovalRequestDetail, ApprovalRisk, SessionRule } from './approval-types.js';
|
|
5
4
|
import type { RuntimeInputAnswers, RuntimeInputChoice, RuntimeInputNativeMetadata, RuntimeInputQuestion, RuntimeCardNativeMetadata, RuntimeCardV1 } from './runtime-cards.js';
|
|
6
5
|
import type { InboundDisposition } from './turn-protocol.js';
|
|
7
6
|
import { type CanonVerbWireRequest, type CanonVerbWireResponse, type CommunicateInput, type CommunicateResult, type DiscoverAgentsInput, type DiscoverAgentsResult, type SendToInput } from '../backend-contracts/index.js';
|
|
8
|
-
import type { WorkSessionRuntimeRegistration, WorkSessionRuntimeState, WorkSessionHeartbeatInput, WorkSessionRuntimeAuth, WorkSessionClaimInput, WorkSessionClaimResult, CompleteWorkSessionInput, WorkSessionRequest, ReleaseWorkSessionBindingInput, WorkSessionReportInput } from '../backend-contracts/index.js';
|
|
9
7
|
import { type EndpointOperation } from '../endpoint/index.js';
|
|
10
8
|
import { type CanonClientEndpointOptions, type CanonEndpoint } from './endpoint-client.js';
|
|
11
|
-
import { type CanonConversationArtifacts } from './artifacts.js';
|
|
12
9
|
export interface ResumableMediaUploadSession {
|
|
13
10
|
uploadId: string;
|
|
14
11
|
/** Private bearer capability returned by Cloud Storage. Do not persist or log it. */
|
|
@@ -28,18 +25,6 @@ export interface ResumableMediaUploadResult {
|
|
|
28
25
|
* operator registration remain outside the conversation protocol.
|
|
29
26
|
*/
|
|
30
27
|
export declare class CanonClient {
|
|
31
|
-
private workSessionRequest;
|
|
32
|
-
registerWorkSessionRuntime(input: WorkSessionRuntimeRegistration): Promise<WorkSessionRuntimeState>;
|
|
33
|
-
heartbeatWorkSessionRuntime(input: WorkSessionHeartbeatInput): Promise<WorkSessionRuntimeState>;
|
|
34
|
-
releaseWorkSessionRuntime(input: WorkSessionRuntimeAuth): Promise<{
|
|
35
|
-
released: boolean;
|
|
36
|
-
}>;
|
|
37
|
-
claimWorkSessionRequest(input: WorkSessionClaimInput): Promise<WorkSessionClaimResult>;
|
|
38
|
-
completeWorkSessionRequest(input: CompleteWorkSessionInput): Promise<WorkSessionRequest>;
|
|
39
|
-
releaseWorkSessionBinding(input: ReleaseWorkSessionBindingInput): Promise<WorkSessionRuntimeState>;
|
|
40
|
-
reportWorkSessionDetails(input: WorkSessionReportInput): Promise<{
|
|
41
|
-
reportedAt: number;
|
|
42
|
-
}>;
|
|
43
28
|
private baseUrl;
|
|
44
29
|
private apiKey;
|
|
45
30
|
private endpointOptions;
|
|
@@ -49,16 +34,6 @@ export declare class CanonClient {
|
|
|
49
34
|
constructor(apiKey: string, baseUrl?: string, options?: CanonClientEndpointOptions);
|
|
50
35
|
/** All durable communication shares this installation's engine and journal. */
|
|
51
36
|
getEndpoint(): Promise<CanonEndpoint>;
|
|
52
|
-
/** Last-seen snapshots and participant names for shared work, per conversation. */
|
|
53
|
-
private readonly artifactMemory;
|
|
54
|
-
/**
|
|
55
|
-
* Shared work bound to one conversation. Cheap to create: replay state lives
|
|
56
|
-
* in the endpoint and "last seen" snapshots on this client, so every room
|
|
57
|
-
* object for the same conversation shares them.
|
|
58
|
-
*/
|
|
59
|
-
artifacts(conversationId: string): CanonConversationArtifacts;
|
|
60
|
-
/** Seed participant names used by shared-work views (for example an inbound message's sender). */
|
|
61
|
-
rememberParticipantNames(conversationId: string, names: Record<string, string | null | undefined>): void;
|
|
62
37
|
close(): Promise<void>;
|
|
63
38
|
getFileMediaPipeline(fetchImpl?: typeof fetch): Promise<import("../endpoint/index.js").EndpointMediaPipeline<string>>;
|
|
64
39
|
waitForOperation<T>(operationId: string, options?: {
|
|
@@ -69,17 +44,8 @@ export declare class CanonClient {
|
|
|
69
44
|
private endpointQuery;
|
|
70
45
|
private endpointPublish;
|
|
71
46
|
private authHeaders;
|
|
72
|
-
getAuthToken(): Promise<{
|
|
73
|
-
token: string;
|
|
74
|
-
expiresAt: string;
|
|
75
|
-
agentId: string;
|
|
76
|
-
}>;
|
|
77
47
|
getAgentMe(): Promise<AgentContext>;
|
|
78
48
|
discoverAgents(input?: DiscoverAgentsInput): Promise<DiscoverAgentsResult>;
|
|
79
|
-
updateAgentProfile(options: UpdateAgentProfileOptions): Promise<void>;
|
|
80
|
-
rotateAgentKey(): Promise<{
|
|
81
|
-
apiKey: string;
|
|
82
|
-
}>;
|
|
83
49
|
/**
|
|
84
50
|
* List conversations. Called with no options this is the historical request —
|
|
85
51
|
* no query string, every conversation the agent belongs to, most recent
|
|
@@ -98,8 +64,6 @@ export declare class CanonClient {
|
|
|
98
64
|
private fetchConversationsPage;
|
|
99
65
|
/** Targeted membership read; session hosts must not poll the entire account. */
|
|
100
66
|
getConversation(conversationId: string): Promise<CanonConversation | null>;
|
|
101
|
-
/** Stream and snapshot producers share the engine's monotonic roster merge. */
|
|
102
|
-
rememberConversation(conversation: CanonConversation): Promise<CanonConversation>;
|
|
103
67
|
getMessages(conversationId: string, limit?: number, before?: string): Promise<CanonMessage[]>;
|
|
104
68
|
getMessagesPage(conversationId: string, limit?: number, before?: string): Promise<CanonMessagesPage>;
|
|
105
69
|
/** Read one explicitly referenced message without extending ordinary history. */
|
|
@@ -153,14 +117,6 @@ export declare class CanonClient {
|
|
|
153
117
|
messageId: string;
|
|
154
118
|
conversationId: string;
|
|
155
119
|
}>;
|
|
156
|
-
/** Inspect the original durable publication before renewing an expired attachment.
|
|
157
|
-
* Pending or uncertain operations must be reconciled before any replacement.
|
|
158
|
-
* A replacement operation ID belongs in the caller's durable product journal;
|
|
159
|
-
* retain the same messageId and use it only after a definitive no-effect rejection.
|
|
160
|
-
*/
|
|
161
|
-
getProactiveMessageOperation(conversationId: string, messageId: string, delivery?: {
|
|
162
|
-
operationId?: string;
|
|
163
|
-
}): Promise<EndpointOperation | undefined>;
|
|
164
120
|
/** Reconcile an existing publication without rebuilding or resubmitting its body. */
|
|
165
121
|
waitForProactiveMessage(operationId: string, options?: {
|
|
166
122
|
signal?: AbortSignal;
|
|
@@ -190,6 +146,7 @@ export declare class CanonClient {
|
|
|
190
146
|
*/
|
|
191
147
|
communicate(input: CommunicateInput): Promise<CommunicateResult>;
|
|
192
148
|
private executeCommunication;
|
|
149
|
+
private startWithheld;
|
|
193
150
|
/** Create a group. Direct conversations must go through `communicate`. */
|
|
194
151
|
createGroup(options: CreateGroupOptions): Promise<CreateGroupResult>;
|
|
195
152
|
createMemoStream(options: CreateMemoStreamOptions & {
|
|
@@ -225,8 +182,6 @@ export declare class CanonClient {
|
|
|
225
182
|
createResumableMediaUpload(conversationId: string, sizeBytes: number, mimeType: string, fileName?: string): Promise<ResumableMediaUploadSession>;
|
|
226
183
|
/** Promote validated pending bytes into a canonical Canon attachment. */
|
|
227
184
|
finalizeResumableMediaUpload(uploadId: string): Promise<ResumableMediaUploadResult>;
|
|
228
|
-
getFeaturedGifs(options?: Omit<CanonGifSearchOptions, 'query'>): Promise<CanonGifSearchResponse>;
|
|
229
|
-
searchGifs(query: string, options?: Omit<CanonGifSearchOptions, 'query'>): Promise<CanonGifSearchResponse>;
|
|
230
185
|
updateTopic(conversationId: string, topic: string): Promise<void>;
|
|
231
186
|
deleteMessage(conversationId: string, messageId: string): Promise<void>;
|
|
232
187
|
updateMessageDisposition(conversationId: string, messageId: string, inboundDisposition: InboundDisposition): Promise<void>;
|
|
@@ -244,15 +199,6 @@ export declare class CanonClient {
|
|
|
244
199
|
/** Acknowledge exactly the signal observed before the native handler ran. */
|
|
245
200
|
acknowledgeRuntimeSignal(conversationId: string, signalId: string): Promise<Record<string, unknown>>;
|
|
246
201
|
consumeRuntimeSignal(conversationId: string): Promise<Record<string, unknown>>;
|
|
247
|
-
listRuntimePrimitives(conversationId: string): Promise<{
|
|
248
|
-
requests: Record<string, {
|
|
249
|
-
value: unknown;
|
|
250
|
-
revision: string;
|
|
251
|
-
}>;
|
|
252
|
-
}>;
|
|
253
|
-
consumeRuntimePrimitive(conversationId: string, requestId: string, expectedRevision: string): Promise<{
|
|
254
|
-
status: 'consumed' | 'missing' | 'mismatch';
|
|
255
|
-
}>;
|
|
256
202
|
/** Runtime adapters can inspect only their own projection in an admitted room. */
|
|
257
203
|
getRuntimeProjection(family: 'agent-runtime' | 'agent-session' | 'turn-state' | 'runtime-info' | 'runtime-activity' | 'streaming', conversationId?: string): Promise<unknown>;
|
|
258
204
|
publishRuntimeSession(conversationId: string, mode: 'patch' | 'clear', state?: Record<string, unknown>): Promise<void>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createEndpoint, type EndpointMediaBytes, type EndpointMediaPipeline, type MlsDevProtectedPreparer, type MlsDevProtectedKeyPackagePreparer, type MlsDevProtectedGroupPreparer } from '../endpoint/index.js';
|
|
2
2
|
import type { MlsDevClientConfiguration } from '../endpoint/mls-crypto.js';
|
|
3
|
+
import type { CanonClientIdentity } from '../backend-contracts/index.js';
|
|
3
4
|
export type CanonEndpoint = ReturnType<typeof createEndpoint>;
|
|
4
5
|
/** Operator-owned custody. Keep the same object for every shared endpoint lease. */
|
|
5
6
|
export interface CanonMlsDevCustody {
|
|
@@ -12,7 +13,7 @@ export interface CanonMlsDevOptions {
|
|
|
12
13
|
custody: CanonMlsDevCustody;
|
|
13
14
|
}
|
|
14
15
|
export interface CanonClientEndpointOptions {
|
|
15
|
-
/** Explicit synthetic
|
|
16
|
+
/** Explicit synthetic opt-in, bound to its configuration's environment; enrollment remains an operator action. */
|
|
16
17
|
mlsDev?: CanonMlsDevOptions;
|
|
17
18
|
/** Inject an operator-controlled store/engine for replicated or ephemeral hosts. */
|
|
18
19
|
endpoint?: CanonEndpoint;
|
|
@@ -21,6 +22,11 @@ export interface CanonClientEndpointOptions {
|
|
|
21
22
|
streamUrl?: string;
|
|
22
23
|
/** Persistent volume for the engine journal; never use a container temporary directory. */
|
|
23
24
|
stateDirectory?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The engine's installation, for a host whose installation is assigned (the class-C relay's reserved one). A store
|
|
27
|
+
* already opened under another installation refuses to start; without it a new store picks a random installation.
|
|
28
|
+
*/
|
|
29
|
+
installationId?: string;
|
|
24
30
|
mediaDirectory?: string;
|
|
25
31
|
/** Operator inspection/import does not automatically publish queued operations. */
|
|
26
32
|
autoDrain?: boolean;
|
|
@@ -28,6 +34,13 @@ export interface CanonClientEndpointOptions {
|
|
|
28
34
|
mediaBytes?: EndpointMediaBytes<string>;
|
|
29
35
|
/** Test seam for the client's out-of-protocol HTTP (identity, profile); production leaves it unset. */
|
|
30
36
|
fetch?: typeof fetch;
|
|
37
|
+
/**
|
|
38
|
+
* Names this client to Canon's client floor (`X-Canon-Client`, mls-cutover-operator.md §2 15b). The runner, the Hermes
|
|
39
|
+
* worker and the CLIs pass theirs; a client that names none is refused once a floor exists.
|
|
40
|
+
*/
|
|
41
|
+
client?: CanonClientIdentity;
|
|
42
|
+
/** Canon refused this client as below its floor, on any request or stream (`426 CLIENT_UPDATE_REQUIRED`). */
|
|
43
|
+
onClientUpdateRequired?(error: Error): void;
|
|
31
44
|
}
|
|
32
45
|
export declare function acquireFileMediaPipeline(endpoint: CanonEndpoint, options: CanonClientEndpointOptions, fetchImpl?: typeof fetch): Promise<EndpointMediaPipeline<string>>;
|
|
33
46
|
/** One protocol owner per account, environment and durable profile in this process. */
|
|
@@ -4,5 +4,3 @@
|
|
|
4
4
|
* Node hosts and browser/Expo clients can import these primitives.
|
|
5
5
|
*/
|
|
6
6
|
export type ExecutionEnvironmentMode = 'worktree' | 'locked';
|
|
7
|
-
export declare const EXECUTION_ENVIRONMENT_MODES: readonly ExecutionEnvironmentMode[];
|
|
8
|
-
export declare function isExecutionEnvironmentMode(value: unknown): value is ExecutionEnvironmentMode;
|
|
@@ -17,12 +17,6 @@ export interface CanonGifSearchResponse {
|
|
|
17
17
|
results: CanonGifResult[];
|
|
18
18
|
nextCursor: string | null;
|
|
19
19
|
}
|
|
20
|
-
export interface CanonGifSearchOptions {
|
|
21
|
-
query?: string;
|
|
22
|
-
limit?: number;
|
|
23
|
-
cursor?: string | null;
|
|
24
|
-
locale?: string | null;
|
|
25
|
-
}
|
|
26
20
|
export interface CanonGifMetadata {
|
|
27
21
|
provider: GifProvider;
|
|
28
22
|
id: string;
|