opencode-swarm 6.45.1 → 6.47.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 +121 -0
- package/dist/cli/index.js +353 -240
- package/dist/commands/close.d.ts +1 -1
- package/dist/config/evidence-schema.d.ts +2 -2
- package/dist/config/schema.d.ts +50 -0
- package/dist/hooks/guardrails.d.ts +12 -3
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index.js +765 -587
- package/package.json +1 -1
package/dist/commands/close.d.ts
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* writing retrospectives for in-progress phases, and clearing session state.
|
|
4
4
|
* Must be idempotent - safe to run multiple times.
|
|
5
5
|
*/
|
|
6
|
-
export declare function handleCloseCommand(directory: string,
|
|
6
|
+
export declare function handleCloseCommand(directory: string, args: string[]): Promise<string>;
|
|
@@ -8,6 +8,7 @@ export declare const EvidenceTypeSchema: z.ZodEnum<{
|
|
|
8
8
|
quality_budget: "quality_budget";
|
|
9
9
|
placeholder: "placeholder";
|
|
10
10
|
test: "test";
|
|
11
|
+
build: "build";
|
|
11
12
|
review: "review";
|
|
12
13
|
approval: "approval";
|
|
13
14
|
note: "note";
|
|
@@ -15,7 +16,6 @@ export declare const EvidenceTypeSchema: z.ZodEnum<{
|
|
|
15
16
|
syntax: "syntax";
|
|
16
17
|
sast: "sast";
|
|
17
18
|
sbom: "sbom";
|
|
18
|
-
build: "build";
|
|
19
19
|
}>;
|
|
20
20
|
export type EvidenceType = z.infer<typeof EvidenceTypeSchema>;
|
|
21
21
|
export declare const EvidenceVerdictSchema: z.ZodEnum<{
|
|
@@ -34,6 +34,7 @@ export declare const BaseEvidenceSchema: z.ZodObject<{
|
|
|
34
34
|
quality_budget: "quality_budget";
|
|
35
35
|
placeholder: "placeholder";
|
|
36
36
|
test: "test";
|
|
37
|
+
build: "build";
|
|
37
38
|
review: "review";
|
|
38
39
|
approval: "approval";
|
|
39
40
|
note: "note";
|
|
@@ -41,7 +42,6 @@ export declare const BaseEvidenceSchema: z.ZodObject<{
|
|
|
41
42
|
syntax: "syntax";
|
|
42
43
|
sast: "sast";
|
|
43
44
|
sbom: "sbom";
|
|
44
|
-
build: "build";
|
|
45
45
|
}>;
|
|
46
46
|
timestamp: z.ZodString;
|
|
47
47
|
agent: z.ZodString;
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -468,6 +468,39 @@ export declare const CompactionConfigSchema: z.ZodObject<{
|
|
|
468
468
|
preserveLastNTurns: z.ZodDefault<z.ZodNumber>;
|
|
469
469
|
}, z.core.$strip>;
|
|
470
470
|
export type CompactionConfig = z.infer<typeof CompactionConfigSchema>;
|
|
471
|
+
export declare const AgentAuthorityRuleSchema: z.ZodObject<{
|
|
472
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
473
|
+
blockedExact: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
474
|
+
blockedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
475
|
+
allowedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
476
|
+
blockedZones: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
477
|
+
docs: "docs";
|
|
478
|
+
production: "production";
|
|
479
|
+
test: "test";
|
|
480
|
+
config: "config";
|
|
481
|
+
generated: "generated";
|
|
482
|
+
build: "build";
|
|
483
|
+
}>>>;
|
|
484
|
+
}, z.core.$strip>;
|
|
485
|
+
export type AgentAuthorityRule = z.infer<typeof AgentAuthorityRuleSchema>;
|
|
486
|
+
export declare const AuthorityConfigSchema: z.ZodObject<{
|
|
487
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
488
|
+
rules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
489
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
490
|
+
blockedExact: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
491
|
+
blockedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
492
|
+
allowedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
493
|
+
blockedZones: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
494
|
+
docs: "docs";
|
|
495
|
+
production: "production";
|
|
496
|
+
test: "test";
|
|
497
|
+
config: "config";
|
|
498
|
+
generated: "generated";
|
|
499
|
+
build: "build";
|
|
500
|
+
}>>>;
|
|
501
|
+
}, z.core.$strip>>>;
|
|
502
|
+
}, z.core.$strip>;
|
|
503
|
+
export type AuthorityConfig = z.infer<typeof AuthorityConfigSchema>;
|
|
471
504
|
export declare const PluginConfigSchema: z.ZodObject<{
|
|
472
505
|
agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
473
506
|
model: z.ZodOptional<z.ZodString>;
|
|
@@ -627,6 +660,23 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
627
660
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
628
661
|
overrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
629
662
|
}, z.core.$strip>>;
|
|
663
|
+
authority: z.ZodOptional<z.ZodObject<{
|
|
664
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
665
|
+
rules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
666
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
667
|
+
blockedExact: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
668
|
+
blockedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
669
|
+
allowedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
670
|
+
blockedZones: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
671
|
+
docs: "docs";
|
|
672
|
+
production: "production";
|
|
673
|
+
test: "test";
|
|
674
|
+
config: "config";
|
|
675
|
+
generated: "generated";
|
|
676
|
+
build: "build";
|
|
677
|
+
}>>>;
|
|
678
|
+
}, z.core.$strip>>>;
|
|
679
|
+
}, z.core.$strip>>;
|
|
630
680
|
plan_cursor: z.ZodOptional<z.ZodObject<{
|
|
631
681
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
632
682
|
max_tokens: z.ZodDefault<z.ZodNumber>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Layer 1 (Soft Warning @ warning_threshold): Sets warning flag for messagesTransform to inject warning
|
|
7
7
|
* - Layer 2 (Hard Block @ 100%): Throws error in toolBefore to block further calls, injects STOP message
|
|
8
8
|
*/
|
|
9
|
-
import { type GuardrailsConfig } from '../config/schema';
|
|
9
|
+
import { type AuthorityConfig, type GuardrailsConfig } from '../config/schema';
|
|
10
10
|
import { type FileZone } from '../context/zone-classifier';
|
|
11
11
|
/**
|
|
12
12
|
* Retrieves stored input args for a given callID.
|
|
@@ -34,7 +34,7 @@ export declare function deleteStoredInputArgs(callID: string): void;
|
|
|
34
34
|
* @param config Guardrails configuration (optional)
|
|
35
35
|
* @returns Tool before/after hooks and messages transform hook
|
|
36
36
|
*/
|
|
37
|
-
export declare function createGuardrailsHooks(directory: string, directoryOrConfig?: string | GuardrailsConfig, config?: GuardrailsConfig): {
|
|
37
|
+
export declare function createGuardrailsHooks(directory: string, directoryOrConfig?: string | GuardrailsConfig, config?: GuardrailsConfig, authorityConfig?: AuthorityConfig): {
|
|
38
38
|
toolBefore: (input: {
|
|
39
39
|
tool: string;
|
|
40
40
|
sessionID: string;
|
|
@@ -103,13 +103,22 @@ export declare function validateAndRecordAttestation(dir: string, findingId: str
|
|
|
103
103
|
valid: false;
|
|
104
104
|
reason: string;
|
|
105
105
|
}>;
|
|
106
|
+
type AgentRule = {
|
|
107
|
+
readOnly?: boolean;
|
|
108
|
+
blockedExact?: string[];
|
|
109
|
+
blockedPrefix?: string[];
|
|
110
|
+
allowedPrefix?: string[];
|
|
111
|
+
blockedZones?: FileZone[];
|
|
112
|
+
};
|
|
113
|
+
export declare const DEFAULT_AGENT_AUTHORITY_RULES: Record<string, AgentRule>;
|
|
106
114
|
/**
|
|
107
115
|
* Checks whether the given agent is authorised to write to the given file path.
|
|
108
116
|
*/
|
|
109
|
-
export declare function checkFileAuthority(agentName: string, filePath: string, cwd: string): {
|
|
117
|
+
export declare function checkFileAuthority(agentName: string, filePath: string, cwd: string, authorityConfig?: AuthorityConfig): {
|
|
110
118
|
allowed: true;
|
|
111
119
|
} | {
|
|
112
120
|
allowed: false;
|
|
113
121
|
reason: string;
|
|
114
122
|
zone?: FileZone;
|
|
115
123
|
};
|
|
124
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { createDelegationGateHook } from './delegation-gate';
|
|
|
6
6
|
export { createDelegationSanitizerHook } from './delegation-sanitizer';
|
|
7
7
|
export { createDelegationTrackerHook } from './delegation-tracker';
|
|
8
8
|
export { extractCurrentPhase, extractCurrentPhaseFromPlan, extractCurrentTask, extractCurrentTaskFromPlan, extractDecisions, extractIncompleteTasks, extractIncompleteTasksFromPlan, extractPatterns, } from './extractors';
|
|
9
|
-
export { createGuardrailsHooks } from './guardrails';
|
|
9
|
+
export { checkFileAuthority, createGuardrailsHooks, DEFAULT_AGENT_AUTHORITY_RULES, } from './guardrails';
|
|
10
10
|
export { classifyMessage, classifyMessages, containsPlanContent, isDuplicateToolRead, isStaleError, isToolResult, MessagePriority, type MessagePriorityType, type MessageWithParts, } from './message-priority';
|
|
11
11
|
export { consolidateSystemMessages } from './messages-transform';
|
|
12
12
|
export { extractModelInfo, NATIVE_MODEL_LIMITS, PROVIDER_CAPS, resolveModelLimit, } from './model-limits';
|