@cuylabs/agent-core 4.9.0 → 4.10.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 +11 -12
- package/dist/agent/chat-loop/commit-batch.d.ts +10 -0
- package/dist/agent/chat-loop/commit-batch.d.ts.map +1 -0
- package/dist/agent/chat-loop/context-recovery.d.ts +29 -0
- package/dist/agent/chat-loop/context-recovery.d.ts.map +1 -0
- package/dist/agent/chat-loop/finalize-turn.d.ts +19 -0
- package/dist/agent/chat-loop/finalize-turn.d.ts.map +1 -0
- package/dist/agent/chat-loop/index.d.ts +7 -0
- package/dist/agent/chat-loop/index.d.ts.map +1 -0
- package/dist/agent/chat-loop/loop.d.ts +8 -0
- package/dist/agent/chat-loop/loop.d.ts.map +1 -0
- package/dist/agent/chat-loop/model-step-runner.d.ts +26 -0
- package/dist/agent/chat-loop/model-step-runner.d.ts.map +1 -0
- package/dist/agent/chat-loop/model-step-snapshot.d.ts +49 -0
- package/dist/agent/chat-loop/model-step-snapshot.d.ts.map +1 -0
- package/dist/agent/chat-loop/turn-tools.d.ts +19 -0
- package/dist/agent/chat-loop/turn-tools.d.ts.map +1 -0
- package/dist/agent/chat-loop/types.d.ts +60 -0
- package/dist/agent/chat-loop/types.d.ts.map +1 -0
- package/dist/agent/defaults.d.ts +69 -0
- package/dist/agent/defaults.d.ts.map +1 -0
- package/dist/agent/event-printer.d.ts +94 -0
- package/dist/agent/event-printer.d.ts.map +1 -0
- package/dist/agent/fork.d.ts +59 -0
- package/dist/agent/fork.d.ts.map +1 -0
- package/dist/agent/index.d.ts +17 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/instance/context-management.d.ts +29 -0
- package/dist/agent/instance/context-management.d.ts.map +1 -0
- package/dist/agent/instance/forking.d.ts +26 -0
- package/dist/agent/instance/forking.d.ts.map +1 -0
- package/dist/agent/instance/index.d.ts +170 -0
- package/dist/agent/instance/index.d.ts.map +1 -0
- package/dist/agent/instance/interventions.d.ts +10 -0
- package/dist/agent/instance/interventions.d.ts.map +1 -0
- package/dist/agent/instance/mcp.d.ts +21 -0
- package/dist/agent/instance/mcp.d.ts.map +1 -0
- package/dist/agent/instance/sessions.d.ts +8 -0
- package/dist/agent/instance/sessions.d.ts.map +1 -0
- package/dist/agent/instance/tools.d.ts +16 -0
- package/dist/agent/instance/tools.d.ts.map +1 -0
- package/dist/agent/instance/turn-lifecycle.d.ts +61 -0
- package/dist/agent/instance/turn-lifecycle.d.ts.map +1 -0
- package/dist/agent/session.d.ts +16 -0
- package/dist/agent/session.d.ts.map +1 -0
- package/dist/agent/setup/config.d.ts +8 -0
- package/dist/agent/setup/config.d.ts.map +1 -0
- package/dist/agent/setup/context-window.d.ts +4 -0
- package/dist/agent/setup/context-window.d.ts.map +1 -0
- package/dist/agent/setup/environment.d.ts +5 -0
- package/dist/agent/setup/environment.d.ts.map +1 -0
- package/dist/agent/setup/middleware.d.ts +9 -0
- package/dist/agent/setup/middleware.d.ts.map +1 -0
- package/dist/agent/setup/runtime-config.d.ts +9 -0
- package/dist/agent/setup/runtime-config.d.ts.map +1 -0
- package/dist/agent/setup/state.d.ts +4 -0
- package/dist/agent/setup/state.d.ts.map +1 -0
- package/dist/agent/setup/tools.d.ts +8 -0
- package/dist/agent/setup/tools.d.ts.map +1 -0
- package/dist/agent/setup.d.ts +47 -0
- package/dist/agent/setup.d.ts.map +1 -0
- package/dist/agent/stream-provider.d.ts +27 -0
- package/dist/agent/stream-provider.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/agent-context.d.ts +53 -0
- package/dist/agent/turn-context/compaction/agent-context.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/budget.d.ts +4 -0
- package/dist/agent/turn-context/compaction/budget.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/check.d.ts +39 -0
- package/dist/agent/turn-context/compaction/check.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/fragments.d.ts +4 -0
- package/dist/agent/turn-context/compaction/fragments.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/index.d.ts +5 -0
- package/dist/agent/turn-context/compaction/index.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/memory.d.ts +17 -0
- package/dist/agent/turn-context/compaction/memory.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/results.d.ts +19 -0
- package/dist/agent/turn-context/compaction/results.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/summary.d.ts +3 -0
- package/dist/agent/turn-context/compaction/summary.d.ts.map +1 -0
- package/dist/agent/turn-context/compaction/types.d.ts +24 -0
- package/dist/agent/turn-context/compaction/types.d.ts.map +1 -0
- package/dist/agent/turn-context/fit-model-context.d.ts +29 -0
- package/dist/agent/turn-context/fit-model-context.d.ts.map +1 -0
- package/dist/agent/turn-context/index.d.ts +5 -0
- package/dist/agent/turn-context/index.d.ts.map +1 -0
- package/dist/agent/turn-context/system-prompts.d.ts +12 -0
- package/dist/agent/turn-context/system-prompts.d.ts.map +1 -0
- package/dist/agent/types/config.d.ts +199 -0
- package/dist/agent/types/config.d.ts.map +1 -0
- package/dist/agent/types/index.d.ts +11 -0
- package/dist/agent/types/index.d.ts.map +1 -0
- package/dist/agent/types/state.d.ts +16 -0
- package/dist/agent/types/state.d.ts.map +1 -0
- package/dist/agent/types/tracing.d.ts +12 -0
- package/dist/agent/types/tracing.d.ts.map +1 -0
- package/dist/{chunk-KYLPMBHD.js → chunk-336EDIBL.js} +1 -1
- package/dist/chunk-AAGKWUXR.js +539 -0
- package/dist/chunk-AHDCR7SX.js +83 -0
- package/dist/{chunk-CSR75JVC.js → chunk-ASXF5AC6.js} +1 -1
- package/dist/{chunk-2TTOLHBT.js → chunk-CFBSQLP5.js} +1 -1
- package/dist/{chunk-GJFP5L2V.js → chunk-CNM6OROH.js} +15 -3
- package/dist/chunk-E66PKKDL.js +772 -0
- package/dist/{chunk-HSUPTXNV.js → chunk-EBVSPHXA.js} +13 -10
- package/dist/chunk-EEAGM5MS.js +257 -0
- package/dist/chunk-IQA64CAO.js +84 -0
- package/dist/chunk-JFH6HBUG.js +227 -0
- package/dist/{chunk-MWPU2EVV.js → chunk-JUIL2NJC.js} +4 -81
- package/dist/{chunk-NS7D7JJU.js → chunk-K453AFTL.js} +35 -16
- package/dist/chunk-LX4AHGI3.js +960 -0
- package/dist/chunk-MJRZ2ZRI.js +498 -0
- package/dist/chunk-NMJNN6LS.js +1155 -0
- package/dist/{chunk-UMIVJDEJ.js → chunk-SAWRDGBE.js} +30 -7
- package/dist/{chunk-GEBFHREI.js → chunk-TU5KDFWI.js} +30 -5
- package/dist/{chunk-QJV5XPPS.js → chunk-UEEHZ4QH.js} +1 -1
- package/dist/chunk-UG5PVNZV.js +53 -0
- package/dist/{chunk-BGG2HVIR.js → chunk-V4MIDL5B.js} +9 -0
- package/dist/{chunk-BJC46FIF.js → chunk-V4YQ6MBK.js} +2 -2
- package/dist/{chunk-H3GRHFFG.js → chunk-VMGZKIFT.js} +30 -9
- package/dist/chunk-W6LWIMIX.js +8 -0
- package/dist/context/assembly/index.d.ts +3 -0
- package/dist/context/assembly/index.d.ts.map +1 -0
- package/dist/context/assembly/prepare.d.ts +11 -0
- package/dist/context/assembly/prepare.d.ts.map +1 -0
- package/dist/context/assembly/types.d.ts +60 -0
- package/dist/context/assembly/types.d.ts.map +1 -0
- package/dist/context/config.d.ts +11 -0
- package/dist/context/config.d.ts.map +1 -0
- package/dist/context/fragments/index.d.ts +4 -0
- package/dist/context/fragments/index.d.ts.map +1 -0
- package/dist/context/fragments/messages.d.ts +10 -0
- package/dist/context/fragments/messages.d.ts.map +1 -0
- package/dist/context/fragments/render.d.ts +16 -0
- package/dist/context/fragments/render.d.ts.map +1 -0
- package/dist/context/fragments/types.d.ts +87 -0
- package/dist/context/fragments/types.d.ts.map +1 -0
- package/dist/context/index.d.ts +13 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +90 -0
- package/dist/context/text/truncation.d.ts +13 -0
- package/dist/context/text/truncation.d.ts.map +1 -0
- package/dist/context/window/budget.d.ts +108 -0
- package/dist/context/window/budget.d.ts.map +1 -0
- package/dist/context/window/compactor.d.ts +74 -0
- package/dist/context/window/compactor.d.ts.map +1 -0
- package/dist/context/window/cut-planner.d.ts +64 -0
- package/dist/context/window/cut-planner.d.ts.map +1 -0
- package/dist/context/window/decision.d.ts +41 -0
- package/dist/context/window/decision.d.ts.map +1 -0
- package/dist/context/window/estimation.d.ts +45 -0
- package/dist/context/window/estimation.d.ts.map +1 -0
- package/dist/context/window/index.d.ts +26 -0
- package/dist/context/window/index.d.ts.map +1 -0
- package/dist/context/window/manager.d.ts +80 -0
- package/dist/context/window/manager.d.ts.map +1 -0
- package/dist/context/window/summary-policy.d.ts +50 -0
- package/dist/context/window/summary-policy.d.ts.map +1 -0
- package/dist/context/window/summary.d.ts +56 -0
- package/dist/context/window/summary.d.ts.map +1 -0
- package/dist/context/window/tool-pruning.d.ts +62 -0
- package/dist/context/window/tool-pruning.d.ts.map +1 -0
- package/dist/dispatch/executor.d.ts +56 -0
- package/dist/dispatch/executor.d.ts.map +1 -0
- package/dist/dispatch/index.d.ts +7 -95
- package/dist/dispatch/index.d.ts.map +1 -0
- package/dist/dispatch/index.js +4 -3
- package/dist/dispatch/results.d.ts +9 -0
- package/dist/dispatch/results.d.ts.map +1 -0
- package/dist/dispatch/runtime.d.ts +19 -0
- package/dist/dispatch/runtime.d.ts.map +1 -0
- package/dist/dispatch/tool-factories.d.ts +8 -0
- package/dist/dispatch/tool-factories.d.ts.map +1 -0
- package/dist/dispatch/tools.d.ts +10 -0
- package/dist/dispatch/tools.d.ts.map +1 -0
- package/dist/dispatch/types.d.ts +131 -0
- package/dist/dispatch/types.d.ts.map +1 -0
- package/dist/events/event-bus/index.d.ts +13 -0
- package/dist/events/event-bus/index.d.ts.map +1 -0
- package/dist/events/event-bus/index.js +6 -0
- package/dist/events/event-bus/local.d.ts +14 -0
- package/dist/events/event-bus/local.d.ts.map +1 -0
- package/dist/events/event-bus/types.d.ts +78 -0
- package/dist/events/event-bus/types.d.ts.map +1 -0
- package/dist/events/index.d.ts +10 -89
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +6 -1
- package/dist/events/signal/index.d.ts +18 -0
- package/dist/events/signal/index.d.ts.map +1 -0
- package/dist/events/signal/index.js +6 -0
- package/dist/events/signal/local.d.ts +22 -0
- package/dist/events/signal/local.d.ts.map +1 -0
- package/dist/events/signal/types.d.ts +69 -0
- package/dist/events/signal/types.d.ts.map +1 -0
- package/dist/execution/index.d.ts +33 -481
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +45 -19
- package/dist/execution/scope/index.d.ts +10 -0
- package/dist/execution/scope/index.d.ts.map +1 -0
- package/dist/execution/scope/index.js +12 -0
- package/dist/execution/scope/run.d.ts +8 -0
- package/dist/execution/scope/run.d.ts.map +1 -0
- package/dist/execution/scope/store.d.ts +6 -0
- package/dist/execution/scope/store.d.ts.map +1 -0
- package/dist/execution/scope/types.d.ts +28 -0
- package/dist/execution/scope/types.d.ts.map +1 -0
- package/dist/execution/shared/usage.d.ts +9 -0
- package/dist/execution/shared/usage.d.ts.map +1 -0
- package/dist/execution/task/index.d.ts +6 -0
- package/dist/execution/task/index.d.ts.map +1 -0
- package/dist/execution/task/observer.d.ts +80 -0
- package/dist/execution/task/observer.d.ts.map +1 -0
- package/dist/execution/task/runner.d.ts +39 -0
- package/dist/execution/task/runner.d.ts.map +1 -0
- package/dist/execution/task/types.d.ts +85 -0
- package/dist/execution/task/types.d.ts.map +1 -0
- package/dist/execution/turn/engine/commit-batch.d.ts +16 -0
- package/dist/execution/turn/engine/commit-batch.d.ts.map +1 -0
- package/dist/execution/turn/engine/engine.d.ts +32 -0
- package/dist/execution/turn/engine/engine.d.ts.map +1 -0
- package/dist/execution/turn/engine/index.d.ts +12 -0
- package/dist/execution/turn/engine/index.d.ts.map +1 -0
- package/dist/execution/turn/engine/types.d.ts +67 -0
- package/dist/execution/turn/engine/types.d.ts.map +1 -0
- package/dist/execution/turn/index.d.ts +18 -0
- package/dist/execution/turn/index.d.ts.map +1 -0
- package/dist/execution/turn/index.js +52 -0
- package/dist/execution/turn/runner/commit.d.ts +11 -0
- package/dist/execution/turn/runner/commit.d.ts.map +1 -0
- package/dist/execution/turn/runner/index.d.ts +16 -0
- package/dist/execution/turn/runner/index.d.ts.map +1 -0
- package/dist/execution/turn/runner/prepare.d.ts +6 -0
- package/dist/execution/turn/runner/prepare.d.ts.map +1 -0
- package/dist/execution/turn/runner/stream-step.d.ts +8 -0
- package/dist/execution/turn/runner/stream-step.d.ts.map +1 -0
- package/dist/execution/turn/runner/tool-batch.d.ts +13 -0
- package/dist/execution/turn/runner/tool-batch.d.ts.map +1 -0
- package/dist/execution/turn/runner/types.d.ts +111 -0
- package/dist/execution/turn/runner/types.d.ts.map +1 -0
- package/dist/execution/turn/state.d.ts +110 -0
- package/dist/execution/turn/state.d.ts.map +1 -0
- package/dist/execution/turn/step-ledger.d.ts +89 -0
- package/dist/execution/turn/step-ledger.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/doom-loop.d.ts +28 -0
- package/dist/execution/turn/step-processing/doom-loop.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/index.d.ts +14 -0
- package/dist/execution/turn/step-processing/index.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/overflow.d.ts +17 -0
- package/dist/execution/turn/step-processing/overflow.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/process.d.ts +7 -0
- package/dist/execution/turn/step-processing/process.d.ts.map +1 -0
- package/dist/execution/turn/step-processing/types.d.ts +65 -0
- package/dist/execution/turn/step-processing/types.d.ts.map +1 -0
- package/dist/execution/workflow/index.d.ts +12 -0
- package/dist/execution/workflow/index.d.ts.map +1 -0
- package/dist/execution/workflow/index.js +39 -0
- package/dist/execution/workflow/planner/apply.d.ts +30 -0
- package/dist/execution/workflow/planner/apply.d.ts.map +1 -0
- package/dist/execution/workflow/planner/helpers.d.ts +6 -0
- package/dist/execution/workflow/planner/helpers.d.ts.map +1 -0
- package/dist/execution/workflow/planner/index.d.ts +13 -0
- package/dist/execution/workflow/planner/index.d.ts.map +1 -0
- package/dist/execution/workflow/planner/plan.d.ts +7 -0
- package/dist/execution/workflow/planner/plan.d.ts.map +1 -0
- package/dist/execution/workflow/planner/types.d.ts +49 -0
- package/dist/execution/workflow/planner/types.d.ts.map +1 -0
- package/dist/execution/workflow/snapshot.d.ts +11 -0
- package/dist/execution/workflow/snapshot.d.ts.map +1 -0
- package/dist/execution/workflow/state.d.ts +161 -0
- package/dist/execution/workflow/state.d.ts.map +1 -0
- package/dist/human/controller.d.ts +24 -0
- package/dist/human/controller.d.ts.map +1 -0
- package/dist/human/handler.d.ts +15 -0
- package/dist/human/handler.d.ts.map +1 -0
- package/dist/human/index.d.ts +5 -0
- package/dist/human/index.d.ts.map +1 -0
- package/dist/human/tool.d.ts +17 -0
- package/dist/human/tool.d.ts.map +1 -0
- package/dist/human/types.d.ts +62 -0
- package/dist/human/types.d.ts.map +1 -0
- package/dist/index.d.ts +66 -567
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2482 -1846
- package/dist/inference/defaults.d.ts +8 -0
- package/dist/inference/defaults.d.ts.map +1 -0
- package/dist/inference/errors/classify.d.ts +5 -0
- package/dist/inference/errors/classify.d.ts.map +1 -0
- package/dist/inference/errors/extract.d.ts +3 -0
- package/dist/inference/errors/extract.d.ts.map +1 -0
- package/dist/inference/errors/index.d.ts +8 -11
- package/dist/inference/errors/index.d.ts.map +1 -0
- package/dist/inference/errors/llm-error.d.ts +14 -0
- package/dist/inference/errors/llm-error.d.ts.map +1 -0
- package/dist/inference/errors/types.d.ts +18 -0
- package/dist/inference/errors/types.d.ts.map +1 -0
- package/dist/inference/errors/utils.d.ts +5 -0
- package/dist/inference/errors/utils.d.ts.map +1 -0
- package/dist/inference/index.d.ts +17 -49
- package/dist/inference/index.d.ts.map +1 -0
- package/dist/inference/index.js +7 -7
- package/dist/inference/middleware-support.d.ts +14 -0
- package/dist/inference/middleware-support.d.ts.map +1 -0
- package/dist/{model-messages-n_ZMZwIm.d.ts → inference/model-messages.d.ts} +4 -6
- package/dist/inference/model-messages.d.ts.map +1 -0
- package/dist/inference/retry.d.ts +73 -0
- package/dist/inference/retry.d.ts.map +1 -0
- package/dist/inference/stream.d.ts +16 -0
- package/dist/inference/stream.d.ts.map +1 -0
- package/dist/inference/toolset.d.ts +26 -0
- package/dist/inference/toolset.d.ts.map +1 -0
- package/dist/inference/types.d.ts +129 -0
- package/dist/inference/types.d.ts.map +1 -0
- package/dist/intervention/follow-up-policy.d.ts +41 -0
- package/dist/intervention/follow-up-policy.d.ts.map +1 -0
- package/dist/intervention/index.d.ts +5 -0
- package/dist/intervention/index.d.ts.map +1 -0
- package/dist/intervention/intervention.d.ts +130 -0
- package/dist/intervention/intervention.d.ts.map +1 -0
- package/dist/intervention/types.d.ts +74 -0
- package/dist/intervention/types.d.ts.map +1 -0
- package/dist/logger/index.d.ts +5 -47
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/logger.d.ts +46 -0
- package/dist/logger/logger.d.ts.map +1 -0
- package/dist/{types-RSCv7nQ4.d.ts → logger/types.d.ts} +6 -7
- package/dist/logger/types.d.ts.map +1 -0
- package/dist/mcp/auth.d.ts +109 -0
- package/dist/mcp/auth.d.ts.map +1 -0
- package/dist/mcp/diagnostics.d.ts +23 -0
- package/dist/mcp/diagnostics.d.ts.map +1 -0
- package/dist/mcp/factories.d.ts +47 -0
- package/dist/mcp/factories.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +14 -175
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/manager.d.ts +45 -0
- package/dist/mcp/manager.d.ts.map +1 -0
- package/dist/mcp/modules.d.ts +6 -0
- package/dist/mcp/modules.d.ts.map +1 -0
- package/dist/{types-DMjoFKKv.d.ts → mcp/types.d.ts} +18 -19
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/memory/config.d.ts +4 -0
- package/dist/memory/config.d.ts.map +1 -0
- package/dist/memory/format.d.ts +8 -0
- package/dist/memory/format.d.ts.map +1 -0
- package/dist/memory/index.d.ts +5 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +14 -0
- package/dist/memory/middleware.d.ts +14 -0
- package/dist/memory/middleware.d.ts.map +1 -0
- package/dist/memory/types.d.ts +232 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/middleware/approval.d.ts +70 -0
- package/dist/middleware/approval.d.ts.map +1 -0
- package/dist/middleware/index.d.ts +24 -110
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +2 -2
- package/dist/middleware/prompt-cache/cache.d.ts +44 -0
- package/dist/middleware/prompt-cache/cache.d.ts.map +1 -0
- package/dist/middleware/prompt-cache/index.d.ts +14 -0
- package/dist/middleware/prompt-cache/index.d.ts.map +1 -0
- package/dist/middleware/prompt-cache/types.d.ts +50 -0
- package/dist/middleware/prompt-cache/types.d.ts.map +1 -0
- package/dist/middleware/runner.d.ts +100 -0
- package/dist/middleware/runner.d.ts.map +1 -0
- package/dist/middleware/telemetry/index.d.ts +12 -0
- package/dist/middleware/telemetry/index.d.ts.map +1 -0
- package/dist/middleware/telemetry/otel.d.ts +4 -0
- package/dist/middleware/telemetry/otel.d.ts.map +1 -0
- package/dist/middleware/telemetry/provider.d.ts +3 -0
- package/dist/middleware/telemetry/provider.d.ts.map +1 -0
- package/dist/middleware/telemetry/types.d.ts +150 -0
- package/dist/middleware/telemetry/types.d.ts.map +1 -0
- package/dist/middleware/types.d.ts +371 -0
- package/dist/middleware/types.d.ts.map +1 -0
- package/dist/models/cache/adapters.d.ts +4 -0
- package/dist/models/cache/adapters.d.ts.map +1 -0
- package/dist/models/cache/index.d.ts +5 -0
- package/dist/models/cache/index.d.ts.map +1 -0
- package/dist/models/cache/manager.d.ts +32 -0
- package/dist/models/cache/manager.d.ts.map +1 -0
- package/dist/models/cache/types.d.ts +17 -0
- package/dist/models/cache/types.d.ts.map +1 -0
- package/dist/models/capability-resolver.d.ts +104 -0
- package/dist/models/capability-resolver.d.ts.map +1 -0
- package/dist/models/identifiers.d.ts +23 -0
- package/dist/models/identifiers.d.ts.map +1 -0
- package/dist/models/index.d.ts +35 -256
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +1 -1
- package/dist/models/overrides.d.ts +10 -0
- package/dist/models/overrides.d.ts.map +1 -0
- package/dist/models/profiles.d.ts +38 -0
- package/dist/models/profiles.d.ts.map +1 -0
- package/dist/models/reasoning/config.d.ts +49 -0
- package/dist/models/reasoning/config.d.ts.map +1 -0
- package/dist/models/reasoning/index.d.ts +12 -4
- package/dist/models/reasoning/index.d.ts.map +1 -0
- package/dist/models/reasoning/index.js +1 -1
- package/dist/models/reasoning/providers.d.ts +63 -0
- package/dist/models/reasoning/providers.d.ts.map +1 -0
- package/dist/{types-CQaXbRsS.d.ts → models/reasoning/types.d.ts} +7 -8
- package/dist/models/reasoning/types.d.ts.map +1 -0
- package/dist/models/remote/fetcher.d.ts +13 -0
- package/dist/models/remote/fetcher.d.ts.map +1 -0
- package/dist/models/remote/index.d.ts +8 -0
- package/dist/models/remote/index.d.ts.map +1 -0
- package/dist/models/remote/network.d.ts +6 -0
- package/dist/models/remote/network.d.ts.map +1 -0
- package/dist/models/remote/source.d.ts +16 -0
- package/dist/models/remote/source.d.ts.map +1 -0
- package/dist/models/remote/transform.d.ts +4 -0
- package/dist/models/remote/transform.d.ts.map +1 -0
- package/dist/models/remote/types.d.ts +28 -0
- package/dist/models/remote/types.d.ts.map +1 -0
- package/dist/models/resolver.d.ts +26 -0
- package/dist/models/resolver.d.ts.map +1 -0
- package/dist/models/types.d.ts +137 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/plugin/compatibility.d.ts +11 -0
- package/dist/plugin/compatibility.d.ts.map +1 -0
- package/dist/plugin/define.d.ts +77 -0
- package/dist/plugin/define.d.ts.map +1 -0
- package/dist/plugin/event-bus.d.ts +31 -0
- package/dist/plugin/event-bus.d.ts.map +1 -0
- package/dist/plugin/index.d.ts +9 -458
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/loader.d.ts +63 -0
- package/dist/plugin/loader.d.ts.map +1 -0
- package/dist/plugin/registry.d.ts +81 -0
- package/dist/plugin/registry.d.ts.map +1 -0
- package/dist/plugin/settings.d.ts +36 -0
- package/dist/plugin/settings.d.ts.map +1 -0
- package/dist/plugin/types.d.ts +168 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/profiles/apply.d.ts +17 -0
- package/dist/profiles/apply.d.ts.map +1 -0
- package/dist/profiles/builtins.d.ts +18 -0
- package/dist/profiles/builtins.d.ts.map +1 -0
- package/dist/profiles/index.d.ts +12 -55
- package/dist/profiles/index.d.ts.map +1 -0
- package/dist/profiles/patterns.d.ts +12 -0
- package/dist/profiles/patterns.d.ts.map +1 -0
- package/dist/profiles/types.d.ts +48 -0
- package/dist/profiles/types.d.ts.map +1 -0
- package/dist/prompt/builder/builder.d.ts +27 -0
- package/dist/prompt/builder/builder.d.ts.map +1 -0
- package/dist/prompt/builder/index.d.ts +11 -0
- package/dist/prompt/builder/index.d.ts.map +1 -0
- package/dist/prompt/builder/priorities.d.ts +13 -0
- package/dist/prompt/builder/priorities.d.ts.map +1 -0
- package/dist/prompt/builder/sections.d.ts +30 -0
- package/dist/prompt/builder/sections.d.ts.map +1 -0
- package/dist/prompt/environment.d.ts +46 -0
- package/dist/prompt/environment.d.ts.map +1 -0
- package/dist/prompt/index.d.ts +31 -220
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +3 -1
- package/dist/prompt/instructions.d.ts +104 -0
- package/dist/prompt/instructions.d.ts.map +1 -0
- package/dist/prompt/templates.d.ts +56 -0
- package/dist/prompt/templates.d.ts.map +1 -0
- package/dist/prompt/types.d.ts +218 -0
- package/dist/prompt/types.d.ts.map +1 -0
- package/dist/safety/errors.d.ts +18 -0
- package/dist/safety/errors.d.ts.map +1 -0
- package/dist/safety/handler.d.ts +16 -0
- package/dist/safety/handler.d.ts.map +1 -0
- package/dist/safety/index.d.ts +11 -133
- package/dist/safety/index.d.ts.map +1 -0
- package/dist/safety/patterns.d.ts +17 -0
- package/dist/safety/patterns.d.ts.map +1 -0
- package/dist/safety/policy.d.ts +31 -0
- package/dist/safety/policy.d.ts.map +1 -0
- package/dist/safety/presets.d.ts +43 -0
- package/dist/safety/presets.d.ts.map +1 -0
- package/dist/safety/risk.d.ts +14 -0
- package/dist/safety/risk.d.ts.map +1 -0
- package/dist/safety/types.d.ts +165 -0
- package/dist/safety/types.d.ts.map +1 -0
- package/dist/sandbox/index.d.ts +2 -81
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/types.d.ts +79 -0
- package/dist/sandbox/types.d.ts.map +1 -0
- package/dist/skill/discovery/constants.d.ts +6 -0
- package/dist/skill/discovery/constants.d.ts.map +1 -0
- package/dist/skill/discovery/dedupe.d.ts +3 -0
- package/dist/skill/discovery/dedupe.d.ts.map +1 -0
- package/dist/skill/discovery/discover.d.ts +3 -0
- package/dist/skill/discovery/discover.d.ts.map +1 -0
- package/dist/skill/discovery/fs.d.ts +4 -0
- package/dist/skill/discovery/fs.d.ts.map +1 -0
- package/dist/skill/discovery/index.d.ts +6 -0
- package/dist/skill/discovery/index.d.ts.map +1 -0
- package/dist/skill/discovery/scan.d.ts +3 -0
- package/dist/skill/discovery/scan.d.ts.map +1 -0
- package/dist/skill/discovery/types.d.ts +15 -0
- package/dist/skill/discovery/types.d.ts.map +1 -0
- package/dist/skill/index.d.ts +67 -89
- package/dist/skill/index.d.ts.map +1 -0
- package/dist/skill/index.js +2 -2
- package/dist/skill/loader/constants.d.ts +5 -0
- package/dist/skill/loader/constants.d.ts.map +1 -0
- package/dist/skill/loader/frontmatter.d.ts +5 -0
- package/dist/skill/loader/frontmatter.d.ts.map +1 -0
- package/dist/skill/loader/index.d.ts +8 -0
- package/dist/skill/loader/index.d.ts.map +1 -0
- package/dist/skill/loader/metadata.d.ts +3 -0
- package/dist/skill/loader/metadata.d.ts.map +1 -0
- package/dist/skill/loader/resources.d.ts +5 -0
- package/dist/skill/loader/resources.d.ts.map +1 -0
- package/dist/skill/registry.d.ts +177 -0
- package/dist/skill/registry.d.ts.map +1 -0
- package/dist/skill/tools.d.ts +77 -0
- package/dist/skill/tools.d.ts.map +1 -0
- package/dist/skill/types.d.ts +291 -0
- package/dist/skill/types.d.ts.map +1 -0
- package/dist/storage/file/helpers.d.ts +16 -0
- package/dist/storage/file/helpers.d.ts.map +1 -0
- package/dist/storage/file/index.d.ts +6 -0
- package/dist/storage/file/index.d.ts.map +1 -0
- package/dist/storage/file/storage.d.ts +29 -0
- package/dist/storage/file/storage.d.ts.map +1 -0
- package/dist/storage/file/types.d.ts +6 -0
- package/dist/storage/file/types.d.ts.map +1 -0
- package/dist/storage/index.d.ts +11 -188
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +2 -1
- package/dist/storage/lock.d.ts +18 -0
- package/dist/storage/lock.d.ts.map +1 -0
- package/dist/storage/manager/default.d.ts +11 -0
- package/dist/storage/manager/default.d.ts.map +1 -0
- package/dist/storage/manager/index.d.ts +12 -0
- package/dist/storage/manager/index.d.ts.map +1 -0
- package/dist/storage/manager/session-manager.d.ts +57 -0
- package/dist/storage/manager/session-manager.d.ts.map +1 -0
- package/dist/storage/manager/types.d.ts +42 -0
- package/dist/storage/manager/types.d.ts.map +1 -0
- package/dist/storage/memory.d.ts +22 -0
- package/dist/storage/memory.d.ts.map +1 -0
- package/dist/storage/paths.d.ts +37 -0
- package/dist/storage/paths.d.ts.map +1 -0
- package/dist/storage/types.d.ts +205 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/utils.d.ts +77 -0
- package/dist/storage/utils.d.ts.map +1 -0
- package/dist/subagents/index.d.ts +8 -179
- package/dist/subagents/index.d.ts.map +1 -0
- package/dist/subagents/index.js +5 -4
- package/dist/subagents/installation.d.ts +23 -0
- package/dist/subagents/installation.d.ts.map +1 -0
- package/dist/subagents/results.d.ts +15 -0
- package/dist/subagents/results.d.ts.map +1 -0
- package/dist/subagents/roles/discovery.d.ts +38 -0
- package/dist/subagents/roles/discovery.d.ts.map +1 -0
- package/dist/subagents/roles/index.d.ts +5 -0
- package/dist/subagents/roles/index.d.ts.map +1 -0
- package/dist/subagents/roles/markdown-profile.d.ts +61 -0
- package/dist/subagents/roles/markdown-profile.d.ts.map +1 -0
- package/dist/subagents/tool-factories.d.ts +11 -0
- package/dist/subagents/tool-factories.d.ts.map +1 -0
- package/dist/subagents/tools.d.ts +13 -0
- package/dist/subagents/tools.d.ts.map +1 -0
- package/dist/subagents/types.d.ts +21 -0
- package/dist/subagents/types.d.ts.map +1 -0
- package/dist/team/coordinator/coordinator.d.ts +342 -0
- package/dist/team/coordinator/coordinator.d.ts.map +1 -0
- package/dist/team/coordinator/inbox.d.ts +99 -0
- package/dist/team/coordinator/inbox.d.ts.map +1 -0
- package/dist/team/coordinator/index.d.ts +19 -0
- package/dist/team/coordinator/index.d.ts.map +1 -0
- package/dist/team/coordinator/planning.d.ts +33 -0
- package/dist/team/coordinator/planning.d.ts.map +1 -0
- package/dist/team/coordinator/policy.d.ts +31 -0
- package/dist/team/coordinator/policy.d.ts.map +1 -0
- package/dist/team/coordinator/round-engine.d.ts +25 -0
- package/dist/team/coordinator/round-engine.d.ts.map +1 -0
- package/dist/team/coordinator/synthesis.d.ts +20 -0
- package/dist/team/coordinator/synthesis.d.ts.map +1 -0
- package/dist/team/coordinator/turn.d.ts +107 -0
- package/dist/team/coordinator/turn.d.ts.map +1 -0
- package/dist/team/coordinator/types.d.ts +344 -0
- package/dist/team/coordinator/types.d.ts.map +1 -0
- package/dist/team/events.d.ts +148 -0
- package/dist/team/events.d.ts.map +1 -0
- package/dist/team/execution.d.ts +51 -0
- package/dist/team/execution.d.ts.map +1 -0
- package/dist/team/index.d.ts +23 -545
- package/dist/team/index.d.ts.map +1 -0
- package/dist/team/index.js +2 -2
- package/dist/team/mailbox.d.ts +91 -0
- package/dist/team/mailbox.d.ts.map +1 -0
- package/dist/team/notifications.d.ts +23 -0
- package/dist/team/notifications.d.ts.map +1 -0
- package/dist/team/permissions.d.ts +88 -0
- package/dist/team/permissions.d.ts.map +1 -0
- package/dist/team/shutdown.d.ts +38 -0
- package/dist/team/shutdown.d.ts.map +1 -0
- package/dist/team/task-board.d.ts +161 -0
- package/dist/team/task-board.d.ts.map +1 -0
- package/dist/team/types.d.ts +233 -0
- package/dist/team/types.d.ts.map +1 -0
- package/dist/team/work-loop.d.ts +30 -0
- package/dist/team/work-loop.d.ts.map +1 -0
- package/dist/tool/executor.d.ts +59 -0
- package/dist/tool/executor.d.ts.map +1 -0
- package/dist/tool/host/index.d.ts +7 -38
- package/dist/tool/host/index.d.ts.map +1 -0
- package/dist/tool/host/local.d.ts +15 -0
- package/dist/tool/host/local.d.ts.map +1 -0
- package/dist/tool/host/registry.d.ts +17 -0
- package/dist/tool/host/registry.d.ts.map +1 -0
- package/dist/{types-C_LCeYNg.d.ts → tool/host/types.d.ts} +6 -7
- package/dist/tool/host/types.d.ts.map +1 -0
- package/dist/tool/index.d.ts +21 -285
- package/dist/tool/index.d.ts.map +1 -0
- package/dist/tool/index.js +4 -3
- package/dist/tool/registry.d.ts +130 -0
- package/dist/tool/registry.d.ts.map +1 -0
- package/dist/tool/replay.d.ts +11 -0
- package/dist/tool/replay.d.ts.map +1 -0
- package/dist/tool/tool-search.d.ts +50 -0
- package/dist/tool/tool-search.d.ts.map +1 -0
- package/dist/tool/tool.d.ts +308 -0
- package/dist/tool/tool.d.ts.map +1 -0
- package/dist/tool/truncation.d.ts +34 -0
- package/dist/tool/truncation.d.ts.map +1 -0
- package/dist/tool/turn-tools.d.ts +71 -0
- package/dist/tool/turn-tools.d.ts.map +1 -0
- package/dist/tracking/file-tracking.d.ts +25 -0
- package/dist/tracking/file-tracking.d.ts.map +1 -0
- package/dist/tracking/index.d.ts +9 -0
- package/dist/tracking/index.d.ts.map +1 -0
- package/dist/tracking/turn-tracker/diff.d.ts +11 -0
- package/dist/tracking/turn-tracker/diff.d.ts.map +1 -0
- package/dist/tracking/turn-tracker/index.d.ts +11 -0
- package/dist/tracking/turn-tracker/index.d.ts.map +1 -0
- package/dist/tracking/turn-tracker/tracker.d.ts +31 -0
- package/dist/tracking/turn-tracker/tracker.d.ts.map +1 -0
- package/dist/tracking/turn-tracker/types.d.ts +66 -0
- package/dist/tracking/turn-tracker/types.d.ts.map +1 -0
- package/dist/types/compaction.d.ts +142 -0
- package/dist/types/compaction.d.ts.map +1 -0
- package/dist/types/doom-loop.d.ts +25 -0
- package/dist/types/doom-loop.d.ts.map +1 -0
- package/dist/types/events.d.ts +194 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/messages.d.ts +119 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/stream.d.ts +172 -0
- package/dist/types/stream.d.ts.map +1 -0
- package/dist/types/tool.d.ts +309 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/turn-source.d.ts +36 -0
- package/dist/types/turn-source.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +7 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/package.json +45 -8
- package/dist/chunk-CJI7PVS2.js +0 -58
- package/dist/chunk-V6ETEYST.js +0 -2091
- package/dist/index-BCqEGzBj.d.ts +0 -251
- package/dist/instance-Bg61WSyz.d.ts +0 -6004
- package/dist/llm-error-D93FNNLY.d.ts +0 -32
- package/dist/turn-tools/index.d.ts +0 -12
- package/dist/turn-tools/index.js +0 -1
- package/dist/{chunk-O2WCYSXQ.js → chunk-3NBTQHVV.js} +0 -0
- package/dist/{chunk-Q742PSH3.js → chunk-MJML3A2F.js} +36 -36
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Tools — built-in tools for agent-initiated skill loading
|
|
3
|
+
*
|
|
4
|
+
* Provides two tools that enable the agent to activate skills on demand:
|
|
5
|
+
*
|
|
6
|
+
* 1. **`skill`** — Load a skill's full instructions (L2).
|
|
7
|
+
* The agent calls this when it recognizes a task matching a skill's
|
|
8
|
+
* description. Returns the complete skill body with resource listings.
|
|
9
|
+
*
|
|
10
|
+
* 2. **`skill_resource`** — Read a specific bundled resource (L3).
|
|
11
|
+
* After loading a skill, the agent can read scripts, references,
|
|
12
|
+
* examples, or assets bundled with it.
|
|
13
|
+
*
|
|
14
|
+
* These tools expose skills as regular tools the agent can call,
|
|
15
|
+
* using progressive disclosure so context is used efficiently.
|
|
16
|
+
*
|
|
17
|
+
* The tool descriptions are dynamic — they list all available skill names
|
|
18
|
+
* and descriptions so the agent knows what's available without needing
|
|
19
|
+
* a separate discovery step.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { createSkillTools, createSkillRegistry } from "@cuylabs/agent-core";
|
|
24
|
+
*
|
|
25
|
+
* const registry = await createSkillRegistry(cwd, skillConfig);
|
|
26
|
+
* const tools = createSkillTools(registry);
|
|
27
|
+
*
|
|
28
|
+
* const agent = createAgent({
|
|
29
|
+
* model: anthropic("claude-sonnet-4-20250514"),
|
|
30
|
+
* tools: [...myTools, ...tools],
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
import { Tool } from "../tool/tool.js";
|
|
35
|
+
import type { SkillRegistry } from "./registry.js";
|
|
36
|
+
/**
|
|
37
|
+
* Create the built-in `skill` tool that lets the agent load skill instructions.
|
|
38
|
+
*
|
|
39
|
+
* The tool's description is dynamically generated to include all available
|
|
40
|
+
* skill names and summaries, so the agent knows exactly what's available.
|
|
41
|
+
*
|
|
42
|
+
* @param registry The skill registry to load from
|
|
43
|
+
* @returns A Tool.Info for the `skill` tool
|
|
44
|
+
*/
|
|
45
|
+
export declare function createSkillTool(registry: SkillRegistry): Tool.AnyInfo;
|
|
46
|
+
/**
|
|
47
|
+
* Create the built-in `skill_resource` tool for reading bundled files.
|
|
48
|
+
*
|
|
49
|
+
* This is the L3 layer — the agent calls this to read specific scripts,
|
|
50
|
+
* references, examples, or assets bundled with a skill.
|
|
51
|
+
*
|
|
52
|
+
* @param registry The skill registry to load from
|
|
53
|
+
* @returns A Tool.Info for the `skill_resource` tool
|
|
54
|
+
*/
|
|
55
|
+
export declare function createSkillResourceTool(registry: SkillRegistry): Tool.AnyInfo;
|
|
56
|
+
/**
|
|
57
|
+
* Create both skill tools (skill + skill_resource) for an agent.
|
|
58
|
+
*
|
|
59
|
+
* Returns an empty array if the registry has no skills, so the tools
|
|
60
|
+
* don't clutter the agent's tool list when skills aren't in use.
|
|
61
|
+
*
|
|
62
|
+
* @param registry The skill registry
|
|
63
|
+
* @returns Array of Tool.AnyInfo (0 or 2 tools)
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const registry = await createSkillRegistry(cwd, config);
|
|
68
|
+
* const skillTools = createSkillTools(registry);
|
|
69
|
+
*
|
|
70
|
+
* const agent = createAgent({
|
|
71
|
+
* model: myModel,
|
|
72
|
+
* tools: [...codeTools, ...skillTools],
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function createSkillTools(registry: SkillRegistry): Tool.AnyInfo[];
|
|
77
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/skill/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAMnD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC,OAAO,CA4DrE;AAMD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC,OAAO,CA4B7E;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,CAIxE"}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill System Types
|
|
3
|
+
*
|
|
4
|
+
* Skills are modular, on-demand knowledge packs that extend an agent's
|
|
5
|
+
* capabilities with specialized instructions, workflows, and resources.
|
|
6
|
+
*
|
|
7
|
+
* Design principles:
|
|
8
|
+
*
|
|
9
|
+
* 1. **Progressive disclosure** — summaries always in context,
|
|
10
|
+
* full content loaded only when needed. Minimizes baseline token cost.
|
|
11
|
+
*
|
|
12
|
+
* 2. **Scoped priority** — project skills override user skills
|
|
13
|
+
* override global skills. Closest scope wins on name collision.
|
|
14
|
+
*
|
|
15
|
+
* 3. **Agent-initiated loading** — the agent decides when to
|
|
16
|
+
* activate a skill by calling the `skill` tool. No guesswork.
|
|
17
|
+
*
|
|
18
|
+
* 4. **Bundled resources** — skills can ship scripts,
|
|
19
|
+
* references, assets, and examples alongside instructions.
|
|
20
|
+
*
|
|
21
|
+
* 5. **Remote sources** — skills can be fetched from URLs,
|
|
22
|
+
* enabling shared skill repositories across teams.
|
|
23
|
+
*
|
|
24
|
+
* The lifecycle:
|
|
25
|
+
*
|
|
26
|
+
* Discovery → Registry → Summary injection → Agent tool call → Full load
|
|
27
|
+
*
|
|
28
|
+
* @packageDocumentation
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Where a skill was discovered, determining its override priority.
|
|
32
|
+
*
|
|
33
|
+
* When two skills share the same name, the narrower scope wins:
|
|
34
|
+
* project > user > global > builtin
|
|
35
|
+
*
|
|
36
|
+
* Uses a 4-tier hierarchy with names that are intuitive for
|
|
37
|
+
* library consumers.
|
|
38
|
+
*/
|
|
39
|
+
export type SkillScope = "project" | "user" | "global" | "builtin";
|
|
40
|
+
/**
|
|
41
|
+
* How a skill was obtained — local filesystem or remote URL.
|
|
42
|
+
*/
|
|
43
|
+
export type SkillSourceType = "local" | "remote";
|
|
44
|
+
/**
|
|
45
|
+
* Where a skill came from, for provenance tracking.
|
|
46
|
+
*/
|
|
47
|
+
export interface SkillSource {
|
|
48
|
+
/** Local or remote origin */
|
|
49
|
+
type: SkillSourceType;
|
|
50
|
+
/** Root directory or URL this skill was discovered under */
|
|
51
|
+
root: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Classification of bundled resources within a skill directory.
|
|
55
|
+
*
|
|
56
|
+
* Resource taxonomy:
|
|
57
|
+
* - `script` — executable code for deterministic tasks (can be run without reading)
|
|
58
|
+
* - `reference` — documentation loaded into context on demand
|
|
59
|
+
* - `asset` — templates, images, fonts used in output (not read into context)
|
|
60
|
+
* - `example` — working code samples for the agent to learn from
|
|
61
|
+
*/
|
|
62
|
+
export type SkillResourceType = "script" | "reference" | "asset" | "example";
|
|
63
|
+
/**
|
|
64
|
+
* A file bundled with a skill.
|
|
65
|
+
*
|
|
66
|
+
* Resources are discovered but NOT loaded into memory until the agent
|
|
67
|
+
* explicitly requests them. This is the L3 layer of progressive disclosure.
|
|
68
|
+
*/
|
|
69
|
+
export interface SkillResource {
|
|
70
|
+
/** Path relative to the skill's base directory */
|
|
71
|
+
relativePath: string;
|
|
72
|
+
/** Classified resource type */
|
|
73
|
+
type: SkillResourceType;
|
|
74
|
+
/**
|
|
75
|
+
* Absolute path on disk.
|
|
76
|
+
*
|
|
77
|
+
* Undefined for pack-contributed resources that carry inline content.
|
|
78
|
+
* Either `absolutePath` or `content` must be set.
|
|
79
|
+
*/
|
|
80
|
+
absolutePath?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Inline resource content.
|
|
83
|
+
*
|
|
84
|
+
* Set for pack-contributed resources that have no file on disk.
|
|
85
|
+
* Takes precedence over `absolutePath` when both are present.
|
|
86
|
+
*/
|
|
87
|
+
content?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Lightweight skill metadata parsed from SKILL.md YAML frontmatter.
|
|
91
|
+
*
|
|
92
|
+
* This is the **L1 layer** — always present in the system prompt so the
|
|
93
|
+
* agent knows which skills exist. Kept intentionally small (~100 words each)
|
|
94
|
+
* to minimize baseline context cost.
|
|
95
|
+
*
|
|
96
|
+
* Uses YAML frontmatter in a SKILL.md file — the widely-adopted
|
|
97
|
+
* canonical format for skill definitions.
|
|
98
|
+
*/
|
|
99
|
+
export interface SkillMetadata {
|
|
100
|
+
/** Unique skill identifier (from frontmatter `name`) */
|
|
101
|
+
name: string;
|
|
102
|
+
/**
|
|
103
|
+
* When to use this skill — the single most important field.
|
|
104
|
+
*
|
|
105
|
+
* This description is what the agent reads to decide whether to
|
|
106
|
+
* activate the skill. Should contain trigger phrases that match
|
|
107
|
+
* task types. Written for another LLM to consume, not humans.
|
|
108
|
+
*/
|
|
109
|
+
description: string;
|
|
110
|
+
/** Semantic version (from frontmatter, optional) */
|
|
111
|
+
version?: string;
|
|
112
|
+
/** Scope that determines override priority */
|
|
113
|
+
scope: SkillScope;
|
|
114
|
+
/** How this skill was obtained */
|
|
115
|
+
source: SkillSource;
|
|
116
|
+
/**
|
|
117
|
+
* Absolute path to the SKILL.md file.
|
|
118
|
+
*
|
|
119
|
+
* Undefined for pack-contributed skills that have no file on disk.
|
|
120
|
+
* When undefined, content must be pre-cached — use `SkillRegistry.register()`
|
|
121
|
+
* with a pre-built `SkillContent`.
|
|
122
|
+
*/
|
|
123
|
+
filePath?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Directory containing the skill (parent of SKILL.md).
|
|
126
|
+
*
|
|
127
|
+
* Undefined for pack-contributed skills with no file on disk.
|
|
128
|
+
*/
|
|
129
|
+
baseDir?: string;
|
|
130
|
+
/** Optional tags for categorization */
|
|
131
|
+
tags?: string[];
|
|
132
|
+
/**
|
|
133
|
+
* Names of skills this skill depends on.
|
|
134
|
+
* When this skill is loaded, its dependencies are suggested to be loaded too.
|
|
135
|
+
*/
|
|
136
|
+
dependencies?: string[];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Full skill content including the markdown body and resource listing.
|
|
140
|
+
*
|
|
141
|
+
* This is the **L2 layer** — loaded only when the agent calls the skill
|
|
142
|
+
* tool. Contains the actual instructions plus awareness of bundled resources.
|
|
143
|
+
*/
|
|
144
|
+
export interface SkillContent extends SkillMetadata {
|
|
145
|
+
/**
|
|
146
|
+
* The full markdown body of SKILL.md (everything below the frontmatter).
|
|
147
|
+
* This is the core instructional content injected into the conversation.
|
|
148
|
+
*/
|
|
149
|
+
body: string;
|
|
150
|
+
/**
|
|
151
|
+
* Bundled resources discovered in the skill directory.
|
|
152
|
+
* Listed so the agent knows what's available but not yet loaded.
|
|
153
|
+
*/
|
|
154
|
+
resources: SkillResource[];
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Configuration for skill discovery and loading.
|
|
158
|
+
*
|
|
159
|
+
* Controls where skills are found, how deep to scan, and which
|
|
160
|
+
* external conventions to support.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* const skillConfig: SkillConfig = {
|
|
165
|
+
* // Scan standard locations
|
|
166
|
+
* externalDirs: [".agents", ".claude"],
|
|
167
|
+
* // Add custom skill roots
|
|
168
|
+
* roots: ["./company-skills"],
|
|
169
|
+
* // Limit scan depth for performance
|
|
170
|
+
* maxScanDepth: 4,
|
|
171
|
+
* };
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
export interface SkillConfig {
|
|
175
|
+
/**
|
|
176
|
+
* Additional directories to scan for skills (absolute or relative to cwd).
|
|
177
|
+
* Each directory is scanned recursively for SKILL.md files.
|
|
178
|
+
*/
|
|
179
|
+
roots?: string[];
|
|
180
|
+
/**
|
|
181
|
+
* External skill directory names to scan in project and home directories.
|
|
182
|
+
*
|
|
183
|
+
* These are checked as `<project>/<dir>/skills/` and `~/<dir>/skills/`.
|
|
184
|
+
* Supports `.claude` and `.agents` directory conventions.
|
|
185
|
+
*
|
|
186
|
+
* @default [".agents", ".claude"]
|
|
187
|
+
*/
|
|
188
|
+
externalDirs?: string[];
|
|
189
|
+
/**
|
|
190
|
+
* Maximum directory depth to scan within each root.
|
|
191
|
+
* Higher values find more deeply nested skills but take longer.
|
|
192
|
+
*
|
|
193
|
+
* @default 4
|
|
194
|
+
*/
|
|
195
|
+
maxScanDepth?: number;
|
|
196
|
+
/**
|
|
197
|
+
* Maximum file size for SKILL.md files in bytes.
|
|
198
|
+
* Skills larger than this are skipped with a warning.
|
|
199
|
+
*
|
|
200
|
+
* @default 102400 (100KB)
|
|
201
|
+
*/
|
|
202
|
+
maxFileSize?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Enable fetching skills from remote URLs.
|
|
205
|
+
* When false, `remoteUrls` is ignored.
|
|
206
|
+
*
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
enableRemote?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Remote skill index URLs to fetch.
|
|
212
|
+
*
|
|
213
|
+
* Each URL should serve a JSON index listing available skills.
|
|
214
|
+
* See `RemoteSkillIndex` for the expected format.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* remoteUrls: ["https://skills.example.com/index.json"]
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
remoteUrls?: string[];
|
|
222
|
+
/**
|
|
223
|
+
* Cache directory for remote skills.
|
|
224
|
+
* Defaults to `~/.cache/cuylabs/skills/`.
|
|
225
|
+
*/
|
|
226
|
+
remoteCacheDir?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Include built-in skills bundled with agent-core.
|
|
229
|
+
* Currently reserved for future use.
|
|
230
|
+
*
|
|
231
|
+
* @default true
|
|
232
|
+
*/
|
|
233
|
+
includeBuiltin?: boolean;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Schema for remote skill index JSON files.
|
|
237
|
+
*
|
|
238
|
+
* Hosted at a URL like `https://skills.example.com/index.json`.
|
|
239
|
+
* Enables team-wide or organization-wide skill sharing.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```json
|
|
243
|
+
* {
|
|
244
|
+
* "version": 1,
|
|
245
|
+
* "skills": [
|
|
246
|
+
* {
|
|
247
|
+
* "name": "testing",
|
|
248
|
+
* "files": ["SKILL.md", "scripts/run-tests.sh", "references/patterns.md"]
|
|
249
|
+
* }
|
|
250
|
+
* ]
|
|
251
|
+
* }
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
export interface RemoteSkillIndex {
|
|
255
|
+
/** Schema version (currently 1) */
|
|
256
|
+
version: number;
|
|
257
|
+
/** List of available skills */
|
|
258
|
+
skills: RemoteSkillEntry[];
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* A single skill listing in a remote index.
|
|
262
|
+
*/
|
|
263
|
+
export interface RemoteSkillEntry {
|
|
264
|
+
/** Skill name (must match the `name` in SKILL.md frontmatter) */
|
|
265
|
+
name: string;
|
|
266
|
+
/** Relative file paths to download (SKILL.md is required) */
|
|
267
|
+
files: string[];
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Result of a full skill discovery pass.
|
|
271
|
+
*/
|
|
272
|
+
export interface SkillDiscoveryResult {
|
|
273
|
+
/** All discovered skills (deduplicated, scope-prioritized) */
|
|
274
|
+
skills: SkillMetadata[];
|
|
275
|
+
/** Skills that failed to load with reasons */
|
|
276
|
+
errors: SkillDiscoveryError[];
|
|
277
|
+
/** Total directories scanned */
|
|
278
|
+
dirsScanned: number;
|
|
279
|
+
/** Discovery duration in milliseconds */
|
|
280
|
+
durationMs: number;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* An error encountered during skill discovery.
|
|
284
|
+
*/
|
|
285
|
+
export interface SkillDiscoveryError {
|
|
286
|
+
/** Path that caused the error */
|
|
287
|
+
path: string;
|
|
288
|
+
/** What went wrong */
|
|
289
|
+
reason: string;
|
|
290
|
+
}
|
|
291
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/skill/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAMH;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6BAA6B;IAC7B,IAAI,EAAE,eAAe,CAAC;IACtB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;CACd;AAMD;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8CAA8C;IAC9C,KAAK,EAAE,UAAU,CAAC;IAElB,kCAAkC;IAClC,MAAM,EAAE,WAAW,CAAC;IAEpB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,EAAE,aAAa,EAAE,CAAC;CAC5B;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAMD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,8DAA8D;IAC9D,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,8CAA8C;IAC9C,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FileEntry } from "../types.js";
|
|
2
|
+
export declare function ensureStorageDirectory(directory: string): Promise<void>;
|
|
3
|
+
export declare function getSessionFilePath(directory: string, extension: string, sessionId: string): string;
|
|
4
|
+
export declare function loadEntriesFromDisk(filePath: string, sessionId: string): Promise<FileEntry[]>;
|
|
5
|
+
export declare function createSessionFile(filePath: string, header: FileEntry): Promise<void>;
|
|
6
|
+
export declare function appendSessionEntry(filePath: string, entry: FileEntry): Promise<void>;
|
|
7
|
+
export declare function appendSessionEntries(filePath: string, entries: FileEntry[]): Promise<void>;
|
|
8
|
+
export declare function sessionFileExists(filePath: string): boolean;
|
|
9
|
+
export declare function deleteSessionFile(filePath: string): Promise<boolean>;
|
|
10
|
+
export declare function listSessionIds(directory: string, extension: string): Promise<string[]>;
|
|
11
|
+
export declare function clearSessionFiles(directory: string, extension: string): Promise<void>;
|
|
12
|
+
export declare function getSessionFileStats(filePath: string): Promise<{
|
|
13
|
+
size: number;
|
|
14
|
+
mtime: Date;
|
|
15
|
+
} | null>;
|
|
16
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/storage/file/helpers.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAiBR;AAED,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,SAAS,EAAE,CAAC,CAUtB;AAED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,SAAS,EAAE,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAW1E;AAED,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,EAAE,CAAC,CASnB;AAED,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,CAU/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/file/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FileEntry, SessionEntry, SessionHeader, SessionInfo, SessionStorage } from "../types.js";
|
|
2
|
+
import type { FileStorageOptions } from "./types.js";
|
|
3
|
+
export declare class FileStorage implements SessionStorage {
|
|
4
|
+
private readonly directory;
|
|
5
|
+
private readonly extension;
|
|
6
|
+
private readonly useCache;
|
|
7
|
+
private cache;
|
|
8
|
+
private initialized;
|
|
9
|
+
constructor(options: FileStorageOptions);
|
|
10
|
+
private ensureDir;
|
|
11
|
+
private getPath;
|
|
12
|
+
private getEntries;
|
|
13
|
+
create(header: SessionHeader): Promise<void>;
|
|
14
|
+
append(sessionId: string, entry: SessionEntry): Promise<void>;
|
|
15
|
+
appendBatch(sessionId: string, entries: SessionEntry[]): Promise<void>;
|
|
16
|
+
read(sessionId: string): Promise<FileEntry[]>;
|
|
17
|
+
delete(sessionId: string): Promise<boolean>;
|
|
18
|
+
exists(sessionId: string): Promise<boolean>;
|
|
19
|
+
list(): Promise<SessionInfo[]>;
|
|
20
|
+
clear(): Promise<void>;
|
|
21
|
+
flushCache(): void;
|
|
22
|
+
reload(sessionId: string): Promise<FileEntry[]>;
|
|
23
|
+
listIds(): Promise<string[]>;
|
|
24
|
+
getStats(sessionId: string): Promise<{
|
|
25
|
+
size: number;
|
|
26
|
+
mtime: Date;
|
|
27
|
+
} | null>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/storage/file/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACf,MAAM,aAAa,CAAC;AAerB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,qBAAa,WAAY,YAAW,cAAc;IAChD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,KAAK,CAAkC;IAC/C,OAAO,CAAC,WAAW,CAAS;gBAEhB,OAAO,EAAE,kBAAkB;YAMzB,SAAS;IAMvB,OAAO,CAAC,OAAO;YAID,UAAU;IAgBlB,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAc5C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAe7D,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBtE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAK7C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK3C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3C,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAyB9B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,UAAU,IAAI,IAAI;IAIZ,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAK/C,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAK5B,QAAQ,CACZ,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CAGjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/storage/file/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,191 +1,14 @@
|
|
|
1
|
-
import { bQ as MessageRole, bf as FileEntry, ct as SessionEntry, M as Message, bK as MessageEntry, bS as MetadataEntry, cq as SerializedMessage, cv as SessionInfo, cw as SessionStorage, cu as SessionHeader, S as SessionManager } from '../instance-Bg61WSyz.js';
|
|
2
|
-
export { aA as BranchEntry, aF as CompactionEntry, aH as ConfigChangeEntry, aN as CreateSessionOptions, bc as EntryBase, bA as LocalSessionTurnLock, cg as RecentMessagesOptions, ch as ReleaseSessionTurnLock, cp as STORAGE_VERSION, cs as SessionContext, cx as SessionTurnLock, cy as SessionTurnLockAcquireOptions } from '../instance-Bg61WSyz.js';
|
|
3
|
-
import { L as Logger } from '../types-RSCv7nQ4.js';
|
|
4
|
-
import '../types-C_LCeYNg.js';
|
|
5
|
-
import 'ai';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import '../types-CQaXbRsS.js';
|
|
8
|
-
import '../types-DMjoFKKv.js';
|
|
9
|
-
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
10
|
-
import '@modelcontextprotocol/sdk/types.js';
|
|
11
|
-
import '@ai-sdk/provider-utils';
|
|
12
|
-
import '../sandbox/index.js';
|
|
13
|
-
import '../llm-error-D93FNNLY.js';
|
|
14
|
-
|
|
15
1
|
/**
|
|
16
|
-
* Storage
|
|
2
|
+
* Storage Module
|
|
17
3
|
*
|
|
18
|
-
*
|
|
4
|
+
* Session storage with tree structure, async I/O, and pluggable backends.
|
|
19
5
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*/
|
|
30
|
-
declare function parseJSONL<T>(content: string, logger?: Logger): T[];
|
|
31
|
-
/**
|
|
32
|
-
* Serialize entry to JSONL line
|
|
33
|
-
*/
|
|
34
|
-
declare function toJSONL(entry: FileEntry): string;
|
|
35
|
-
/**
|
|
36
|
-
* Serialize multiple entries to JSONL
|
|
37
|
-
*/
|
|
38
|
-
declare function toJSONLBatch(entries: FileEntry[]): string;
|
|
39
|
-
/**
|
|
40
|
-
* Serialize a Message to storage format
|
|
41
|
-
*/
|
|
42
|
-
declare function serializeMessage(message: Message): SerializedMessage;
|
|
43
|
-
/**
|
|
44
|
-
* Deserialize a stored message back to Message
|
|
45
|
-
*/
|
|
46
|
-
declare function deserializeMessage(serialized: SerializedMessage): Message;
|
|
47
|
-
/**
|
|
48
|
-
* Create a message entry from a Message
|
|
49
|
-
*/
|
|
50
|
-
declare function createMessageEntry(message: Message, parentId: string | null, existingIds?: Set<string>): MessageEntry;
|
|
51
|
-
/**
|
|
52
|
-
* Create a metadata entry
|
|
53
|
-
*/
|
|
54
|
-
declare function createMetadataEntry(updates: {
|
|
55
|
-
title?: string;
|
|
56
|
-
name?: string;
|
|
57
|
-
}, parentId: string | null, existingIds?: Set<string>): MetadataEntry;
|
|
58
|
-
/**
|
|
59
|
-
* Extract SessionInfo from entries (for listing)
|
|
60
|
-
*/
|
|
61
|
-
declare function extractSessionInfo(entries: FileEntry[], path: string): SessionInfo | null;
|
|
62
|
-
/**
|
|
63
|
-
* Get leaf entry ID (last entry in the chain)
|
|
64
|
-
*/
|
|
65
|
-
declare function getLeafId(entries: FileEntry[]): string | null;
|
|
66
|
-
/**
|
|
67
|
-
* Build path from root to a specific entry
|
|
68
|
-
*/
|
|
69
|
-
declare function buildEntryPath(entries: FileEntry[], targetId: string): SessionEntry[];
|
|
70
|
-
/**
|
|
71
|
-
* Build messages array from entries for a specific leaf
|
|
72
|
-
* Handles compaction summaries
|
|
73
|
-
*/
|
|
74
|
-
declare function buildMessagesFromEntries(entries: FileEntry[], leafId?: string): Message[];
|
|
75
|
-
interface BuildRecentMessagesOptions {
|
|
76
|
-
leafId?: string;
|
|
77
|
-
limit?: number;
|
|
78
|
-
roles?: readonly MessageRole[];
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Build the last N visible messages from a session path without materializing
|
|
82
|
-
* the full message list when only a bounded suffix is needed.
|
|
83
|
-
*/
|
|
84
|
-
declare function buildRecentMessagesFromEntries(entries: FileEntry[], options?: BuildRecentMessagesOptions): Message[];
|
|
85
|
-
/**
|
|
86
|
-
* Build the last N visible messages from an existing entry index.
|
|
87
|
-
*/
|
|
88
|
-
declare function buildRecentMessagesFromEntryMap(entriesById: ReadonlyMap<string, SessionEntry>, leafId: string | undefined, options?: Omit<BuildRecentMessagesOptions, "leafId">): Message[];
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Memory Session Storage
|
|
92
|
-
*
|
|
93
|
-
* In-memory implementation of SessionStorage.
|
|
94
|
-
* Useful for testing and ephemeral sessions.
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* In-memory session storage
|
|
99
|
-
*/
|
|
100
|
-
declare class MemoryStorage implements SessionStorage {
|
|
101
|
-
private sessions;
|
|
102
|
-
create(header: SessionHeader): Promise<void>;
|
|
103
|
-
append(sessionId: string, entry: SessionEntry): Promise<void>;
|
|
104
|
-
appendBatch(sessionId: string, entries: SessionEntry[]): Promise<void>;
|
|
105
|
-
read(sessionId: string): Promise<FileEntry[]>;
|
|
106
|
-
delete(sessionId: string): Promise<boolean>;
|
|
107
|
-
exists(sessionId: string): Promise<boolean>;
|
|
108
|
-
list(): Promise<SessionInfo[]>;
|
|
109
|
-
clear(): Promise<void>;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
interface FileStorageOptions {
|
|
113
|
-
directory: string;
|
|
114
|
-
extension?: string;
|
|
115
|
-
cache?: boolean;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
declare class FileStorage implements SessionStorage {
|
|
119
|
-
private readonly directory;
|
|
120
|
-
private readonly extension;
|
|
121
|
-
private readonly useCache;
|
|
122
|
-
private cache;
|
|
123
|
-
private initialized;
|
|
124
|
-
constructor(options: FileStorageOptions);
|
|
125
|
-
private ensureDir;
|
|
126
|
-
private getPath;
|
|
127
|
-
private getEntries;
|
|
128
|
-
create(header: SessionHeader): Promise<void>;
|
|
129
|
-
append(sessionId: string, entry: SessionEntry): Promise<void>;
|
|
130
|
-
appendBatch(sessionId: string, entries: SessionEntry[]): Promise<void>;
|
|
131
|
-
read(sessionId: string): Promise<FileEntry[]>;
|
|
132
|
-
delete(sessionId: string): Promise<boolean>;
|
|
133
|
-
exists(sessionId: string): Promise<boolean>;
|
|
134
|
-
list(): Promise<SessionInfo[]>;
|
|
135
|
-
clear(): Promise<void>;
|
|
136
|
-
flushCache(): void;
|
|
137
|
-
reload(sessionId: string): Promise<FileEntry[]>;
|
|
138
|
-
listIds(): Promise<string[]>;
|
|
139
|
-
getStats(sessionId: string): Promise<{
|
|
140
|
-
size: number;
|
|
141
|
-
mtime: Date;
|
|
142
|
-
} | null>;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Default paths for storage
|
|
147
|
-
*
|
|
148
|
-
* Follows platform conventions:
|
|
149
|
-
* - macOS: ~/.cuylabs/
|
|
150
|
-
* - Linux: $XDG_DATA_HOME/cuylabs/ or ~/.local/share/cuylabs/
|
|
151
|
-
* - Windows: %APPDATA%/cuylabs/
|
|
152
|
-
*
|
|
153
|
-
* Project identification:
|
|
154
|
-
* - Uses git root commit hash for git repos
|
|
155
|
-
* - Falls back to encoded path for non-git directories
|
|
156
|
-
*/
|
|
157
|
-
/**
|
|
158
|
-
* Get the default data directory for cuylabs
|
|
159
|
-
*/
|
|
160
|
-
declare function getDataDir(appName?: string): string;
|
|
161
|
-
/**
|
|
162
|
-
* Get the default sessions directory
|
|
163
|
-
*/
|
|
164
|
-
declare function getSessionsDir(appName?: string): string;
|
|
165
|
-
/**
|
|
166
|
-
* Get the git root commit hash for a directory.
|
|
167
|
-
* This is stable across machines and identifies the project uniquely.
|
|
168
|
-
* Returns null if not a git repo.
|
|
169
|
-
*/
|
|
170
|
-
declare function getGitRootHash(cwd: string): string | null;
|
|
171
|
-
/**
|
|
172
|
-
* Get a short project ID for a directory.
|
|
173
|
-
* - For git repos: uses first 12 chars of root commit hash
|
|
174
|
-
* - For non-git: uses encoded path
|
|
175
|
-
*/
|
|
176
|
-
declare function getProjectId(cwd: string): string;
|
|
177
|
-
/**
|
|
178
|
-
* Get sessions directory for a specific project/cwd
|
|
179
|
-
*/
|
|
180
|
-
declare function getProjectSessionsDir(cwd: string, appName?: string): string;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Get the default session-manager instance.
|
|
184
|
-
*/
|
|
185
|
-
declare function getDefaultSessionManager(): SessionManager;
|
|
186
|
-
/**
|
|
187
|
-
* Replace the default session-manager instance with one backed by custom storage.
|
|
188
|
-
*/
|
|
189
|
-
declare function configureDefaultSessionManager(storage: SessionStorage): SessionManager;
|
|
190
|
-
|
|
191
|
-
export { type BuildRecentMessagesOptions, FileEntry, FileStorage, type FileStorageOptions, MemoryStorage, MessageEntry, MetadataEntry, SerializedMessage, SessionEntry, SessionHeader, SessionInfo, SessionManager, SessionStorage, buildEntryPath, buildMessagesFromEntries, buildRecentMessagesFromEntries, buildRecentMessagesFromEntryMap, configureDefaultSessionManager, createMessageEntry, createMetadataEntry, deserializeMessage, extractSessionInfo, generateEntryId, getDataDir, getDefaultSessionManager, getGitRootHash, getLeafId, getProjectId, getProjectSessionsDir, getSessionsDir, parseJSONL, serializeMessage, toJSONL, toJSONLBatch };
|
|
6
|
+
export type { EntryBase, SessionHeader, SerializedMessage, MessageEntry, CompactionEntry, MetadataEntry, BranchEntry, ConfigChangeEntry, SessionEntry, FileEntry, SessionInfo, SessionStorage, } from "./types.js";
|
|
7
|
+
export { STORAGE_VERSION } from "./types.js";
|
|
8
|
+
export { generateEntryId, parseJSONL, toJSONL, toJSONLBatch, serializeMessage, deserializeMessage, createMessageEntry, createMetadataEntry, extractSessionInfo, getLeafId, buildEntryPath, buildMessagesFromEntries, buildRecentMessagesFromEntries, buildRecentMessagesFromEntryMap, type BuildRecentMessagesOptions, } from "./utils.js";
|
|
9
|
+
export { MemoryStorage } from "./memory.js";
|
|
10
|
+
export { FileStorage, type FileStorageOptions } from "./file/index.js";
|
|
11
|
+
export { LocalSessionTurnLock, type ReleaseSessionTurnLock, type SessionTurnLock, type SessionTurnLockAcquireOptions, } from "./lock.js";
|
|
12
|
+
export { getDataDir, getSessionsDir, getProjectSessionsDir, getProjectId, getGitRootHash, } from "./paths.js";
|
|
13
|
+
export { SessionManager, getDefaultSessionManager, configureDefaultSessionManager, type CreateSessionOptions, type RecentMessagesOptions, type SessionContext, } from "./manager/index.js";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAEV,SAAS,EACT,aAAa,EACb,iBAAiB,EAEjB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,SAAS,EAET,WAAW,EAEX,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EACL,eAAe,EACf,UAAU,EACV,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,KAAK,0BAA0B,GAChC,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,6BAA6B,GACnC,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,cAAc,GACf,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,8BAA8B,EAC9B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC"}
|