@bolloon/bolloon-agent 0.2.12 → 0.2.13

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 (284) hide show
  1. package/README.md +495 -467
  2. package/bin/bolloon-cli.cjs +183 -183
  3. package/bin/bolloon-daemon.sh +207 -0
  4. package/bin/bolloon.cjs +0 -0
  5. package/bin/ipfs +0 -0
  6. package/dist/agents/agent-manifest-protocol.js +52 -0
  7. package/dist/agents/chat-segmenter.js +298 -0
  8. package/dist/agents/constraint-layer.js +19 -19
  9. package/dist/agents/judgment-protocol.js +479 -0
  10. package/dist/agents/parse-tool-call.js +304 -0
  11. package/dist/agents/peer-manifest-loader.js +210 -0
  12. package/dist/agents/pi-sdk-session-factory.js +110 -0
  13. package/dist/agents/pi-sdk-session-manager.js +297 -0
  14. package/dist/agents/pi-sdk-tools.js +1288 -0
  15. package/dist/agents/pi-sdk-types.js +13 -0
  16. package/dist/agents/pi-sdk.js +553 -1306
  17. package/dist/agents/react-loop.js +120 -0
  18. package/dist/agents/session-store.js +171 -0
  19. package/dist/agents/shell-guard.js +2 -2
  20. package/dist/agents/tool-registry.js +136 -0
  21. package/dist/agents/workflow-pivot-loop.js +200 -22
  22. package/dist/bollharness/src/scripts/context_router.js +7 -0
  23. package/dist/bollharness/src/scripts/deploy-guard.js +8 -8
  24. package/dist/bollharness-integration/context-router-judgment.js +4 -4
  25. package/dist/bollharness-integration/context-router.js +292 -292
  26. package/dist/bollharness-integration/gate-state-machine.js +26 -13
  27. package/dist/bollharness-integration/integration.js +71 -0
  28. package/dist/bollharness-integration/llm-judgment-engine.js +134 -134
  29. package/dist/bollharness-integration/skill-adapter.js +57 -127
  30. package/dist/bootstrap/chat-archiver.js +276 -0
  31. package/dist/bootstrap/context-collector.js +6 -3
  32. package/dist/bootstrap/event-log.js +160 -0
  33. package/dist/bootstrap/lifecycle-hooks.js +15 -1
  34. package/dist/bootstrap/memory-compressor.js +170 -0
  35. package/dist/bootstrap/persona-loader.js +94 -0
  36. package/dist/bootstrap/project-state.js +159 -0
  37. package/dist/bootstrap/remote-mirror.js +97 -0
  38. package/dist/bootstrap/session-window.js +121 -0
  39. package/dist/bootstrap/vector-index.js +248 -0
  40. package/dist/cli/loading-tui.js +40 -0
  41. package/dist/cli-entry.js +41 -37
  42. package/dist/context-compaction/auto-compact.js +7 -7
  43. package/dist/electron/config.js +21 -0
  44. package/dist/electron/config.js.map +1 -0
  45. package/dist/electron/dialogs.js +108 -0
  46. package/dist/electron/dialogs.js.map +1 -0
  47. package/dist/electron/first-run.js +170 -0
  48. package/dist/electron/first-run.js.map +1 -0
  49. package/dist/electron/ipc.js +20 -0
  50. package/dist/electron/ipc.js.map +1 -0
  51. package/dist/electron/logger.js +114 -0
  52. package/dist/electron/logger.js.map +1 -0
  53. package/dist/electron/main.js +63 -0
  54. package/dist/electron/main.js.map +1 -0
  55. package/dist/electron/menu.js +145 -0
  56. package/dist/electron/menu.js.map +1 -0
  57. package/dist/electron/paths.js +75 -0
  58. package/dist/electron/paths.js.map +1 -0
  59. package/dist/electron/server.js +119 -0
  60. package/dist/electron/server.js.map +1 -0
  61. package/dist/electron/tray.js +111 -0
  62. package/dist/electron/tray.js.map +1 -0
  63. package/dist/electron/window.js +111 -0
  64. package/dist/electron/window.js.map +1 -0
  65. package/dist/electron-preload.js +26 -6
  66. package/dist/electron-preload.js.map +1 -1
  67. package/dist/electron.js +6 -168
  68. package/dist/electron.js.map +1 -1
  69. package/dist/index.js +323 -266
  70. package/dist/llm/config-store.js +24 -8
  71. package/dist/llm/llm-judgment-client.js +102 -102
  72. package/dist/llm/pi-ai.js +137 -85
  73. package/dist/llm/system-prompt/layers/channel/local.md +14 -14
  74. package/dist/llm/system-prompt/layers/channel/p2p-agent.md +18 -18
  75. package/dist/llm/system-prompt/layers/channel/p2p-visitor.md +19 -19
  76. package/dist/llm/system-prompt/layers/core/artifacts_storage.md +89 -89
  77. package/dist/llm/system-prompt/layers/core/evenhandedness.md +21 -21
  78. package/dist/llm/system-prompt/layers/core/hibs_reminders.md +15 -15
  79. package/dist/llm/system-prompt/layers/core/identity.md +37 -37
  80. package/dist/llm/system-prompt/layers/core/knowledge.md +17 -17
  81. package/dist/llm/system-prompt/layers/core/memory_system.md +12 -12
  82. package/dist/llm/system-prompt/layers/core/network_filesystem.md +28 -28
  83. package/dist/llm/system-prompt/layers/core/refusal.md +37 -37
  84. package/dist/llm/system-prompt/layers/core/tone.md +31 -31
  85. package/dist/llm/system-prompt/layers/core/tools.thin.md +13 -13
  86. package/dist/llm/system-prompt/layers/core/wellbeing.md +41 -41
  87. package/dist/llm/system-prompt/layers/role/architect.md +20 -20
  88. package/dist/llm/system-prompt/layers/role/expert.md +19 -19
  89. package/dist/llm/system-prompt/layers/role/implementer.md +15 -15
  90. package/dist/llm/system-prompt/layers/role/security.md +15 -15
  91. package/dist/llm/system-prompt/layers/tool/artifacts.md +72 -72
  92. package/dist/llm/system-prompt/layers/tool/bash.md +25 -25
  93. package/dist/llm/system-prompt/layers/tool/hibs_api.md +171 -171
  94. package/dist/llm/system-prompt/layers/tool/image_search.md +70 -70
  95. package/dist/llm/system-prompt/layers/tool/manifest.md +89 -89
  96. package/dist/llm/system-prompt/layers/tool/mcp_apps.md +53 -53
  97. package/dist/llm/system-prompt/layers/tool/web_search.md +83 -83
  98. package/dist/llm/tool-manifest/ask_user_input.js +1 -1
  99. package/dist/llm/tool-manifest/bash.js +3 -3
  100. package/dist/llm/tool-manifest/create_file.js +4 -4
  101. package/dist/llm/tool-manifest/fetch_sports_data.js +3 -3
  102. package/dist/llm/tool-manifest/image_search.js +2 -2
  103. package/dist/llm/tool-manifest/mcp.js +2 -2
  104. package/dist/llm/tool-manifest/message_compose.js +3 -3
  105. package/dist/llm/tool-manifest/places.js +2 -2
  106. package/dist/llm/tool-manifest/present_files.js +1 -1
  107. package/dist/llm/tool-manifest/recipe.js +2 -2
  108. package/dist/llm/tool-manifest/str_replace.js +5 -5
  109. package/dist/llm/tool-manifest/view.js +3 -3
  110. package/dist/llm/tool-manifest/weather.js +4 -4
  111. package/dist/llm/tool-manifest/web.js +4 -4
  112. package/dist/network/local-inbox-bus.js +73 -0
  113. package/dist/network/p2p-outbox.js +161 -0
  114. package/dist/network/peer-fs.js +420 -0
  115. package/dist/network/peer-resource-bridge.js +216 -0
  116. package/dist/pi-ecosystem-judgment/causal-judge.js +51 -51
  117. package/dist/pi-ecosystem-judgment/cleanup.js +126 -0
  118. package/dist/pi-ecosystem-judgment/distill-prompt.js +42 -42
  119. package/dist/pi-ecosystem-judgment/distillation.js +14 -14
  120. package/dist/pi-ecosystem-judgment/human-value-store.js +45 -11
  121. package/dist/pi-ecosystem-judgment/monitor-gate.js +28 -28
  122. package/dist/pi-ecosystem-judgment/value-injection.js +102 -102
  123. package/dist/security/context-router-tool.js +15 -15
  124. package/dist/security/tool-gate.js +11 -0
  125. package/dist/web/api-config.html +520 -520
  126. package/dist/web/client-loop-status.js +220 -0
  127. package/dist/web/client.js +22 -5
  128. package/dist/web/client.js.map +7 -0
  129. package/dist/web/components/wallet-viem.mjs +118 -118
  130. package/dist/web/index.html +375 -375
  131. package/dist/web/input-validator.js +103 -0
  132. package/dist/web/manifest.json +20 -20
  133. package/dist/web/routes-judgments.js +738 -0
  134. package/dist/web/routes-llm-config.js +279 -0
  135. package/dist/web/routes-tasks.js +222 -0
  136. package/dist/web/server-sse.js +121 -0
  137. package/dist/web/server-storage.js +154 -0
  138. package/dist/web/server-types.js +15 -0
  139. package/dist/web/server-v3-p2p.js +224 -0
  140. package/dist/web/server.js +1070 -1307
  141. package/dist/web/style.css +4742 -4742
  142. package/dist/web/util/safe-name.js +32 -0
  143. package/package.json +162 -160
  144. package/scripts/build-cli.js +215 -215
  145. package/scripts/build-web.ts +130 -130
  146. package/scripts/postinstall.js +152 -152
  147. package/bin/bolloon.js +0 -157
  148. package/dist/constraint-runtime/src/_archive_helper.js +0 -9
  149. package/dist/constraint-runtime/src/agent/coordinator.js +0 -48
  150. package/dist/constraint-runtime/src/agent/index.js +0 -1
  151. package/dist/constraint-runtime/src/assistant/index.js +0 -12
  152. package/dist/constraint-runtime/src/bootstrap/index.js +0 -12
  153. package/dist/constraint-runtime/src/bootstrap_graph.js +0 -13
  154. package/dist/constraint-runtime/src/bridge/index.js +0 -12
  155. package/dist/constraint-runtime/src/buddy/index.js +0 -12
  156. package/dist/constraint-runtime/src/cli/index.js +0 -12
  157. package/dist/constraint-runtime/src/command_graph.js +0 -10
  158. package/dist/constraint-runtime/src/commands.js +0 -60
  159. package/dist/constraint-runtime/src/components/index.js +0 -12
  160. package/dist/constraint-runtime/src/constants/index.js +0 -12
  161. package/dist/constraint-runtime/src/constraint/budget.js +0 -22
  162. package/dist/constraint-runtime/src/constraint/index.js +0 -2
  163. package/dist/constraint-runtime/src/constraint/permission.js +0 -20
  164. package/dist/constraint-runtime/src/context.js +0 -30
  165. package/dist/constraint-runtime/src/coordinator/index.js +0 -12
  166. package/dist/constraint-runtime/src/cost_hook.js +0 -4
  167. package/dist/constraint-runtime/src/cost_tracker.js +0 -8
  168. package/dist/constraint-runtime/src/deferred_init.js +0 -10
  169. package/dist/constraint-runtime/src/direct_modes.js +0 -6
  170. package/dist/constraint-runtime/src/dynamic-tool-loader.js +0 -85
  171. package/dist/constraint-runtime/src/entrypoints/index.js +0 -12
  172. package/dist/constraint-runtime/src/execution_registry.js +0 -44
  173. package/dist/constraint-runtime/src/history.js +0 -9
  174. package/dist/constraint-runtime/src/hooks/index.js +0 -12
  175. package/dist/constraint-runtime/src/index.js +0 -26
  176. package/dist/constraint-runtime/src/ink.js +0 -4
  177. package/dist/constraint-runtime/src/keybindings/index.js +0 -12
  178. package/dist/constraint-runtime/src/memdir/index.js +0 -12
  179. package/dist/constraint-runtime/src/migrations/index.js +0 -12
  180. package/dist/constraint-runtime/src/models.js +0 -1
  181. package/dist/constraint-runtime/src/moreright/index.js +0 -12
  182. package/dist/constraint-runtime/src/native_ts/index.js +0 -12
  183. package/dist/constraint-runtime/src/output_styles/index.js +0 -12
  184. package/dist/constraint-runtime/src/parity_audit.js +0 -12
  185. package/dist/constraint-runtime/src/plugins/index.js +0 -12
  186. package/dist/constraint-runtime/src/port_manifest.js +0 -11
  187. package/dist/constraint-runtime/src/prefetch.js +0 -9
  188. package/dist/constraint-runtime/src/query.js +0 -1
  189. package/dist/constraint-runtime/src/remote/index.js +0 -12
  190. package/dist/constraint-runtime/src/remote_runtime.js +0 -9
  191. package/dist/constraint-runtime/src/runtime/index.js +0 -1
  192. package/dist/constraint-runtime/src/runtime/session.js +0 -35
  193. package/dist/constraint-runtime/src/schemas/index.js +0 -12
  194. package/dist/constraint-runtime/src/screens/index.js +0 -12
  195. package/dist/constraint-runtime/src/server/index.js +0 -12
  196. package/dist/constraint-runtime/src/services/index.js +0 -12
  197. package/dist/constraint-runtime/src/session_store.js +0 -22
  198. package/dist/constraint-runtime/src/setup.js +0 -30
  199. package/dist/constraint-runtime/src/skills/index.js +0 -1
  200. package/dist/constraint-runtime/src/skills/skill-registry.js +0 -28
  201. package/dist/constraint-runtime/src/state/index.js +0 -12
  202. package/dist/constraint-runtime/src/system_init.js +0 -20
  203. package/dist/constraint-runtime/src/thinking/engine.js +0 -42
  204. package/dist/constraint-runtime/src/thinking/index.js +0 -1
  205. package/dist/constraint-runtime/src/tool_pool.js +0 -8
  206. package/dist/constraint-runtime/src/tools/OpenCLI/execAdapter.js +0 -7
  207. package/dist/constraint-runtime/src/tools/OpenCLI/listAdapters.js +0 -7
  208. package/dist/constraint-runtime/src/tools/OpenCLI/runCommand.js +0 -7
  209. package/dist/constraint-runtime/src/tools/SafeSDK/confirmTransaction.js +0 -6
  210. package/dist/constraint-runtime/src/tools/SafeSDK/createTransaction.js +0 -8
  211. package/dist/constraint-runtime/src/tools/SafeSDK/executeTransaction.js +0 -6
  212. package/dist/constraint-runtime/src/tools/SafeSDK/getBalance.js +0 -6
  213. package/dist/constraint-runtime/src/tools/SafeSDK/getPendingTransactions.js +0 -6
  214. package/dist/constraint-runtime/src/tools/SafeSDK/proposeTransaction.js +0 -6
  215. package/dist/constraint-runtime/src/tools.js +0 -80
  216. package/dist/constraint-runtime/src/transcript.js +0 -19
  217. package/dist/constraint-runtime/src/types/index.js +0 -12
  218. package/dist/constraint-runtime/src/upstream_proxy/index.js +0 -12
  219. package/dist/constraint-runtime/src/utils/index.js +0 -12
  220. package/dist/constraint-runtime/src/vim/index.js +0 -12
  221. package/dist/constraint-runtime/src/voice/index.js +0 -12
  222. package/dist/constraint-runtime/tests/agent.test.js +0 -16
  223. package/dist/constraint-runtime/tests/constraint.test.js +0 -41
  224. package/dist/constraint-runtime/tests/skill.test.js +0 -19
  225. package/dist/constraint-runtime/tests/thinking.test.js +0 -22
  226. package/dist/pi-ecosystem-colony/index.js +0 -365
  227. package/dist/social/ant-colony/AdaptiveHeartbeat.js +0 -101
  228. package/dist/social/ant-colony/PheromoneEngine.js +0 -227
  229. package/dist/social/ant-colony/index.js +0 -6
  230. package/dist/social/ant-colony/types.js +0 -24
  231. package/dist/test/ai-judgment-test.js +0 -80
  232. package/dist/test/bollharness-integration.test.js +0 -318
  233. package/dist/test/channel-agent-multi-dialogue.js +0 -205
  234. package/dist/test/channel-heartbeat-agent-test.js +0 -201
  235. package/dist/test/constraint-layer.test.js +0 -164
  236. package/dist/test/diap-identity-test.js +0 -172
  237. package/dist/test/diap-quick-test.js +0 -62
  238. package/dist/test/global-shared-context.test.js +0 -315
  239. package/dist/test/harness-judgment-injection.test.js +0 -246
  240. package/dist/test/harness-workflow-integrator-test.js +0 -228
  241. package/dist/test/human-value-store.test.js +0 -243
  242. package/dist/test/hybrid-integration-test.js +0 -118
  243. package/dist/test/hybrid-messenger-verify.js +0 -55
  244. package/dist/test/iroh-bistream-debug.js +0 -38
  245. package/dist/test/iroh-communication.test.js +0 -66
  246. package/dist/test/iroh-debug-test.js +0 -57
  247. package/dist/test/iroh-diap-test.js +0 -71
  248. package/dist/test/iroh-direct-connect.js +0 -55
  249. package/dist/test/iroh-e2e-fixed.js +0 -89
  250. package/dist/test/iroh-e2e-same-process.js +0 -63
  251. package/dist/test/iroh-e2e.js +0 -66
  252. package/dist/test/iroh-final-e2e.js +0 -72
  253. package/dist/test/iroh-relay-test.js +0 -37
  254. package/dist/test/iroh-simple-test.js +0 -41
  255. package/dist/test/iroh-transport-verify.js +0 -54
  256. package/dist/test/iroh-transport.test.js +0 -37
  257. package/dist/test/iroh-two-nodes.js +0 -70
  258. package/dist/test/iroh-verify.js +0 -44
  259. package/dist/test/judgment-decision.test.js +0 -219
  260. package/dist/test/llm-judgment-integration.test.js +0 -220
  261. package/dist/test/p2p-agent-complex-dialogue.js +0 -385
  262. package/dist/test/p2p-agent-dialogue.js +0 -341
  263. package/dist/test/p2p-agent-full-bidirectional.js +0 -510
  264. package/dist/test/p2p-agent-harness-flow.js +0 -437
  265. package/dist/test/p2p-agent-harness-single.js +0 -143
  266. package/dist/test/p2p-ai-dialogue-test.js +0 -318
  267. package/dist/test/p2p-cid-connect-test.js +0 -195
  268. package/dist/test/p2p-connect-receiver.js +0 -69
  269. package/dist/test/p2p-doc-transfer.js +0 -110
  270. package/dist/test/p2p-identity-page-test.js +0 -77
  271. package/dist/test/p2p-iroh-test.js +0 -171
  272. package/dist/test/p2p-minimal-test.js +0 -241
  273. package/dist/test/p2p-node-1.js +0 -148
  274. package/dist/test/p2p-node-2.js +0 -148
  275. package/dist/test/p2p-server.js +0 -281
  276. package/dist/test/p2p-two-nodes-test.js +0 -438
  277. package/dist/test/pi-sdk.test.js +0 -44
  278. package/dist/test/set-persona.js +0 -40
  279. package/dist/test/simple.test.js +0 -9
  280. package/dist/test/storage-integration.test.js +0 -150
  281. package/dist/test/subagent-manager.test.js +0 -276
  282. package/dist/test/test-gate-flow.test.js +0 -81
  283. package/dist/test/workflow-engine.test.js +0 -87
  284. package/dist/test/workflow-pivot-loop.test.js +0 -246
@@ -1,44 +0,0 @@
1
- import { PORTED_COMMANDS, executeCommand } from './commands.js';
2
- import { PORTED_TOOLS, executeTool } from './tools.js';
3
- export class MirroredCommand {
4
- name;
5
- sourceHint;
6
- constructor(name, sourceHint) {
7
- this.name = name;
8
- this.sourceHint = sourceHint;
9
- }
10
- execute(prompt) {
11
- return executeCommand(this.name, prompt).message;
12
- }
13
- }
14
- export class MirroredTool {
15
- name;
16
- sourceHint;
17
- constructor(name, sourceHint) {
18
- this.name = name;
19
- this.sourceHint = sourceHint;
20
- }
21
- async execute(payload) {
22
- const result = await executeTool(this.name, payload);
23
- return result.message;
24
- }
25
- }
26
- export class ExecutionRegistry {
27
- commands;
28
- tools;
29
- constructor(commands, tools) {
30
- this.commands = commands;
31
- this.tools = tools;
32
- }
33
- command(name) {
34
- const lowered = name.toLowerCase();
35
- return this.commands.find(c => c.name.toLowerCase() === lowered);
36
- }
37
- tool(name) {
38
- const lowered = name.toLowerCase();
39
- return this.tools.find(t => t.name.toLowerCase() === lowered);
40
- }
41
- }
42
- export function buildExecutionRegistry() {
43
- return new ExecutionRegistry(PORTED_COMMANDS.map(m => new MirroredCommand(m.name, m.sourceHint)), PORTED_TOOLS.map(m => new MirroredTool(m.name, m.sourceHint)));
44
- }
@@ -1,9 +0,0 @@
1
- export class HistoryLog {
2
- events = [];
3
- add(title, detail) {
4
- this.events.push({ title, detail });
5
- }
6
- asMarkdown() {
7
- return ['# Session History', '', ...this.events.map(e => `- ${e.title}: ${e.detail}`)].join('\n');
8
- }
9
- }
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('hooks');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,26 +0,0 @@
1
- export * from './constraint/index.js';
2
- export * from './thinking/index.js';
3
- export * from './agent/index.js';
4
- export * from './skills/index.js';
5
- export * from './runtime/index.js';
6
- export { ToolPermissionContext } from './constraint/permission.js';
7
- export { BudgetTracker } from './constraint/budget.js';
8
- export { DeepThinkingEngine } from './thinking/engine.js';
9
- export { AgentCoordinator } from './agent/coordinator.js';
10
- export { SkillRegistry } from './skills/skill-registry.js';
11
- export { Session } from './runtime/session.js';
12
- export * from './models.js';
13
- export { HistoryLog } from './history.js';
14
- export { TranscriptStore } from './transcript.js';
15
- export { CostTracker } from './cost_tracker.js';
16
- export { buildSetup, runSetup } from './setup.js';
17
- export { buildPortContext } from './context.js';
18
- export { buildCommandGraph } from './command_graph.js';
19
- export { buildBootstrapGraph } from './bootstrap_graph.js';
20
- export { runParityAudit } from './parity_audit.js';
21
- export { runRemoteMode, runSshMode, runTeleportMode } from './remote_runtime.js';
22
- export { runDirectConnect, runDeepLink } from './direct_modes.js';
23
- export { assembleToolPool } from './tool_pool.js';
24
- export { saveSession, loadSession } from './session_store.js';
25
- export const VERSION = '0.1.0';
26
- export const NAME = '@bolloon/constraint-runtime';
@@ -1,4 +0,0 @@
1
- export function renderMarkdownPanel(text) {
2
- const border = '='.repeat(40);
3
- return `${border}\n${text}\n${border}`;
4
- }
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('keybindings');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('memdir');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('migrations');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('moreright');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('native_ts');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('outputstyles');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,12 +0,0 @@
1
- export function runParityAudit() {
2
- return {
3
- archivePresent: false,
4
- rootFileCoverage: [0, 0],
5
- directoryCoverage: [0, 0],
6
- totalFileRatio: [0, 0],
7
- commandEntryRatio: [0, 0],
8
- toolEntryRatio: [0, 0],
9
- missingRootTargets: [],
10
- missingDirectoryTargets: [],
11
- };
12
- }
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('plugins');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,11 +0,0 @@
1
- import * as path from 'path';
2
- import { fileURLToPath } from 'url';
3
- const __filename = fileURLToPath(import.meta.url);
4
- const __dirname = path.dirname(__filename);
5
- export function buildPortManifest(srcRoot) {
6
- return {
7
- srcRoot: srcRoot || __dirname,
8
- totalPythonFiles: 0,
9
- topLevelModules: [],
10
- };
11
- }
@@ -1,9 +0,0 @@
1
- export function startMdmRawRead() {
2
- return { name: 'mdm_raw_read', started: true, detail: 'Simulated MDM raw-read prefetch for workspace bootstrap' };
3
- }
4
- export function startKeychainPrefetch() {
5
- return { name: 'keychain_prefetch', started: true, detail: 'Simulated keychain prefetch for trusted startup path' };
6
- }
7
- export function startProjectScan(root) {
8
- return { name: 'project_scan', started: true, detail: `Scanned project root ${root}` };
9
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('remote');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,9 +0,0 @@
1
- export function runRemoteMode(target) {
2
- return { mode: 'remote', connected: true, detail: `Remote control placeholder prepared for ${target}` };
3
- }
4
- export function runSshMode(target) {
5
- return { mode: 'ssh', connected: true, detail: `SSH proxy placeholder prepared for ${target}` };
6
- }
7
- export function runTeleportMode(target) {
8
- return { mode: 'teleport', connected: true, detail: `Teleport resume/create placeholder prepared for ${target}` };
9
- }
@@ -1 +0,0 @@
1
- export { Session } from './session.js';
@@ -1,35 +0,0 @@
1
- import { ToolPermissionContext } from '../constraint/permission.js';
2
- import { BudgetTracker } from '../constraint/budget.js';
3
- export class Session {
4
- sessionId;
5
- messages;
6
- context;
7
- turnCount;
8
- permissionContext;
9
- budget;
10
- constructor(sessionId, messages = [], context = {}, turnCount = 0, permissionContext = ToolPermissionContext.fromIterables(), budget = new BudgetTracker()) {
11
- this.sessionId = sessionId;
12
- this.messages = messages;
13
- this.context = context;
14
- this.turnCount = turnCount;
15
- this.permissionContext = permissionContext;
16
- this.budget = budget;
17
- }
18
- addMessage(msg) {
19
- this.messages.push(msg);
20
- this.turnCount++;
21
- }
22
- get history() {
23
- return [...this.messages];
24
- }
25
- clear() {
26
- this.messages = [];
27
- this.turnCount = 0;
28
- }
29
- setContext(key, value) {
30
- this.context[key] = value;
31
- }
32
- getContext(key) {
33
- return this.context[key];
34
- }
35
- }
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('schemas');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('screens');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('server');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('services');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,22 +0,0 @@
1
- import * as fs from 'fs';
2
- import * as path from 'path';
3
- const SESSION_DIR = '.port_sessions';
4
- export function saveSession(session) {
5
- const targetDir = path.join(process.cwd(), SESSION_DIR);
6
- if (!fs.existsSync(targetDir)) {
7
- fs.mkdirSync(targetDir, { recursive: true });
8
- }
9
- const filePath = path.join(targetDir, `${session.sessionId}.json`);
10
- fs.writeFileSync(filePath, JSON.stringify(session, null, 2));
11
- return filePath;
12
- }
13
- export function loadSession(sessionId) {
14
- const filePath = path.join(process.cwd(), SESSION_DIR, `${sessionId}.json`);
15
- const data = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
16
- return {
17
- sessionId: data.sessionId,
18
- messages: data.messages,
19
- inputTokens: data.inputTokens,
20
- outputTokens: data.outputTokens,
21
- };
22
- }
@@ -1,30 +0,0 @@
1
- import * as platform from 'platform';
2
- import { runDeferredInit } from './deferred_init.js';
3
- import { startMdmRawRead, startKeychainPrefetch, startProjectScan } from './prefetch.js';
4
- export function buildWorkspaceSetup() {
5
- return {
6
- pythonVersion: `${platform.version}`,
7
- implementation: platform.name || 'unknown',
8
- platformName: platform.os?.toString() || 'unknown',
9
- testCommand: 'npm test',
10
- startupSteps: [
11
- 'start top-level prefetch side effects',
12
- 'build workspace context',
13
- 'load mirrored command snapshot',
14
- 'load mirrored tool snapshot',
15
- 'prepare parity audit hooks',
16
- 'apply trust-gated deferred init',
17
- ],
18
- };
19
- }
20
- export function runSetup(cwd, trusted = true) {
21
- const root = cwd || process.cwd();
22
- return {
23
- setup: buildWorkspaceSetup(),
24
- prefetches: [startMdmRawRead(), startKeychainPrefetch(), startProjectScan(root)],
25
- deferredInit: runDeferredInit(trusted),
26
- trusted,
27
- cwd: root,
28
- };
29
- }
30
- export { buildWorkspaceSetup as buildSetup };
@@ -1 +0,0 @@
1
- export { SkillRegistry } from './skill-registry.js';
@@ -1,28 +0,0 @@
1
- export class SkillRegistry {
2
- skills = new Map();
3
- register(skill) {
4
- if (this.skills.has(skill.name)) {
5
- throw new Error(`Skill already registered: ${skill.name}`);
6
- }
7
- this.skills.set(skill.name, skill);
8
- }
9
- unregister(name) {
10
- return this.skills.delete(name);
11
- }
12
- get(name) {
13
- return this.skills.get(name);
14
- }
15
- list() {
16
- return Array.from(this.skills.values());
17
- }
18
- has(name) {
19
- return this.skills.has(name);
20
- }
21
- async execute(name, params) {
22
- const skill = this.skills.get(name);
23
- if (!skill) {
24
- throw new Error(`Skill not found: ${name}`);
25
- }
26
- return skill.execute(params);
27
- }
28
- }
@@ -1,12 +0,0 @@
1
- import { loadArchiveMetadata } from '../_archive_helper.js';
2
- const SNAPSHOT = loadArchiveMetadata('state');
3
- export const ARCHIVE_NAME = SNAPSHOT['archive_name'];
4
- export const MODULE_COUNT = SNAPSHOT['module_count'];
5
- export const SAMPLE_FILES = SNAPSHOT['sample_files'];
6
- export const PORTING_NOTE = `Python placeholder package for '${ARCHIVE_NAME}' with ${MODULE_COUNT} archived module references.`;
7
- export default {
8
- ARCHIVE_NAME,
9
- MODULE_COUNT,
10
- PORTING_NOTE,
11
- SAMPLE_FILES,
12
- };
@@ -1,20 +0,0 @@
1
- import { getCommands, builtInCommandNames } from './commands.js';
2
- import { getTools } from './tools.js';
3
- import { runSetup } from './setup.js';
4
- export function buildSystemInitMessage(trusted = true) {
5
- const setup = runSetup(undefined, trusted);
6
- const commands = getCommands();
7
- const tools = getTools();
8
- const lines = [
9
- '# System Init',
10
- '',
11
- `Trusted: ${setup.trusted}`,
12
- `Built-in command names: ${builtInCommandNames().size}`,
13
- `Loaded command entries: ${commands.length}`,
14
- `Loaded tool entries: ${tools.length}`,
15
- '',
16
- 'Startup steps:',
17
- ...setup.setup.startupSteps.map(step => `- ${step}`),
18
- ];
19
- return lines.join('\n');
20
- }
@@ -1,42 +0,0 @@
1
- export class DeepThinkingEngine {
2
- maxDepth;
3
- constructor(maxDepth = 3) {
4
- this.maxDepth = maxDepth;
5
- }
6
- async think(prompt) {
7
- const steps = [];
8
- let current = prompt;
9
- for (let i = 0; i < this.maxDepth; i++) {
10
- const thought = await this.generateThought(current, i);
11
- const reflection = await this.reflect(thought, current, i);
12
- steps.push({
13
- step: i + 1,
14
- thought,
15
- reflection: reflection.question,
16
- improvement: reflection.improvement
17
- });
18
- if (reflection.improvement) {
19
- current = reflection.improvement;
20
- }
21
- }
22
- return {
23
- originalPrompt: prompt,
24
- steps,
25
- finalOutput: steps[steps.length - 1]?.improvement ?? current,
26
- depth: this.maxDepth
27
- };
28
- }
29
- async generateThought(prompt, step) {
30
- return `[Step ${step + 1}] Analysis of: ${prompt}`;
31
- }
32
- async reflect(thought, original, step) {
33
- const isLastStep = step === this.maxDepth - 1;
34
- return {
35
- question: `Review: Is "${thought}" comprehensive and accurate?`,
36
- improvement: isLastStep ? undefined : `${thought} (refined)`
37
- };
38
- }
39
- setDepth(depth) {
40
- this.maxDepth = Math.max(1, Math.min(depth, 10));
41
- }
42
- }
@@ -1 +0,0 @@
1
- export { DeepThinkingEngine } from './engine.js';
@@ -1,8 +0,0 @@
1
- import { getTools } from './tools.js';
2
- export function assembleToolPool(simpleMode = false, includeMcp = true, permissionContext) {
3
- return {
4
- tools: getTools(simpleMode),
5
- simpleMode,
6
- includeMcp,
7
- };
8
- }
@@ -1,7 +0,0 @@
1
- export async function execAdapter(params) {
2
- return {
3
- success: false,
4
- result: null,
5
- error: `OpenCLI adapter '${params.adapter}' requires OpenCLI CLI to be installed and configured.`,
6
- };
7
- }
@@ -1,7 +0,0 @@
1
- export async function listAdapters() {
2
- return [
3
- { name: 'twitter', description: 'Twitter/X adapter' },
4
- { name: 'reddit', description: 'Reddit adapter' },
5
- { name: 'bilibili', description: 'Bilibili adapter' },
6
- ];
7
- }
@@ -1,7 +0,0 @@
1
- export async function runCommand(params) {
2
- return {
3
- success: false,
4
- output: '',
5
- error: 'OpenCLI is a command-line tool and should be invoked via shell command: opencli <command>',
6
- };
7
- }
@@ -1,6 +0,0 @@
1
- export async function confirmTransaction(params) {
2
- return {
3
- success: false,
4
- message: 'Safe transaction confirmation requires protocol kit with signer configured.',
5
- };
6
- }
@@ -1,8 +0,0 @@
1
- export async function createTransaction(params) {
2
- return {
3
- to: params.to,
4
- value: params.value,
5
- data: params.data,
6
- operation: params.operation ?? 0,
7
- };
8
- }
@@ -1,6 +0,0 @@
1
- export async function executeTransaction(params) {
2
- return {
3
- success: false,
4
- message: 'Safe transaction execution requires protocol kit with executor and signer configured.',
5
- };
6
- }
@@ -1,6 +0,0 @@
1
- export async function getBalance(params) {
2
- return {
3
- balance: '0',
4
- message: 'Balance retrieval requires protocol kit with RPC provider configured.',
5
- };
6
- }
@@ -1,6 +0,0 @@
1
- export async function getPendingTransactions(params) {
2
- return {
3
- transactions: [],
4
- message: 'Pending transaction retrieval requires Safe API Kit with transaction service URL configured.',
5
- };
6
- }
@@ -1,6 +0,0 @@
1
- export async function proposeSafeTransaction(params) {
2
- return {
3
- success: false,
4
- message: 'Safe transaction proposal requires Safe API Kit with transaction service URL configured.',
5
- };
6
- }