@a3s-lab/code 3.0.0 → 3.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.
Files changed (3) hide show
  1. package/README.md +45 -0
  2. package/index.d.ts +60 -1
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -158,9 +158,54 @@ await session.tasks([
158
158
  ])
159
159
  ```
160
160
 
161
+ For automatic subagent delegation, `autoParallel: false` disables automatic
162
+ parallel fan-out while keeping manual `parallel_task` / `session.tasks(...)`
163
+ available:
164
+
165
+ ```js
166
+ const session = agent.session('/my-project', {
167
+ autoDelegation: { enabled: true, maxTasks: 4 },
168
+ maxParallelTasks: 8,
169
+ autoParallel: false,
170
+ })
171
+ ```
172
+
161
173
  Use `session.toolNames()` for names and `session.toolDefinitions()` when a UI
162
174
  needs the full model-visible schemas.
163
175
 
176
+ ## Evidence And Artifacts
177
+
178
+ Tool outputs that exceed the inline display budget are retained as session
179
+ artifacts. Use `artifactStoreLimits` to tune retention and `getArtifact(...)`
180
+ to retrieve retained content by URI:
181
+
182
+ ```js
183
+ const session = agent.session('/my-project', {
184
+ artifactStoreLimits: { maxArtifacts: 64, maxBytes: 8 * 1024 * 1024 },
185
+ })
186
+
187
+ const artifact = session.getArtifact('a3s://tool-output/read/abc123')
188
+ if (artifact) console.log(artifact.content)
189
+ ```
190
+
191
+ External verification systems can attach their reports to the same session
192
+ evidence stream:
193
+
194
+ ```js
195
+ session.recordVerificationReports([{
196
+ schema: 'a3s.verification_report.v1',
197
+ subject: 'sdk:tests',
198
+ status: 'passed',
199
+ checks: [{
200
+ id: 'check:sdk',
201
+ kind: 'test',
202
+ description: 'Run SDK tests',
203
+ status: 'passed',
204
+ required: true,
205
+ }],
206
+ }])
207
+ ```
208
+
164
209
  ## Object-Shaped Direct Tools
165
210
 
166
211
  New direct helpers use option objects when the command can grow over time:
package/index.d.ts CHANGED
@@ -88,6 +88,32 @@ export interface VerificationCommand {
88
88
  required?: boolean
89
89
  timeoutMs?: number
90
90
  }
91
+ export type VerificationStatus = 'passed' | 'failed' | 'needs_review' | 'skipped'
92
+ export interface VerificationCheck {
93
+ id: string
94
+ kind: string
95
+ description: string
96
+ status: VerificationStatus
97
+ required?: boolean
98
+ suggested_tools?: Array<string>
99
+ evidence_uris?: Array<string>
100
+ residual_risk?: string
101
+ }
102
+ export interface VerificationReport {
103
+ schema: string
104
+ subject: string
105
+ status: VerificationStatus
106
+ checks: Array<VerificationCheck>
107
+ residual_risks?: Array<string>
108
+ }
109
+ export interface ToolArtifact {
110
+ artifact_id: string
111
+ artifact_uri: string
112
+ tool_name: string
113
+ content: string
114
+ original_bytes: number
115
+ shown_bytes: number
116
+ }
91
117
  export interface ToolResult {
92
118
  name: string
93
119
  output: string
@@ -199,6 +225,16 @@ export interface InlineSkill {
199
225
  /** Markdown content for the skill. */
200
226
  content: string
201
227
  }
228
+ export interface AutoDelegationOptions {
229
+ /** Enable runtime-driven automatic child-agent delegation. */
230
+ enabled?: boolean
231
+ /** Allow automatic delegation to launch multiple child agents in parallel. */
232
+ autoParallel?: boolean
233
+ /** Minimum local confidence required to auto-delegate a child task. */
234
+ minConfidence?: number
235
+ /** Maximum number of automatic child tasks per user request. */
236
+ maxTasks?: number
237
+ }
202
238
  export interface JsMemoryStore {
203
239
  backend: string
204
240
  dir?: string
@@ -408,6 +444,13 @@ export interface PendingConfirmation {
408
444
  /** Milliseconds remaining before the confirmation times out. */
409
445
  remainingMs: number
410
446
  }
447
+ /** Retention limits for large tool/program artifacts. */
448
+ export interface ArtifactStoreLimits {
449
+ /** Maximum number of artifacts retained by a session. */
450
+ maxArtifacts?: number
451
+ /** Maximum total artifact content bytes retained by a session. */
452
+ maxBytes?: number
453
+ }
411
454
  export interface SessionOptions {
412
455
  /** Override the default model. Format: "provider/model" (e.g., "openai/gpt-4o"). */
413
456
  model?: string
@@ -448,6 +491,8 @@ export interface SessionOptions {
448
491
  autoCompact?: boolean
449
492
  /** Context usage threshold (0.0–1.0) to trigger auto-compaction (default: 0.8). */
450
493
  autoCompactThreshold?: number
494
+ /** Retention limits for large tool/program artifacts. */
495
+ artifactStoreLimits?: ArtifactStoreLimits
451
496
  /**
452
497
  * Long-term memory store backend.
453
498
  *
@@ -530,6 +575,16 @@ export interface SessionOptions {
530
575
  inlineSkills?: Array<InlineSkill>
531
576
  /** Override maximum number of tool-call rounds for this session. */
532
577
  maxToolRounds?: number
578
+ /** Override maximum sibling parallel branches for this session. */
579
+ maxParallelTasks?: number
580
+ /** Override automatic child-agent delegation for this session. */
581
+ autoDelegation?: AutoDelegationOptions
582
+ /**
583
+ * Global session-level kill switch for automatic parallel child-agent fan-out.
584
+ *
585
+ * Manual `parallel_task` calls remain available when this is false.
586
+ */
587
+ autoParallel?: boolean
533
588
  /**
534
589
  * Sampling temperature (0.0–1.0). Overrides the provider default.
535
590
  * Only applied when `model` is also set.
@@ -1206,7 +1261,9 @@ export declare class Session {
1206
1261
  /** Return compact execution trace events recorded for this session. */
1207
1262
  traceEvents(): any
1208
1263
  /** Return structured verification reports recorded for this session. */
1209
- verificationReports(): any
1264
+ verificationReports(): Array<VerificationReport>
1265
+ /** Add externally produced verification reports to this session. */
1266
+ recordVerificationReports(reports: Array<VerificationReport> | VerificationReport): void
1210
1267
  /** Return a structured verification summary for this session. */
1211
1268
  verificationSummary(): any
1212
1269
  /** Return a concise human-readable verification summary for this session. */
@@ -1311,6 +1368,8 @@ export declare class Session {
1311
1368
  toolNames(): Array<string>
1312
1369
  /** Return full model-visible tool definitions currently registered on this session. */
1313
1370
  toolDefinitions(): any
1371
+ /** Return a stored tool artifact by URI, or null if it is not retained. */
1372
+ getArtifact(artifactUri: string): ToolArtifact | null
1314
1373
  /**
1315
1374
  * Register a hook for lifecycle event interception.
1316
1375
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a3s-lab/code",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "A3S Code - Native Node.js bindings for the coding-agent runtime",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -40,11 +40,11 @@
40
40
  "test:helpers": "node test-helpers.mjs"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@a3s-lab/code-darwin-arm64": "3.0.0",
44
- "@a3s-lab/code-linux-x64-gnu": "3.0.0",
45
- "@a3s-lab/code-linux-x64-musl": "3.0.0",
46
- "@a3s-lab/code-linux-arm64-gnu": "3.0.0",
47
- "@a3s-lab/code-linux-arm64-musl": "3.0.0",
48
- "@a3s-lab/code-win32-x64-msvc": "3.0.0"
43
+ "@a3s-lab/code-darwin-arm64": "3.1.0",
44
+ "@a3s-lab/code-linux-x64-gnu": "3.1.0",
45
+ "@a3s-lab/code-linux-x64-musl": "3.1.0",
46
+ "@a3s-lab/code-linux-arm64-gnu": "3.1.0",
47
+ "@a3s-lab/code-linux-arm64-musl": "3.1.0",
48
+ "@a3s-lab/code-win32-x64-msvc": "3.1.0"
49
49
  }
50
50
  }