@bolloon/bolloon-agent 0.2.8 → 0.2.10
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 +467 -467
- package/bin/bolloon-cli.cjs +183 -183
- package/bin/bolloon.cjs +0 -0
- package/bin/bolloon.js +157 -0
- package/dist/agents/agent-manifest-protocol.js +0 -52
- package/dist/agents/constraint-layer.js +19 -19
- package/dist/agents/pi-sdk.js +287 -1213
- package/dist/agents/shell-guard.js +2 -2
- package/dist/agents/workflow-pivot-loop.js +2 -81
- package/dist/bollharness/src/scripts/deploy-guard.js +8 -8
- package/dist/bollharness-integration/context-router-judgment.js +4 -4
- package/dist/bollharness-integration/context-router.js +292 -292
- package/dist/bollharness-integration/gate-state-machine.js +13 -26
- package/dist/bollharness-integration/integration.js +0 -71
- package/dist/bollharness-integration/llm-judgment-engine.js +134 -134
- package/dist/bollharness-integration/skill-adapter.js +127 -52
- package/dist/bootstrap/context-collector.js +3 -6
- package/dist/bootstrap/lifecycle-hooks.js +1 -15
- package/dist/cli-entry.js +35 -39
- package/dist/constraint-runtime/src/_archive_helper.js +9 -0
- package/dist/constraint-runtime/src/agent/coordinator.js +48 -0
- package/dist/constraint-runtime/src/agent/index.js +1 -0
- package/dist/constraint-runtime/src/assistant/index.js +12 -0
- package/dist/constraint-runtime/src/bootstrap/index.js +12 -0
- package/dist/constraint-runtime/src/bootstrap_graph.js +13 -0
- package/dist/constraint-runtime/src/bridge/index.js +12 -0
- package/dist/constraint-runtime/src/buddy/index.js +12 -0
- package/dist/constraint-runtime/src/cli/index.js +12 -0
- package/dist/constraint-runtime/src/command_graph.js +10 -0
- package/dist/constraint-runtime/src/commands.js +60 -0
- package/dist/constraint-runtime/src/components/index.js +12 -0
- package/dist/constraint-runtime/src/constants/index.js +12 -0
- package/dist/constraint-runtime/src/constraint/budget.js +22 -0
- package/dist/constraint-runtime/src/constraint/index.js +2 -0
- package/dist/constraint-runtime/src/constraint/permission.js +20 -0
- package/dist/constraint-runtime/src/context.js +30 -0
- package/dist/constraint-runtime/src/coordinator/index.js +12 -0
- package/dist/constraint-runtime/src/cost_hook.js +4 -0
- package/dist/constraint-runtime/src/cost_tracker.js +8 -0
- package/dist/constraint-runtime/src/deferred_init.js +10 -0
- package/dist/constraint-runtime/src/direct_modes.js +6 -0
- package/dist/constraint-runtime/src/dynamic-tool-loader.js +85 -0
- package/dist/constraint-runtime/src/entrypoints/index.js +12 -0
- package/dist/constraint-runtime/src/execution_registry.js +44 -0
- package/dist/constraint-runtime/src/history.js +9 -0
- package/dist/constraint-runtime/src/hooks/index.js +12 -0
- package/dist/constraint-runtime/src/index.js +26 -0
- package/dist/constraint-runtime/src/ink.js +4 -0
- package/dist/constraint-runtime/src/keybindings/index.js +12 -0
- package/dist/constraint-runtime/src/memdir/index.js +12 -0
- package/dist/constraint-runtime/src/migrations/index.js +12 -0
- package/dist/constraint-runtime/src/models.js +1 -0
- package/dist/constraint-runtime/src/moreright/index.js +12 -0
- package/dist/constraint-runtime/src/native_ts/index.js +12 -0
- package/dist/constraint-runtime/src/output_styles/index.js +12 -0
- package/dist/constraint-runtime/src/parity_audit.js +12 -0
- package/dist/constraint-runtime/src/plugins/index.js +12 -0
- package/dist/constraint-runtime/src/port_manifest.js +11 -0
- package/dist/constraint-runtime/src/prefetch.js +9 -0
- package/dist/constraint-runtime/src/query.js +1 -0
- package/dist/constraint-runtime/src/remote/index.js +12 -0
- package/dist/constraint-runtime/src/remote_runtime.js +9 -0
- package/dist/constraint-runtime/src/runtime/index.js +1 -0
- package/dist/constraint-runtime/src/runtime/session.js +35 -0
- package/dist/constraint-runtime/src/schemas/index.js +12 -0
- package/dist/constraint-runtime/src/screens/index.js +12 -0
- package/dist/constraint-runtime/src/server/index.js +12 -0
- package/dist/constraint-runtime/src/services/index.js +12 -0
- package/dist/constraint-runtime/src/session_store.js +22 -0
- package/dist/constraint-runtime/src/setup.js +30 -0
- package/dist/constraint-runtime/src/skills/index.js +1 -0
- package/dist/constraint-runtime/src/skills/skill-registry.js +28 -0
- package/dist/constraint-runtime/src/state/index.js +12 -0
- package/dist/constraint-runtime/src/system_init.js +20 -0
- package/dist/constraint-runtime/src/thinking/engine.js +42 -0
- package/dist/constraint-runtime/src/thinking/index.js +1 -0
- package/dist/constraint-runtime/src/tool_pool.js +8 -0
- package/dist/constraint-runtime/src/tools/OpenCLI/execAdapter.js +7 -0
- package/dist/constraint-runtime/src/tools/OpenCLI/listAdapters.js +7 -0
- package/dist/constraint-runtime/src/tools/OpenCLI/runCommand.js +7 -0
- package/dist/constraint-runtime/src/tools/SafeSDK/confirmTransaction.js +6 -0
- package/dist/constraint-runtime/src/tools/SafeSDK/createTransaction.js +8 -0
- package/dist/constraint-runtime/src/tools/SafeSDK/executeTransaction.js +6 -0
- package/dist/constraint-runtime/src/tools/SafeSDK/getBalance.js +6 -0
- package/dist/constraint-runtime/src/tools/SafeSDK/getPendingTransactions.js +6 -0
- package/dist/constraint-runtime/src/tools/SafeSDK/proposeTransaction.js +6 -0
- package/dist/constraint-runtime/src/tools.js +80 -0
- package/dist/constraint-runtime/src/transcript.js +19 -0
- package/dist/constraint-runtime/src/types/index.js +12 -0
- package/dist/constraint-runtime/src/upstream_proxy/index.js +12 -0
- package/dist/constraint-runtime/src/utils/index.js +12 -0
- package/dist/constraint-runtime/src/vim/index.js +12 -0
- package/dist/constraint-runtime/src/voice/index.js +12 -0
- package/dist/constraint-runtime/tests/agent.test.js +16 -0
- package/dist/constraint-runtime/tests/constraint.test.js +41 -0
- package/dist/constraint-runtime/tests/skill.test.js +19 -0
- package/dist/constraint-runtime/tests/thinking.test.js +22 -0
- package/dist/context-compaction/auto-compact.js +7 -7
- package/dist/electron-preload.js +1 -18
- package/dist/electron-preload.js.map +1 -1
- package/dist/electron.js +168 -3
- package/dist/electron.js.map +1 -1
- package/dist/index.js +116 -136
- package/dist/llm/config-store.js +8 -24
- package/dist/llm/llm-judgment-client.js +102 -102
- package/dist/llm/pi-ai.js +85 -126
- package/dist/llm/system-prompt/layers/channel/local.md +14 -14
- package/dist/llm/system-prompt/layers/channel/p2p-agent.md +18 -18
- package/dist/llm/system-prompt/layers/channel/p2p-visitor.md +19 -19
- package/dist/llm/system-prompt/layers/core/artifacts_storage.md +89 -89
- package/dist/llm/system-prompt/layers/core/evenhandedness.md +21 -21
- package/dist/llm/system-prompt/layers/core/hibs_reminders.md +15 -15
- package/dist/llm/system-prompt/layers/core/identity.md +37 -37
- package/dist/llm/system-prompt/layers/core/knowledge.md +17 -17
- package/dist/llm/system-prompt/layers/core/memory_system.md +12 -12
- package/dist/llm/system-prompt/layers/core/network_filesystem.md +28 -28
- package/dist/llm/system-prompt/layers/core/refusal.md +37 -37
- package/dist/llm/system-prompt/layers/core/tone.md +31 -31
- package/dist/llm/system-prompt/layers/core/tools.thin.md +13 -13
- package/dist/llm/system-prompt/layers/core/wellbeing.md +41 -41
- package/dist/llm/system-prompt/layers/role/architect.md +20 -20
- package/dist/llm/system-prompt/layers/role/expert.md +19 -19
- package/dist/llm/system-prompt/layers/role/implementer.md +15 -15
- package/dist/llm/system-prompt/layers/role/security.md +15 -15
- package/dist/llm/system-prompt/layers/tool/artifacts.md +72 -72
- package/dist/llm/system-prompt/layers/tool/bash.md +25 -25
- package/dist/llm/system-prompt/layers/tool/hibs_api.md +171 -171
- package/dist/llm/system-prompt/layers/tool/image_search.md +70 -70
- package/dist/llm/system-prompt/layers/tool/manifest.md +89 -89
- package/dist/llm/system-prompt/layers/tool/mcp_apps.md +53 -53
- package/dist/llm/system-prompt/layers/tool/web_search.md +83 -83
- package/dist/llm/tool-manifest/ask_user_input.js +1 -1
- package/dist/llm/tool-manifest/bash.js +3 -3
- package/dist/llm/tool-manifest/create_file.js +4 -4
- package/dist/llm/tool-manifest/fetch_sports_data.js +3 -3
- package/dist/llm/tool-manifest/image_search.js +2 -2
- package/dist/llm/tool-manifest/mcp.js +2 -2
- package/dist/llm/tool-manifest/message_compose.js +3 -3
- package/dist/llm/tool-manifest/places.js +2 -2
- package/dist/llm/tool-manifest/present_files.js +1 -1
- package/dist/llm/tool-manifest/recipe.js +2 -2
- package/dist/llm/tool-manifest/str_replace.js +5 -5
- package/dist/llm/tool-manifest/view.js +3 -3
- package/dist/llm/tool-manifest/weather.js +4 -4
- package/dist/llm/tool-manifest/web.js +4 -4
- package/dist/pi-ecosystem-colony/index.js +365 -0
- package/dist/pi-ecosystem-judgment/causal-judge.js +51 -51
- package/dist/pi-ecosystem-judgment/distill-prompt.js +42 -42
- package/dist/pi-ecosystem-judgment/distillation.js +14 -14
- package/dist/pi-ecosystem-judgment/monitor-gate.js +28 -28
- package/dist/pi-ecosystem-judgment/value-injection.js +102 -102
- package/dist/security/context-router-tool.js +15 -15
- package/dist/security/tool-gate.js +0 -11
- package/dist/social/ant-colony/AdaptiveHeartbeat.js +101 -0
- package/dist/social/ant-colony/PheromoneEngine.js +227 -0
- package/dist/social/ant-colony/index.js +6 -0
- package/dist/social/ant-colony/types.js +24 -0
- package/dist/test/ai-judgment-test.js +80 -0
- package/dist/test/bollharness-integration.test.js +318 -0
- package/dist/test/channel-agent-multi-dialogue.js +205 -0
- package/dist/test/channel-heartbeat-agent-test.js +201 -0
- package/dist/test/constraint-layer.test.js +164 -0
- package/dist/test/diap-identity-test.js +172 -0
- package/dist/test/diap-quick-test.js +62 -0
- package/dist/test/global-shared-context.test.js +315 -0
- package/dist/test/harness-judgment-injection.test.js +246 -0
- package/dist/test/harness-workflow-integrator-test.js +228 -0
- package/dist/test/human-value-store.test.js +243 -0
- package/dist/test/hybrid-integration-test.js +118 -0
- package/dist/test/hybrid-messenger-verify.js +55 -0
- package/dist/test/iroh-bistream-debug.js +38 -0
- package/dist/test/iroh-communication.test.js +66 -0
- package/dist/test/iroh-debug-test.js +57 -0
- package/dist/test/iroh-diap-test.js +71 -0
- package/dist/test/iroh-direct-connect.js +55 -0
- package/dist/test/iroh-e2e-fixed.js +89 -0
- package/dist/test/iroh-e2e-same-process.js +63 -0
- package/dist/test/iroh-e2e.js +66 -0
- package/dist/test/iroh-final-e2e.js +72 -0
- package/dist/test/iroh-relay-test.js +37 -0
- package/dist/test/iroh-simple-test.js +41 -0
- package/dist/test/iroh-transport-verify.js +54 -0
- package/dist/test/iroh-transport.test.js +37 -0
- package/dist/test/iroh-two-nodes.js +70 -0
- package/dist/test/iroh-verify.js +44 -0
- package/dist/test/judgment-decision.test.js +219 -0
- package/dist/test/llm-judgment-integration.test.js +220 -0
- package/dist/test/p2p-agent-complex-dialogue.js +385 -0
- package/dist/test/p2p-agent-dialogue.js +341 -0
- package/dist/test/p2p-agent-full-bidirectional.js +510 -0
- package/dist/test/p2p-agent-harness-flow.js +437 -0
- package/dist/test/p2p-agent-harness-single.js +143 -0
- package/dist/test/p2p-ai-dialogue-test.js +318 -0
- package/dist/test/p2p-cid-connect-test.js +195 -0
- package/dist/test/p2p-connect-receiver.js +69 -0
- package/dist/test/p2p-doc-transfer.js +110 -0
- package/dist/test/p2p-identity-page-test.js +77 -0
- package/dist/test/p2p-iroh-test.js +171 -0
- package/dist/test/p2p-minimal-test.js +241 -0
- package/dist/test/p2p-node-1.js +148 -0
- package/dist/test/p2p-node-2.js +148 -0
- package/dist/test/p2p-server.js +281 -0
- package/dist/test/p2p-two-nodes-test.js +438 -0
- package/dist/test/pi-sdk.test.js +44 -0
- package/dist/test/set-persona.js +40 -0
- package/dist/test/simple.test.js +9 -0
- package/dist/test/storage-integration.test.js +150 -0
- package/dist/test/subagent-manager.test.js +276 -0
- package/dist/test/test-gate-flow.test.js +81 -0
- package/dist/test/workflow-engine.test.js +87 -0
- package/dist/test/workflow-pivot-loop.test.js +246 -0
- package/dist/web/api-config.html +520 -520
- package/dist/web/client.js +2917 -3791
- package/dist/web/components/p2p/index.js +234 -276
- package/dist/web/components/wallet-viem.mjs +118 -118
- package/dist/web/index.html +374 -373
- package/dist/web/manifest.json +20 -20
- package/dist/web/server.js +23 -775
- package/dist/web/style.css +4737 -4737
- package/dist/web/ui/message-renderer.js +373 -451
- package/dist/web/ui/step-timeline.js +255 -351
- package/package.json +160 -157
- package/scripts/build-cli.js +216 -0
- package/scripts/build-web.ts +125 -0
- package/scripts/postinstall.js +153 -0
- package/bin/bolloon-daemon.sh +0 -207
- package/bin/ipfs +0 -0
- package/dist/agents/chat-segmenter.js +0 -298
- package/dist/agents/judgment-protocol.js +0 -479
- package/dist/agents/parse-tool-call.js +0 -304
- package/dist/agents/peer-manifest-loader.js +0 -210
- package/dist/agents/react-loop.js +0 -120
- package/dist/agents/session-store.js +0 -171
- package/dist/agents/tool-registry.js +0 -136
- package/dist/bootstrap/chat-archiver.js +0 -276
- package/dist/bootstrap/memory-compressor.js +0 -170
- package/dist/bootstrap/persona-loader.js +0 -94
- package/dist/electron/config.js +0 -16
- package/dist/electron/config.js.map +0 -1
- package/dist/electron/dialogs.js +0 -71
- package/dist/electron/dialogs.js.map +0 -1
- package/dist/electron/first-run.js +0 -129
- package/dist/electron/first-run.js.map +0 -1
- package/dist/electron/ipc.js +0 -16
- package/dist/electron/ipc.js.map +0 -1
- package/dist/electron/logger.js +0 -77
- package/dist/electron/logger.js.map +0 -1
- package/dist/electron/main.js +0 -60
- package/dist/electron/main.js.map +0 -1
- package/dist/electron/menu.js +0 -140
- package/dist/electron/menu.js.map +0 -1
- package/dist/electron/paths.js +0 -33
- package/dist/electron/paths.js.map +0 -1
- package/dist/electron/server.js +0 -74
- package/dist/electron/server.js.map +0 -1
- package/dist/electron/tray.js +0 -73
- package/dist/electron/tray.js.map +0 -1
- package/dist/electron/window.js +0 -69
- package/dist/electron/window.js.map +0 -1
- package/dist/network/local-inbox-bus.js +0 -73
- package/dist/network/p2p-outbox.js +0 -161
- package/dist/network/peer-fs.js +0 -420
- package/dist/network/peer-resource-bridge.js +0 -216
- package/dist/web/components/p2p/P2PModal.js +0 -188
- package/dist/web/components/p2p/p2p-modal.js +0 -664
- package/dist/web/components/p2p/p2p-tools.js +0 -248
- package/dist/web/input-validator.js +0 -103
- package/dist/web/util/safe-name.js +0 -32
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
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';
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Session } from './session.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SkillRegistry } from './skill-registry.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeepThinkingEngine } from './engine.js';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { executeToolFromSnapshot } from './dynamic-tool-loader.js';
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
const SNAPSHOT_PATH = path.join(__dirname, 'reference_data', 'tools_snapshot.json');
|
|
8
|
+
function loadToolSnapshot() {
|
|
9
|
+
try {
|
|
10
|
+
if (!fs.existsSync(SNAPSHOT_PATH)) {
|
|
11
|
+
console.warn(`[tools] Snapshot not found: ${SNAPSHOT_PATH}, using empty list`);
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const raw = JSON.parse(fs.readFileSync(SNAPSHOT_PATH, 'utf-8'));
|
|
15
|
+
return raw.map((e) => ({
|
|
16
|
+
name: e.name,
|
|
17
|
+
responsibility: e.responsibility,
|
|
18
|
+
sourceHint: e.source_hint,
|
|
19
|
+
status: 'mirrored',
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.warn(`[tools] Failed to load snapshot: ${error}, using empty list`);
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export const PORTED_TOOLS = loadToolSnapshot();
|
|
28
|
+
export function getTool(name) {
|
|
29
|
+
const needle = name.toLowerCase();
|
|
30
|
+
return PORTED_TOOLS.find(m => m.name.toLowerCase() === needle);
|
|
31
|
+
}
|
|
32
|
+
export function getTools(simpleMode = false) {
|
|
33
|
+
let tools = [...PORTED_TOOLS];
|
|
34
|
+
if (simpleMode) {
|
|
35
|
+
tools = tools.filter(m => ['BashTool', 'FileReadTool', 'FileEditTool'].includes(m.name));
|
|
36
|
+
}
|
|
37
|
+
return tools;
|
|
38
|
+
}
|
|
39
|
+
export function findTools(query, limit = 20) {
|
|
40
|
+
const needle = query.toLowerCase();
|
|
41
|
+
return PORTED_TOOLS.filter(m => m.name.toLowerCase().includes(needle) || m.sourceHint.toLowerCase().includes(needle)).slice(0, limit);
|
|
42
|
+
}
|
|
43
|
+
export async function executeTool(name, payload = '') {
|
|
44
|
+
const module = getTool(name);
|
|
45
|
+
if (!module) {
|
|
46
|
+
return { name, sourceHint: '', payload, handled: false, message: `Unknown mirrored tool: ${name}` };
|
|
47
|
+
}
|
|
48
|
+
let params = {};
|
|
49
|
+
try {
|
|
50
|
+
params = payload ? JSON.parse(payload) : {};
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return {
|
|
54
|
+
name: module.name,
|
|
55
|
+
sourceHint: module.sourceHint,
|
|
56
|
+
payload,
|
|
57
|
+
handled: false,
|
|
58
|
+
message: `Invalid JSON payload for tool '${module.name}'`,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const result = await executeToolFromSnapshot(module.sourceHint, params);
|
|
62
|
+
if (result.success) {
|
|
63
|
+
return {
|
|
64
|
+
name: module.name,
|
|
65
|
+
sourceHint: module.sourceHint,
|
|
66
|
+
payload: JSON.stringify(result.data),
|
|
67
|
+
handled: true,
|
|
68
|
+
message: `Tool '${module.name}' executed successfully`,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return {
|
|
73
|
+
name: module.name,
|
|
74
|
+
sourceHint: module.sourceHint,
|
|
75
|
+
payload,
|
|
76
|
+
handled: false,
|
|
77
|
+
message: `Tool '${module.name}' failed: ${result.error}`,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|