opencode-swarm 6.33.0 → 6.33.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.
@@ -4,6 +4,7 @@ export declare const EVIDENCE_MAX_PATCH_BYTES: number;
4
4
  export declare const EVIDENCE_MAX_TASK_BYTES: number;
5
5
  export declare const EvidenceTypeSchema: z.ZodEnum<{
6
6
  diff: "diff";
7
+ secretscan: "secretscan";
7
8
  quality_budget: "quality_budget";
8
9
  placeholder: "placeholder";
9
10
  test: "test";
@@ -29,6 +30,7 @@ export declare const BaseEvidenceSchema: z.ZodObject<{
29
30
  task_id: z.ZodString;
30
31
  type: z.ZodEnum<{
31
32
  diff: "diff";
33
+ secretscan: "secretscan";
32
34
  quality_budget: "quality_budget";
33
35
  placeholder: "placeholder";
34
36
  test: "test";
@@ -217,6 +219,13 @@ export declare const RetrospectiveEvidenceSchema: z.ZodObject<{
217
219
  }>;
218
220
  abandoned_reason: z.ZodOptional<z.ZodString>;
219
221
  }, z.core.$strip>>>;
222
+ error_taxonomy: z.ZodDefault<z.ZodArray<z.ZodEnum<{
223
+ planning_error: "planning_error";
224
+ interface_mismatch: "interface_mismatch";
225
+ logic_error: "logic_error";
226
+ scope_creep: "scope_creep";
227
+ gate_evasion: "gate_evasion";
228
+ }>>>;
220
229
  }, z.core.$strip>;
221
230
  export type RetrospectiveEvidence = z.infer<typeof RetrospectiveEvidenceSchema>;
222
231
  export declare const SyntaxEvidenceSchema: z.ZodObject<{
@@ -434,6 +443,26 @@ export declare const QualityBudgetEvidenceSchema: z.ZodObject<{
434
443
  files_analyzed: z.ZodArray<z.ZodString>;
435
444
  }, z.core.$strip>;
436
445
  export type QualityBudgetEvidence = z.infer<typeof QualityBudgetEvidenceSchema>;
446
+ export declare const SecretscanEvidenceSchema: z.ZodObject<{
447
+ task_id: z.ZodString;
448
+ timestamp: z.ZodString;
449
+ agent: z.ZodString;
450
+ verdict: z.ZodEnum<{
451
+ pass: "pass";
452
+ fail: "fail";
453
+ approved: "approved";
454
+ rejected: "rejected";
455
+ info: "info";
456
+ }>;
457
+ summary: z.ZodString;
458
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
459
+ type: z.ZodLiteral<"secretscan">;
460
+ findings_count: z.ZodDefault<z.ZodNumber>;
461
+ scan_directory: z.ZodOptional<z.ZodString>;
462
+ files_scanned: z.ZodDefault<z.ZodNumber>;
463
+ skipped_files: z.ZodDefault<z.ZodNumber>;
464
+ }, z.core.$strip>;
465
+ export type SecretscanEvidence = z.infer<typeof SecretscanEvidenceSchema>;
437
466
  export declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
438
467
  task_id: z.ZodString;
439
468
  timestamp: z.ZodString;
@@ -587,6 +616,13 @@ export declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
587
616
  }>;
588
617
  abandoned_reason: z.ZodOptional<z.ZodString>;
589
618
  }, z.core.$strip>>>;
619
+ error_taxonomy: z.ZodDefault<z.ZodArray<z.ZodEnum<{
620
+ planning_error: "planning_error";
621
+ interface_mismatch: "interface_mismatch";
622
+ logic_error: "logic_error";
623
+ scope_creep: "scope_creep";
624
+ gate_evasion: "gate_evasion";
625
+ }>>>;
590
626
  }, z.core.$strip>, z.ZodObject<{
591
627
  task_id: z.ZodString;
592
628
  timestamp: z.ZodString;
@@ -790,6 +826,24 @@ export declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
790
826
  files: z.ZodArray<z.ZodString>;
791
827
  }, z.core.$strip>>>;
792
828
  files_analyzed: z.ZodArray<z.ZodString>;
829
+ }, z.core.$strip>, z.ZodObject<{
830
+ task_id: z.ZodString;
831
+ timestamp: z.ZodString;
832
+ agent: z.ZodString;
833
+ verdict: z.ZodEnum<{
834
+ pass: "pass";
835
+ fail: "fail";
836
+ approved: "approved";
837
+ rejected: "rejected";
838
+ info: "info";
839
+ }>;
840
+ summary: z.ZodString;
841
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
842
+ type: z.ZodLiteral<"secretscan">;
843
+ findings_count: z.ZodDefault<z.ZodNumber>;
844
+ scan_directory: z.ZodOptional<z.ZodString>;
845
+ files_scanned: z.ZodDefault<z.ZodNumber>;
846
+ skipped_files: z.ZodDefault<z.ZodNumber>;
793
847
  }, z.core.$strip>], "type">;
794
848
  export type Evidence = z.infer<typeof EvidenceSchema>;
795
849
  export declare const EvidenceBundleSchema: z.ZodObject<{
@@ -948,6 +1002,13 @@ export declare const EvidenceBundleSchema: z.ZodObject<{
948
1002
  }>;
949
1003
  abandoned_reason: z.ZodOptional<z.ZodString>;
950
1004
  }, z.core.$strip>>>;
1005
+ error_taxonomy: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1006
+ planning_error: "planning_error";
1007
+ interface_mismatch: "interface_mismatch";
1008
+ logic_error: "logic_error";
1009
+ scope_creep: "scope_creep";
1010
+ gate_evasion: "gate_evasion";
1011
+ }>>>;
951
1012
  }, z.core.$strip>, z.ZodObject<{
952
1013
  task_id: z.ZodString;
953
1014
  timestamp: z.ZodString;
@@ -1151,6 +1212,24 @@ export declare const EvidenceBundleSchema: z.ZodObject<{
1151
1212
  files: z.ZodArray<z.ZodString>;
1152
1213
  }, z.core.$strip>>>;
1153
1214
  files_analyzed: z.ZodArray<z.ZodString>;
1215
+ }, z.core.$strip>, z.ZodObject<{
1216
+ task_id: z.ZodString;
1217
+ timestamp: z.ZodString;
1218
+ agent: z.ZodString;
1219
+ verdict: z.ZodEnum<{
1220
+ pass: "pass";
1221
+ fail: "fail";
1222
+ approved: "approved";
1223
+ rejected: "rejected";
1224
+ info: "info";
1225
+ }>;
1226
+ summary: z.ZodString;
1227
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1228
+ type: z.ZodLiteral<"secretscan">;
1229
+ findings_count: z.ZodDefault<z.ZodNumber>;
1230
+ scan_directory: z.ZodOptional<z.ZodString>;
1231
+ files_scanned: z.ZodDefault<z.ZodNumber>;
1232
+ skipped_files: z.ZodDefault<z.ZodNumber>;
1154
1233
  }, z.core.$strip>], "type">>>;
1155
1234
  created_at: z.ZodString;
1156
1235
  updated_at: z.ZodString;
@@ -18,6 +18,7 @@ export declare const AgentOverrideConfigSchema: z.ZodObject<{
18
18
  model: z.ZodOptional<z.ZodString>;
19
19
  temperature: z.ZodOptional<z.ZodNumber>;
20
20
  disabled: z.ZodOptional<z.ZodBoolean>;
21
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
22
  }, z.core.$strip>;
22
23
  export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
23
24
  export declare const SwarmConfigSchema: z.ZodObject<{
@@ -26,6 +27,7 @@ export declare const SwarmConfigSchema: z.ZodObject<{
26
27
  model: z.ZodOptional<z.ZodString>;
27
28
  temperature: z.ZodOptional<z.ZodNumber>;
28
29
  disabled: z.ZodOptional<z.ZodBoolean>;
30
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodString>>;
29
31
  }, z.core.$strip>>>;
30
32
  }, z.core.$strip>;
31
33
  export type SwarmConfig = z.infer<typeof SwarmConfigSchema>;
@@ -313,6 +315,8 @@ export declare const GuardrailsConfigSchema: z.ZodObject<{
313
315
  max_consecutive_errors: z.ZodDefault<z.ZodNumber>;
314
316
  warning_threshold: z.ZodDefault<z.ZodNumber>;
315
317
  idle_timeout_minutes: z.ZodDefault<z.ZodNumber>;
318
+ no_op_warning_threshold: z.ZodDefault<z.ZodNumber>;
319
+ max_coder_revisions: z.ZodDefault<z.ZodNumber>;
316
320
  qa_gates: z.ZodOptional<z.ZodObject<{
317
321
  required_tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
318
322
  require_reviewer_test_engineer: z.ZodDefault<z.ZodBoolean>;
@@ -467,6 +471,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
467
471
  model: z.ZodOptional<z.ZodString>;
468
472
  temperature: z.ZodOptional<z.ZodNumber>;
469
473
  disabled: z.ZodOptional<z.ZodBoolean>;
474
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodString>>;
470
475
  }, z.core.$strip>>>;
471
476
  swarms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
472
477
  name: z.ZodOptional<z.ZodString>;
@@ -474,6 +479,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
474
479
  model: z.ZodOptional<z.ZodString>;
475
480
  temperature: z.ZodOptional<z.ZodNumber>;
476
481
  disabled: z.ZodOptional<z.ZodBoolean>;
482
+ fallback_models: z.ZodOptional<z.ZodArray<z.ZodString>>;
477
483
  }, z.core.$strip>>>;
478
484
  }, z.core.$strip>>>;
479
485
  max_iterations: z.ZodDefault<z.ZodNumber>;
@@ -497,6 +503,11 @@ export declare const PluginConfigSchema: z.ZodObject<{
497
503
  }, z.core.$strip>>;
498
504
  }, z.core.$strip>>;
499
505
  qa_retry_limit: z.ZodDefault<z.ZodNumber>;
506
+ execution_mode: z.ZodDefault<z.ZodEnum<{
507
+ strict: "strict";
508
+ balanced: "balanced";
509
+ fast: "fast";
510
+ }>>;
500
511
  inject_phase_reminders: z.ZodDefault<z.ZodBoolean>;
501
512
  hooks: z.ZodOptional<z.ZodObject<{
502
513
  system_enhancer: z.ZodDefault<z.ZodBoolean>;
@@ -585,6 +596,8 @@ export declare const PluginConfigSchema: z.ZodObject<{
585
596
  max_consecutive_errors: z.ZodDefault<z.ZodNumber>;
586
597
  warning_threshold: z.ZodDefault<z.ZodNumber>;
587
598
  idle_timeout_minutes: z.ZodDefault<z.ZodNumber>;
599
+ no_op_warning_threshold: z.ZodDefault<z.ZodNumber>;
600
+ max_coder_revisions: z.ZodDefault<z.ZodNumber>;
588
601
  qa_gates: z.ZodOptional<z.ZodObject<{
589
602
  required_tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
590
603
  require_reviewer_test_engineer: z.ZodDefault<z.ZodBoolean>;
@@ -1,4 +1,4 @@
1
- import { type BuildEvidence, type Evidence, type EvidenceBundle, type PlaceholderEvidence, type QualityBudgetEvidence, type SastEvidence, type SbomEvidence, type SyntaxEvidence } from '../config/evidence-schema';
1
+ import { type BuildEvidence, type Evidence, type EvidenceBundle, type PlaceholderEvidence, type QualityBudgetEvidence, type SastEvidence, type SbomEvidence, type SecretscanEvidence, type SyntaxEvidence } from '../config/evidence-schema';
2
2
  /**
3
3
  * Discriminated union returned by loadEvidence.
4
4
  * - 'found': file exists and passed Zod schema validation
@@ -15,9 +15,9 @@ export type LoadEvidenceResult = {
15
15
  errors: string[];
16
16
  };
17
17
  /**
18
- * All valid evidence types (12 total)
18
+ * All valid evidence types (13 total)
19
19
  */
20
- export declare const VALID_EVIDENCE_TYPES: readonly ["review", "test", "diff", "approval", "note", "retrospective", "syntax", "placeholder", "sast", "sbom", "build", "quality_budget"];
20
+ export declare const VALID_EVIDENCE_TYPES: readonly ["review", "test", "diff", "approval", "note", "retrospective", "syntax", "placeholder", "sast", "sbom", "build", "quality_budget", "secretscan"];
21
21
  /**
22
22
  * Check if a string is a valid evidence type.
23
23
  * Returns true if the type is recognized, false otherwise.
@@ -32,12 +32,16 @@ export declare function isSastEvidence(evidence: Evidence): evidence is SastEvid
32
32
  export declare function isSbomEvidence(evidence: Evidence): evidence is SbomEvidence;
33
33
  export declare function isBuildEvidence(evidence: Evidence): evidence is BuildEvidence;
34
34
  export declare function isQualityBudgetEvidence(evidence: Evidence): evidence is QualityBudgetEvidence;
35
+ /**
36
+ * Type guard for secretscan evidence
37
+ */
38
+ export declare function isSecretscanEvidence(evidence: Evidence): evidence is SecretscanEvidence;
35
39
  /**
36
40
  * Validate and sanitize task ID.
37
41
  * Accepts three formats:
38
42
  * 1. Canonical N.M or N.M.P numeric format (matches TASK_ID_REGEX)
39
43
  * 2. Retrospective format: retro-<number> (matches RETRO_TASK_ID_REGEX)
40
- * 3. Internal automated-tool format: specific tool IDs (sast_scan, quality_budget, syntax_check, placeholder_scan, sbom_generate, build)
44
+ * 3. Internal automated-tool format: specific tool IDs (sast_scan, quality_budget, syntax_check, placeholder_scan, sbom_generate, build, secretscan)
41
45
  * Rejects: .., ../, null bytes, control characters, empty string, other non-numeric IDs
42
46
  * @throws Error with descriptive message on failure
43
47
  */
@@ -6,6 +6,13 @@
6
6
  */
7
7
  import type { PluginConfig } from '../config';
8
8
  import type { DelegationEnvelope, EnvelopeValidationResult } from '../types/delegation.js';
9
+ /**
10
+ * v6.33.1 CRIT-1: Fallback map for declared coder scope by taskId.
11
+ * When messagesTransform sets declaredCoderScope on the architect session,
12
+ * the coder session may not exist yet. This map allows scope-guard to look up
13
+ * the scope by taskId when the session's declaredCoderScope is null.
14
+ */
15
+ export declare const pendingCoderScopeByTaskId: Map<string, string[]>;
9
16
  /**
10
17
  * Parses a string to extract a DelegationEnvelope.
11
18
  * Returns null if no valid envelope is found.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * delegation-gate.getEvidenceTaskId.test.ts
3
+ *
4
+ * Verification tests for the async conversion of getEvidenceTaskId.
5
+ * Tests the function behavior by recreating its logic in isolation since
6
+ * the function is private (not exported) and depends on fs.promises.
7
+ *
8
+ * Covers:
9
+ * 1. Function returns a Promise (is async)
10
+ * 2. Function resolves to correct task ID when currentTaskId is set
11
+ * 3. Function resolves to correct task ID when lastCoderDelegationTaskId is set
12
+ * 4. Function falls back to taskWorkflowStates when above are null
13
+ * 5. Function returns null when plan.json doesn't exist (ENOENT)
14
+ * 6. Function returns null when plan.json has no in_progress tasks
15
+ * 7. Function returns null when session has direct task_id (early return path via currentTaskId)
16
+ * 8. Path traversal is blocked (security hardening)
17
+ * 9. Malformed JSON returns null
18
+ * 10. Empty/invalid directory returns null
19
+ */
20
+ export {};
@@ -23,7 +23,7 @@ export interface ScopeGuardConfig {
23
23
  * @param _directory - The workspace directory (reserved for future use)
24
24
  * @param injectAdvisory - Optional callback to push advisory to architect session
25
25
  */
26
- export declare function createScopeGuardHook(config: Partial<ScopeGuardConfig>, _directory: string, injectAdvisory?: (sessionId: string, message: string) => void): {
26
+ export declare function createScopeGuardHook(config: Partial<ScopeGuardConfig>, directory: string, injectAdvisory?: (sessionId: string, message: string) => void): {
27
27
  toolBefore: (input: {
28
28
  tool: string;
29
29
  sessionID: string;
@@ -40,4 +40,4 @@ export declare function createScopeGuardHook(config: Partial<ScopeGuardConfig>,
40
40
  * @param scopeEntries - Array of declared scope entries (files or directories)
41
41
  * @returns true if the file is within scope, false otherwise
42
42
  */
43
- export declare function isFileInScope(filePath: string, scopeEntries: string[]): boolean;
43
+ export declare function isFileInScope(filePath: string, scopeEntries: string[], directory?: string): boolean;