@canonmsg/agent-sdk 0.9.0 → 0.9.2
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 +35 -4
- package/dist/canon-agent.js +10 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ No additional dependencies required — the SDK uses native `fetch` and `Readabl
|
|
|
46
46
|
|
|
47
47
|
### Optional runtime controls
|
|
48
48
|
|
|
49
|
-
Generic SDK agents publish no setup controls by default. If your SDK runtime has local workspace access, you can opt in by publishing a descriptor with explicit
|
|
49
|
+
Generic SDK agents publish no setup controls by default. If your SDK runtime has local workspace access, you can opt in by publishing a descriptor with explicit project choices:
|
|
50
50
|
|
|
51
51
|
```typescript
|
|
52
52
|
const agent = new CanonAgent({
|
|
@@ -55,10 +55,24 @@ const agent = new CanonAgent({
|
|
|
55
55
|
coreControls: [
|
|
56
56
|
{
|
|
57
57
|
id: 'workspace',
|
|
58
|
-
label: '
|
|
58
|
+
label: 'Project',
|
|
59
59
|
options: [
|
|
60
|
-
{
|
|
61
|
-
|
|
60
|
+
{
|
|
61
|
+
value: 'workspace-canon',
|
|
62
|
+
label: 'canon',
|
|
63
|
+
description: 'dev/canon',
|
|
64
|
+
workspaceRootId: 'dev',
|
|
65
|
+
workspaceRelativePath: 'canon',
|
|
66
|
+
source: 'discovered',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: 'workspace-yumyumv2',
|
|
70
|
+
label: 'yumyumv2',
|
|
71
|
+
description: 'dev/yumyumv2',
|
|
72
|
+
workspaceRootId: 'dev',
|
|
73
|
+
workspaceRelativePath: 'yumyumv2',
|
|
74
|
+
source: 'discovered',
|
|
75
|
+
},
|
|
62
76
|
],
|
|
63
77
|
defaultValue: 'workspace-canon',
|
|
64
78
|
availability: 'setup',
|
|
@@ -77,6 +91,23 @@ const agent = new CanonAgent({
|
|
|
77
91
|
|
|
78
92
|
The descriptor only drives Canon UI and validation. Your SDK agent is still responsible for reading session config and safely mapping selected values to local directories.
|
|
79
93
|
|
|
94
|
+
Node SDK builders can reuse `buildConfiguredWorkspaceOptionsWithRoots` from `@canonmsg/core` to produce the same stable project IDs and root metadata used by the first-party Claude Code and Codex hosts.
|
|
95
|
+
|
|
96
|
+
Current rules of thumb:
|
|
97
|
+
|
|
98
|
+
- Canon does not infer real runtime support from `clientType`; if you do not publish a descriptor, Canon should behave as a mostly status-only generic agent surface.
|
|
99
|
+
- `availability` controls where a setting appears:
|
|
100
|
+
- `setup`: session creation only
|
|
101
|
+
- `live`: live strip only
|
|
102
|
+
- `setup_and_live`: both surfaces
|
|
103
|
+
- `liveBehavior` controls how truthful live editing should be:
|
|
104
|
+
- `immediate`: Canon may show a pending state until the runtime snapshot reflects the applied value
|
|
105
|
+
- `next_turn`: Canon may let the user queue the change, but should label it as applying on the next turn
|
|
106
|
+
- `none`: Canon never exposes it as live-editable
|
|
107
|
+
- `selectionPolicy: 'required_explicit'` means Canon should require the user to make a choice instead of silently inheriting a default
|
|
108
|
+
- `workspaceRoots` and `writableRoots` document allowed roots and let Canon group project choices. Canon still stores the selected concrete `workspaceId`; it does not send arbitrary root-relative paths to generic SDK agents.
|
|
109
|
+
- Publishing a descriptor does not automatically make your SDK agent enforce those controls. If you advertise model, workspace, execution mode, or runtime-native controls, your runtime must actually read and apply the stored config.
|
|
110
|
+
|
|
80
111
|
## Delivery Modes
|
|
81
112
|
|
|
82
113
|
The SDK supports three delivery modes for receiving messages:
|
package/dist/canon-agent.js
CHANGED
|
@@ -408,7 +408,16 @@ export class CanonAgent {
|
|
|
408
408
|
sourceConversationId: conversationId,
|
|
409
409
|
targetConversationId,
|
|
410
410
|
text,
|
|
411
|
-
...options,
|
|
411
|
+
...(options ?? {}),
|
|
412
|
+
messageOptions: {
|
|
413
|
+
...(options?.messageOptions ?? {}),
|
|
414
|
+
metadata: {
|
|
415
|
+
...(options?.messageOptions?.metadata ?? {}),
|
|
416
|
+
turnId,
|
|
417
|
+
turnSemantics: 'turn_complete',
|
|
418
|
+
turnComplete: true,
|
|
419
|
+
},
|
|
420
|
+
},
|
|
412
421
|
});
|
|
413
422
|
};
|
|
414
423
|
const uploadFile = (filePath, options) => uploadMediaFile(this.apiClient, conversationId, filePath, options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonmsg/agent-sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Canon Agent SDK — build AI agents that participate in Canon conversations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"node": ">=18.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@canonmsg/core": "^0.
|
|
31
|
+
"@canonmsg/core": "^0.10.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|