overarch-linux-arm64 0.8.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 (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +214 -0
  3. package/dist/bin/overarch.d.ts +2 -0
  4. package/dist/bin/overarch.js +178 -0
  5. package/dist/src/agent/context.d.ts +14 -0
  6. package/dist/src/agent/context.js +200 -0
  7. package/dist/src/agent/context_compressor.d.ts +21 -0
  8. package/dist/src/agent/context_compressor.js +90 -0
  9. package/dist/src/agent/manifest.d.ts +22 -0
  10. package/dist/src/agent/manifest.js +131 -0
  11. package/dist/src/agent/planner.d.ts +38 -0
  12. package/dist/src/agent/planner.js +118 -0
  13. package/dist/src/agent/runtime.d.ts +59 -0
  14. package/dist/src/agent/runtime.js +400 -0
  15. package/dist/src/cli/approval.d.ts +13 -0
  16. package/dist/src/cli/approval.js +71 -0
  17. package/dist/src/cli/args.d.ts +15 -0
  18. package/dist/src/cli/args.js +47 -0
  19. package/dist/src/cli/commands/audit.d.ts +10 -0
  20. package/dist/src/cli/commands/audit.js +79 -0
  21. package/dist/src/cli/commands/companion.d.ts +1 -0
  22. package/dist/src/cli/commands/companion.js +143 -0
  23. package/dist/src/cli/commands/config.d.ts +1 -0
  24. package/dist/src/cli/commands/config.js +135 -0
  25. package/dist/src/cli/commands/doctor.d.ts +1 -0
  26. package/dist/src/cli/commands/doctor.js +217 -0
  27. package/dist/src/cli/commands/init.d.ts +1 -0
  28. package/dist/src/cli/commands/init.js +134 -0
  29. package/dist/src/cli/commands/memory.d.ts +2 -0
  30. package/dist/src/cli/commands/memory.js +98 -0
  31. package/dist/src/cli/commands/onboarding.d.ts +3 -0
  32. package/dist/src/cli/commands/onboarding.js +223 -0
  33. package/dist/src/cli/commands/sessions.d.ts +1 -0
  34. package/dist/src/cli/commands/sessions.js +22 -0
  35. package/dist/src/cli/commands/status.d.ts +1 -0
  36. package/dist/src/cli/commands/status.js +37 -0
  37. package/dist/src/cli/commands/update.d.ts +9 -0
  38. package/dist/src/cli/commands/update.js +105 -0
  39. package/dist/src/cli/repl.d.ts +3 -0
  40. package/dist/src/cli/repl.js +821 -0
  41. package/dist/src/cli/ui.d.ts +53 -0
  42. package/dist/src/cli/ui.js +215 -0
  43. package/dist/src/companion/petdex_adapter.d.ts +31 -0
  44. package/dist/src/companion/petdex_adapter.js +171 -0
  45. package/dist/src/companion/petdex_bridge.d.ts +65 -0
  46. package/dist/src/companion/petdex_bridge.js +356 -0
  47. package/dist/src/companion/types.d.ts +57 -0
  48. package/dist/src/companion/types.js +11 -0
  49. package/dist/src/config/index.d.ts +24 -0
  50. package/dist/src/config/index.js +237 -0
  51. package/dist/src/config/types.d.ts +58 -0
  52. package/dist/src/config/types.js +7 -0
  53. package/dist/src/core/diagnostics.d.ts +48 -0
  54. package/dist/src/core/diagnostics.js +115 -0
  55. package/dist/src/core/index.d.ts +23 -0
  56. package/dist/src/core/index.js +23 -0
  57. package/dist/src/core/mission.d.ts +55 -0
  58. package/dist/src/core/mission.js +173 -0
  59. package/dist/src/index.d.ts +1 -0
  60. package/dist/src/index.js +1 -0
  61. package/dist/src/learning/memory_manager.d.ts +26 -0
  62. package/dist/src/learning/memory_manager.js +211 -0
  63. package/dist/src/learning/types.d.ts +54 -0
  64. package/dist/src/learning/types.js +1 -0
  65. package/dist/src/mcp/registry.d.ts +17 -0
  66. package/dist/src/mcp/registry.js +97 -0
  67. package/dist/src/mcp/types.d.ts +13 -0
  68. package/dist/src/mcp/types.js +1 -0
  69. package/dist/src/providers/anthropic.d.ts +10 -0
  70. package/dist/src/providers/anthropic.js +95 -0
  71. package/dist/src/providers/base.d.ts +15 -0
  72. package/dist/src/providers/base.js +108 -0
  73. package/dist/src/providers/factory.d.ts +28 -0
  74. package/dist/src/providers/factory.js +142 -0
  75. package/dist/src/providers/gemini.d.ts +10 -0
  76. package/dist/src/providers/gemini.js +97 -0
  77. package/dist/src/providers/openai.d.ts +9 -0
  78. package/dist/src/providers/openai.js +85 -0
  79. package/dist/src/providers/openrouter.d.ts +5 -0
  80. package/dist/src/providers/openrouter.js +14 -0
  81. package/dist/src/providers/registry.d.ts +19 -0
  82. package/dist/src/providers/registry.js +209 -0
  83. package/dist/src/providers/types.d.ts +59 -0
  84. package/dist/src/providers/types.js +1 -0
  85. package/dist/src/providers/validator.d.ts +24 -0
  86. package/dist/src/providers/validator.js +161 -0
  87. package/dist/src/security/audit.d.ts +56 -0
  88. package/dist/src/security/audit.js +154 -0
  89. package/dist/src/security/guardrails.d.ts +9 -0
  90. package/dist/src/security/guardrails.js +32 -0
  91. package/dist/src/security/permissions.d.ts +12 -0
  92. package/dist/src/security/permissions.js +68 -0
  93. package/dist/src/security/policy.d.ts +220 -0
  94. package/dist/src/security/policy.js +720 -0
  95. package/dist/src/session/manager.d.ts +22 -0
  96. package/dist/src/session/manager.js +172 -0
  97. package/dist/src/session/types.d.ts +36 -0
  98. package/dist/src/session/types.js +1 -0
  99. package/dist/src/tools/checkpoint.d.ts +26 -0
  100. package/dist/src/tools/checkpoint.js +160 -0
  101. package/dist/src/tools/diagnostics.d.ts +2 -0
  102. package/dist/src/tools/diagnostics.js +125 -0
  103. package/dist/src/tools/diff.d.ts +14 -0
  104. package/dist/src/tools/diff.js +124 -0
  105. package/dist/src/tools/filesystem.d.ts +2 -0
  106. package/dist/src/tools/filesystem.js +224 -0
  107. package/dist/src/tools/git.d.ts +2 -0
  108. package/dist/src/tools/git.js +138 -0
  109. package/dist/src/tools/markdown.d.ts +33 -0
  110. package/dist/src/tools/markdown.js +190 -0
  111. package/dist/src/tools/project.d.ts +2 -0
  112. package/dist/src/tools/project.js +63 -0
  113. package/dist/src/tools/registry.d.ts +14 -0
  114. package/dist/src/tools/registry.js +230 -0
  115. package/dist/src/tools/search.d.ts +2 -0
  116. package/dist/src/tools/search.js +136 -0
  117. package/dist/src/tools/shell.d.ts +2 -0
  118. package/dist/src/tools/shell.js +74 -0
  119. package/dist/src/tools/symbols.d.ts +30 -0
  120. package/dist/src/tools/symbols.js +155 -0
  121. package/dist/src/tools/types.d.ts +28 -0
  122. package/dist/src/tools/types.js +1 -0
  123. package/dist/src/tools/web_search.d.ts +14 -0
  124. package/dist/src/tools/web_search.js +154 -0
  125. package/install.sh +29 -0
  126. package/overarch +15 -0
  127. package/package.json +28 -0
@@ -0,0 +1,220 @@
1
+ export type ActionRiskTier = 'safe' | 'danger';
2
+ /**
3
+ * CCHCFAI Action States
4
+ */
5
+ export declare enum ActionState {
6
+ SUGGEST = "SUGGEST",
7
+ REQUEST_APPROVAL = "REQUEST_APPROVAL",
8
+ EXECUTE = "EXECUTE",
9
+ DENY = "DENY",
10
+ ESCALATE = "ESCALATE",
11
+ STOP = "STOP"
12
+ }
13
+ /**
14
+ * CCHCFAI Capability Taxonomy
15
+ */
16
+ export declare enum Capability {
17
+ READ_FILES = "READ_FILES",
18
+ WRITE_FILES = "WRITE_FILES",
19
+ DELETE_FILES = "DELETE_FILES",
20
+ EXECUTE_COMMANDS = "EXECUTE_COMMANDS",
21
+ NETWORK_ACCESS = "NETWORK_ACCESS",
22
+ BROWSER_ACCESS = "BROWSER_ACCESS",
23
+ APPLICATION_CONTROL = "APPLICATION_CONTROL",
24
+ CAMERA_ACCESS = "CAMERA_ACCESS",
25
+ MICROPHONE_ACCESS = "MICROPHONE_ACCESS",
26
+ MESSAGE_SENDING = "MESSAGE_SENDING",
27
+ ACCOUNT_ACCESS = "ACCOUNT_ACCESS",
28
+ SYSTEM_CONFIGURATION = "SYSTEM_CONFIGURATION",
29
+ INSTALLATION = "INSTALLATION"
30
+ }
31
+ /**
32
+ * CCHCFAI Risk Levels (R0 - R5)
33
+ */
34
+ export declare enum RiskLevel {
35
+ R0 = "R0",// Informational / Read-only / Query
36
+ R1 = "R1",// Low-risk / Reversible local action
37
+ R2 = "R2",// Persistent change / Workspace modification
38
+ R3 = "R3",// External consequence / Network interaction
39
+ R4 = "R4",// High-impact / Destructive / Privilege modification
40
+ R5 = "R5"
41
+ }
42
+ /**
43
+ * Written Classification Rubric for Overarch CCHCFAI Policy Engine
44
+ */
45
+ export declare const POLICY_CLASSIFICATION_RUBRIC: {
46
+ readonly R0: {
47
+ readonly name: "Informational & Read-Only";
48
+ readonly description: "Read-only inspections, queries, directory listings, diffs, symbol extraction, search. Zero state modification.";
49
+ readonly capabilities: readonly [Capability.READ_FILES, Capability.NETWORK_ACCESS];
50
+ readonly defaultState: ActionState.EXECUTE;
51
+ readonly approvalRequired: false;
52
+ readonly reversible: true;
53
+ readonly examples: readonly ["readFile", "readSlice", "listDirectory", "fileSearch", "gitStatus", "gitLog", "web_search"];
54
+ };
55
+ readonly R1: {
56
+ readonly name: "Low-Risk Reversible Local Mutation";
57
+ readonly description: "Workspace file additions and edits in non-sensitive paths. Readily revertible via git or checkpoint manager.";
58
+ readonly capabilities: readonly [Capability.WRITE_FILES];
59
+ readonly defaultState: ActionState.EXECUTE;
60
+ readonly approvalRequired: false;
61
+ readonly reversible: true;
62
+ readonly examples: readonly ["writeFile (workspace code)", "editFile (src/component.ts)", "patchSection (README.md)"];
63
+ };
64
+ readonly R2: {
65
+ readonly name: "Persistent Workspace Mutation";
66
+ readonly description: "Package installations, git commits, running test/build commands, stateful tool configurations.";
67
+ readonly capabilities: readonly [Capability.EXECUTE_COMMANDS, Capability.INSTALLATION];
68
+ readonly defaultState: ActionState.REQUEST_APPROVAL;
69
+ readonly approvalRequired: true;
70
+ readonly reversible: true;
71
+ readonly examples: readonly ["runShell (npm test)", "executeCommand (npm run build)", "runShell (git commit -m \"update\")"];
72
+ };
73
+ readonly R3: {
74
+ readonly name: "External Consequence & Network Interaction";
75
+ readonly description: "Pushing changes to remote repositories, sending external network requests, publishing packages, webhooks.";
76
+ readonly capabilities: readonly [Capability.NETWORK_ACCESS, Capability.MESSAGE_SENDING];
77
+ readonly defaultState: ActionState.REQUEST_APPROVAL;
78
+ readonly approvalRequired: true;
79
+ readonly reversible: false;
80
+ readonly examples: readonly ["runShell (git push)", "runShell (npm publish)", "curl / POST to external API"];
81
+ };
82
+ readonly R4: {
83
+ readonly name: "High-Impact / Destructive / Privilege Modification";
84
+ readonly description: "File deletions, modifying secret/credential files (.env, id_rsa, .ssh), modifying system configurations.";
85
+ readonly capabilities: readonly [Capability.DELETE_FILES, Capability.SYSTEM_CONFIGURATION, Capability.ACCOUNT_ACCESS];
86
+ readonly defaultState: ActionState.REQUEST_APPROVAL;
87
+ readonly approvalRequired: true;
88
+ readonly reversible: false;
89
+ readonly examples: readonly ["deleteFile (workspace file)", "writeFile (.env)", "writeFile (~/.ssh/id_rsa)", "Remove-Item single file"];
90
+ };
91
+ readonly R5: {
92
+ readonly name: "Prohibited / Catastrophic / Critical System Damage";
93
+ readonly description: "Catastrophic destruction, recursive root/system deletions, volume format, fork bombs, encoded bypass execution, shutdown.";
94
+ readonly capabilities: readonly [Capability.EXECUTE_COMMANDS, Capability.SYSTEM_CONFIGURATION];
95
+ readonly defaultState: ActionState.DENY;
96
+ readonly approvalRequired: false;
97
+ readonly prohibited: true;
98
+ readonly reversible: false;
99
+ readonly examples: readonly ["rm -rf /", "del /s /q C:\\", "Remove-Item -Recurse -Force C:\\", "Format-Volume -DriveLetter C", "powershell -EncodedCommand ...", ":(){ :|:& };:", "shutdown /s /t 0"];
100
+ };
101
+ };
102
+ /**
103
+ * Test Corpus of Real Commands Mapped to Risk Levels & Expected Behavior
104
+ */
105
+ export declare const POLICY_TEST_CORPUS: {
106
+ command: string;
107
+ capability: Capability;
108
+ riskLevel: RiskLevel;
109
+ expectedState: ActionState;
110
+ category: string;
111
+ }[];
112
+ export interface ApprovalRequest {
113
+ id: string;
114
+ toolName: string;
115
+ capability: Capability;
116
+ riskLevel: RiskLevel;
117
+ description: string;
118
+ impact: string;
119
+ rollbackPossible: boolean;
120
+ timestamp: number;
121
+ }
122
+ export interface CchcfaiEvaluation {
123
+ actionState: ActionState;
124
+ riskLevel: RiskLevel;
125
+ capability: Capability;
126
+ allowed: boolean;
127
+ tier: ActionRiskTier;
128
+ reason?: string;
129
+ approvalRequired: boolean;
130
+ }
131
+ export interface PolicyCheckResult {
132
+ allowed: boolean;
133
+ tier: ActionRiskTier;
134
+ reason?: string;
135
+ actionState?: ActionState;
136
+ riskLevel?: RiskLevel;
137
+ }
138
+ export interface OverarchPolicyConfig {
139
+ capabilities?: Partial<Record<Capability, ActionState>>;
140
+ maxAutoApproveRisk?: RiskLevel;
141
+ safeOnly?: boolean;
142
+ customDeniedPatterns?: string[];
143
+ }
144
+ export interface PolicyOptions {
145
+ safeOnly?: boolean;
146
+ allowedTools?: string[];
147
+ deniedTools?: string[];
148
+ grantedCapabilities?: Capability[];
149
+ configPath?: string;
150
+ }
151
+ /**
152
+ * CCHCFAI Standalone Policy Engine.
153
+ * Evaluates whether an agent action falls into SAFE or DANGER tier,
154
+ * enforces strict policy boundaries and CCHCFAI action states without touching agent runtime internals.
155
+ */
156
+ export declare class PolicyEngine {
157
+ private safeOnly;
158
+ private childProcesses;
159
+ private userConfig;
160
+ private sessionApprovals;
161
+ private static instance;
162
+ private static signalHandlerRegistered;
163
+ constructor(options?: PolicyOptions);
164
+ static getInstance(options?: PolicyOptions): PolicyEngine;
165
+ setSafeOnly(safeOnly: boolean): void;
166
+ isSafeOnly(): boolean;
167
+ /**
168
+ * Load user-editable overarch.policy.json configuration.
169
+ */
170
+ loadPolicyConfigFile(customPath?: string, explicitSafeOnly?: boolean): OverarchPolicyConfig | null;
171
+ setPolicyConfig(config: OverarchPolicyConfig): void;
172
+ getPolicyConfig(): OverarchPolicyConfig | null;
173
+ /**
174
+ * Approve a tool or capability for the remainder of the active session.
175
+ */
176
+ approveForSession(toolName: string, capability?: Capability): void;
177
+ isApprovedForSession(toolName: string, capability?: Capability): boolean;
178
+ clearSessionApprovals(): void;
179
+ /**
180
+ * Decomposes potentially chained commands and checks for R5 prohibited patterns.
181
+ */
182
+ checkProhibitedCommand(rawCommand: string): {
183
+ prohibited: boolean;
184
+ pattern?: string;
185
+ segment?: string;
186
+ };
187
+ /**
188
+ * Evaluates if a given tool invocation is SAFE or DANGER.
189
+ */
190
+ classifyAction(toolName: string, params?: Record<string, any>): {
191
+ tier: ActionRiskTier;
192
+ reason?: string;
193
+ };
194
+ /**
195
+ * Maps a tool invocation to the CCHCFAI Capability taxonomy.
196
+ */
197
+ mapToolToCapability(toolName: string, params?: Record<string, any>): Capability;
198
+ /**
199
+ * Evaluates action according to CCHCFAI standards (Action State, Risk Level, Capability).
200
+ * Enforces fail-closed defaults and append-only audit logging.
201
+ */
202
+ evaluateCchcfai(toolName: string, params?: Record<string, any>): CchcfaiEvaluation;
203
+ /**
204
+ * Pre-execution policy check. Returns whether the action is permitted under current settings
205
+ * and records decision in the append-only audit log.
206
+ */
207
+ checkPolicy(toolName: string, params?: Record<string, any>): PolicyCheckResult;
208
+ /**
209
+ * Track spawned child process PID for emergency stop cleanup.
210
+ */
211
+ registerProcess(pid: number): void;
212
+ unregisterProcess(pid: number): void;
213
+ /**
214
+ * Silent emergency stop: Immediately halts all child processes and process tree cleanly.
215
+ * On Windows, uses taskkill /F /T to terminate the entire process tree.
216
+ */
217
+ terminateAllProcesses(): void;
218
+ private setupSilentEmergencyStop;
219
+ }
220
+ export declare const policyEngine: PolicyEngine;