@gencode/agents 0.0.9 → 0.0.11
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/dist/builtin-provider-C0d7-NZt.js +66 -0
- package/dist/config/index.d.ts +2 -9
- package/dist/config/index.js +1 -9
- package/dist/config-DG3Q1aJ6.js +1 -0
- package/dist/{index-JD6Ye-N5.d.ts → index-BdfpRxFA.d.ts} +7 -8
- package/dist/index.d.ts +1603 -40
- package/dist/index.js +504 -35
- package/dist/provider-registry-rVbsCDN2.js +1 -0
- package/dist/rolldown-runtime-CNxR59P3.js +1 -0
- package/package.json +2 -2
- package/dist/bootstrap/bootstrap-layout.d.ts +0 -23
- package/dist/bootstrap/bootstrap-layout.d.ts.map +0 -1
- package/dist/bootstrap/bootstrap-layout.js +0 -151
- package/dist/bootstrap/bootstrap-layout.js.map +0 -1
- package/dist/bootstrap/bootstrap.d.ts +0 -36
- package/dist/bootstrap/bootstrap.d.ts.map +0 -1
- package/dist/bootstrap/bootstrap.js +0 -136
- package/dist/bootstrap/bootstrap.js.map +0 -1
- package/dist/bootstrap/templates/AGENTS_MD.d.ts +0 -2
- package/dist/bootstrap/templates/AGENTS_MD.d.ts.map +0 -1
- package/dist/bootstrap/templates/AGENTS_MD.js +0 -223
- package/dist/bootstrap/templates/AGENTS_MD.js.map +0 -1
- package/dist/bootstrap/templates/BOOTSTRAP_MD.d.ts +0 -2
- package/dist/bootstrap/templates/BOOTSTRAP_MD.d.ts.map +0 -1
- package/dist/bootstrap/templates/BOOTSTRAP_MD.js +0 -66
- package/dist/bootstrap/templates/BOOTSTRAP_MD.js.map +0 -1
- package/dist/bootstrap/templates/HEARTBEAT_MD.d.ts +0 -2
- package/dist/bootstrap/templates/HEARTBEAT_MD.d.ts.map +0 -1
- package/dist/bootstrap/templates/HEARTBEAT_MD.js +0 -16
- package/dist/bootstrap/templates/HEARTBEAT_MD.js.map +0 -1
- package/dist/bootstrap/templates/IDENTITY_MD.d.ts +0 -2
- package/dist/bootstrap/templates/IDENTITY_MD.d.ts.map +0 -1
- package/dist/bootstrap/templates/IDENTITY_MD.js +0 -31
- package/dist/bootstrap/templates/IDENTITY_MD.js.map +0 -1
- package/dist/bootstrap/templates/SOUL_MD.d.ts +0 -2
- package/dist/bootstrap/templates/SOUL_MD.d.ts.map +0 -1
- package/dist/bootstrap/templates/SOUL_MD.js +0 -47
- package/dist/bootstrap/templates/SOUL_MD.js.map +0 -1
- package/dist/bootstrap/templates/TOOLS_MD.d.ts +0 -2
- package/dist/bootstrap/templates/TOOLS_MD.d.ts.map +0 -1
- package/dist/bootstrap/templates/TOOLS_MD.js +0 -51
- package/dist/bootstrap/templates/TOOLS_MD.js.map +0 -1
- package/dist/bootstrap/templates/USER_MD.d.ts +0 -2
- package/dist/bootstrap/templates/USER_MD.d.ts.map +0 -1
- package/dist/bootstrap/templates/USER_MD.js +0 -27
- package/dist/bootstrap/templates/USER_MD.js.map +0 -1
- package/dist/bootstrap/templates/index.d.ts +0 -3
- package/dist/bootstrap/templates/index.d.ts.map +0 -1
- package/dist/bootstrap/templates/index.js +0 -26
- package/dist/bootstrap/templates/index.js.map +0 -1
- package/dist/commands/compact.d.ts +0 -28
- package/dist/commands/compact.d.ts.map +0 -1
- package/dist/commands/compact.js +0 -57
- package/dist/commands/compact.js.map +0 -1
- package/dist/commands/help.d.ts +0 -3
- package/dist/commands/help.d.ts.map +0 -1
- package/dist/commands/help.js +0 -50
- package/dist/commands/help.js.map +0 -1
- package/dist/commands/index.d.ts +0 -6
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -32
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/new.d.ts +0 -3
- package/dist/commands/new.d.ts.map +0 -1
- package/dist/commands/new.js +0 -15
- package/dist/commands/new.js.map +0 -1
- package/dist/commands/registry.d.ts +0 -11
- package/dist/commands/registry.d.ts.map +0 -1
- package/dist/commands/registry.js +0 -122
- package/dist/commands/registry.js.map +0 -1
- package/dist/commands/reset.d.ts +0 -3
- package/dist/commands/reset.d.ts.map +0 -1
- package/dist/commands/reset.js +0 -4
- package/dist/commands/reset.js.map +0 -1
- package/dist/commands/skill.d.ts +0 -7
- package/dist/commands/skill.d.ts.map +0 -1
- package/dist/commands/skill.js +0 -23
- package/dist/commands/skill.js.map +0 -1
- package/dist/commands/types.d.ts +0 -57
- package/dist/commands/types.d.ts.map +0 -1
- package/dist/commands/types.js +0 -2
- package/dist/commands/types.js.map +0 -1
- package/dist/config/agents-config.d.ts +0 -85
- package/dist/config/agents-config.d.ts.map +0 -1
- package/dist/config/agents-config.js +0 -257
- package/dist/config/agents-config.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/types.d.ts +0 -87
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js +0 -6
- package/dist/config/types.js.map +0 -1
- package/dist/config-DJX-VM7S.js +0 -198
- package/dist/config-DJX-VM7S.js.map +0 -1
- package/dist/history/compaction.d.ts +0 -42
- package/dist/history/compaction.d.ts.map +0 -1
- package/dist/history/compaction.js +0 -135
- package/dist/history/compaction.js.map +0 -1
- package/dist/history/index.d.ts +0 -57
- package/dist/history/index.d.ts.map +0 -1
- package/dist/history/index.js +0 -145
- package/dist/history/index.js.map +0 -1
- package/dist/history/limit.d.ts +0 -13
- package/dist/history/limit.d.ts.map +0 -1
- package/dist/history/limit.js +0 -32
- package/dist/history/limit.js.map +0 -1
- package/dist/history/repair.d.ts +0 -13
- package/dist/history/repair.d.ts.map +0 -1
- package/dist/history/repair.js +0 -25
- package/dist/history/repair.js.map +0 -1
- package/dist/history/token-estimate.d.ts +0 -22
- package/dist/history/token-estimate.d.ts.map +0 -1
- package/dist/history/token-estimate.js +0 -38
- package/dist/history/token-estimate.js.map +0 -1
- package/dist/index-JD6Ye-N5.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/llm/client.d.ts +0 -53
- package/dist/llm/client.d.ts.map +0 -1
- package/dist/llm/client.js +0 -214
- package/dist/llm/client.js.map +0 -1
- package/dist/llm/openai-completions-compat.d.ts +0 -23
- package/dist/llm/openai-completions-compat.d.ts.map +0 -1
- package/dist/llm/openai-completions-compat.js +0 -602
- package/dist/llm/openai-completions-compat.js.map +0 -1
- package/dist/llm/openai-stream-error.d.ts +0 -11
- package/dist/llm/openai-stream-error.d.ts.map +0 -1
- package/dist/llm/openai-stream-error.js +0 -77
- package/dist/llm/openai-stream-error.js.map +0 -1
- package/dist/loop-detection/session-state.d.ts +0 -5
- package/dist/loop-detection/session-state.d.ts.map +0 -1
- package/dist/loop-detection/session-state.js +0 -16
- package/dist/loop-detection/session-state.js.map +0 -1
- package/dist/loop-detection/tool-loop-detection.d.ts +0 -122
- package/dist/loop-detection/tool-loop-detection.d.ts.map +0 -1
- package/dist/loop-detection/tool-loop-detection.js +0 -516
- package/dist/loop-detection/tool-loop-detection.js.map +0 -1
- package/dist/manager-qXa-NP0p.js +0 -1651
- package/dist/manager-qXa-NP0p.js.map +0 -1
- package/dist/memory/builtin-provider.d.ts +0 -5
- package/dist/memory/builtin-provider.d.ts.map +0 -1
- package/dist/memory/builtin-provider.js +0 -42
- package/dist/memory/builtin-provider.js.map +0 -1
- package/dist/memory/config.d.ts +0 -50
- package/dist/memory/config.d.ts.map +0 -1
- package/dist/memory/config.js +0 -46
- package/dist/memory/config.js.map +0 -1
- package/dist/memory/embedding-registry.d.ts +0 -37
- package/dist/memory/embedding-registry.d.ts.map +0 -1
- package/dist/memory/embedding-registry.js +0 -56
- package/dist/memory/embedding-registry.js.map +0 -1
- package/dist/memory/embeddings.d.ts +0 -11
- package/dist/memory/embeddings.d.ts.map +0 -1
- package/dist/memory/embeddings.js +0 -40
- package/dist/memory/embeddings.js.map +0 -1
- package/dist/memory/fs-utils.d.ts +0 -12
- package/dist/memory/fs-utils.d.ts.map +0 -1
- package/dist/memory/fs-utils.js +0 -24
- package/dist/memory/fs-utils.js.map +0 -1
- package/dist/memory/hybrid.d.ts +0 -43
- package/dist/memory/hybrid.d.ts.map +0 -1
- package/dist/memory/hybrid.js +0 -80
- package/dist/memory/hybrid.js.map +0 -1
- package/dist/memory/internal.d.ts +0 -28
- package/dist/memory/internal.d.ts.map +0 -1
- package/dist/memory/internal.js +0 -270
- package/dist/memory/internal.js.map +0 -1
- package/dist/memory/manager-search.d.ts +0 -61
- package/dist/memory/manager-search.d.ts.map +0 -1
- package/dist/memory/manager-search.js +0 -106
- package/dist/memory/manager-search.js.map +0 -1
- package/dist/memory/manager.d.ts +0 -126
- package/dist/memory/manager.d.ts.map +0 -1
- package/dist/memory/manager.js +0 -1006
- package/dist/memory/manager.js.map +0 -1
- package/dist/memory/memory-schema.d.ts +0 -11
- package/dist/memory/memory-schema.d.ts.map +0 -1
- package/dist/memory/memory-schema.js +0 -78
- package/dist/memory/memory-schema.js.map +0 -1
- package/dist/memory/memory.d.ts +0 -46
- package/dist/memory/memory.d.ts.map +0 -1
- package/dist/memory/memory.js +0 -127
- package/dist/memory/memory.js.map +0 -1
- package/dist/memory/mmr.d.ts +0 -22
- package/dist/memory/mmr.d.ts.map +0 -1
- package/dist/memory/mmr.js +0 -112
- package/dist/memory/mmr.js.map +0 -1
- package/dist/memory/provider-registry.d.ts +0 -29
- package/dist/memory/provider-registry.d.ts.map +0 -1
- package/dist/memory/provider-registry.js +0 -58
- package/dist/memory/provider-registry.js.map +0 -1
- package/dist/memory/provider.d.ts +0 -40
- package/dist/memory/provider.d.ts.map +0 -1
- package/dist/memory/provider.js +0 -2
- package/dist/memory/provider.js.map +0 -1
- package/dist/memory/session-files.d.ts +0 -13
- package/dist/memory/session-files.d.ts.map +0 -1
- package/dist/memory/session-files.js +0 -116
- package/dist/memory/session-files.js.map +0 -1
- package/dist/memory/sqlite-vec.d.ts +0 -10
- package/dist/memory/sqlite-vec.d.ts.map +0 -1
- package/dist/memory/sqlite-vec.js +0 -20
- package/dist/memory/sqlite-vec.js.map +0 -1
- package/dist/memory/sqlite.d.ts +0 -2
- package/dist/memory/sqlite.d.ts.map +0 -1
- package/dist/memory/sqlite.js +0 -12
- package/dist/memory/sqlite.js.map +0 -1
- package/dist/memory/temporal-decay.d.ts +0 -26
- package/dist/memory/temporal-decay.d.ts.map +0 -1
- package/dist/memory/temporal-decay.js +0 -119
- package/dist/memory/temporal-decay.js.map +0 -1
- package/dist/memory/watch-bridge.d.ts +0 -20
- package/dist/memory/watch-bridge.d.ts.map +0 -1
- package/dist/memory/watch-bridge.js +0 -128
- package/dist/memory/watch-bridge.js.map +0 -1
- package/dist/message.d.ts +0 -11
- package/dist/message.d.ts.map +0 -1
- package/dist/message.js +0 -46
- package/dist/message.js.map +0 -1
- package/dist/plugins/boundary-file-read.d.ts +0 -13
- package/dist/plugins/boundary-file-read.d.ts.map +0 -1
- package/dist/plugins/boundary-file-read.js +0 -31
- package/dist/plugins/boundary-file-read.js.map +0 -1
- package/dist/plugins/config-state.d.ts +0 -35
- package/dist/plugins/config-state.d.ts.map +0 -1
- package/dist/plugins/config-state.js +0 -97
- package/dist/plugins/config-state.js.map +0 -1
- package/dist/plugins/discovery.d.ts +0 -21
- package/dist/plugins/discovery.d.ts.map +0 -1
- package/dist/plugins/discovery.js +0 -425
- package/dist/plugins/discovery.js.map +0 -1
- package/dist/plugins/hooks.d.ts +0 -133
- package/dist/plugins/hooks.d.ts.map +0 -1
- package/dist/plugins/hooks.js +0 -19
- package/dist/plugins/hooks.js.map +0 -1
- package/dist/plugins/index.d.ts +0 -20
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -11
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/loader.d.ts +0 -60
- package/dist/plugins/loader.d.ts.map +0 -1
- package/dist/plugins/loader.js +0 -224
- package/dist/plugins/loader.js.map +0 -1
- package/dist/plugins/manager.d.ts +0 -20
- package/dist/plugins/manager.d.ts.map +0 -1
- package/dist/plugins/manager.js +0 -33
- package/dist/plugins/manager.js.map +0 -1
- package/dist/plugins/manifest-registry.d.ts +0 -15
- package/dist/plugins/manifest-registry.d.ts.map +0 -1
- package/dist/plugins/manifest-registry.js +0 -37
- package/dist/plugins/manifest-registry.js.map +0 -1
- package/dist/plugins/manifest.d.ts +0 -6
- package/dist/plugins/manifest.d.ts.map +0 -1
- package/dist/plugins/manifest.js +0 -80
- package/dist/plugins/manifest.js.map +0 -1
- package/dist/plugins/path-safety.d.ts +0 -6
- package/dist/plugins/path-safety.d.ts.map +0 -1
- package/dist/plugins/path-safety.js +0 -32
- package/dist/plugins/path-safety.js.map +0 -1
- package/dist/plugins/runtime-context.d.ts +0 -12
- package/dist/plugins/runtime-context.d.ts.map +0 -1
- package/dist/plugins/runtime-context.js +0 -2
- package/dist/plugins/runtime-context.js.map +0 -1
- package/dist/plugins/runtime.d.ts +0 -20
- package/dist/plugins/runtime.d.ts.map +0 -1
- package/dist/plugins/runtime.js +0 -33
- package/dist/plugins/runtime.js.map +0 -1
- package/dist/plugins/schema-validator.d.ts +0 -17
- package/dist/plugins/schema-validator.d.ts.map +0 -1
- package/dist/plugins/schema-validator.js +0 -26
- package/dist/plugins/schema-validator.js.map +0 -1
- package/dist/plugins/tool-hooks.d.ts +0 -4
- package/dist/plugins/tool-hooks.d.ts.map +0 -1
- package/dist/plugins/tool-hooks.js +0 -63
- package/dist/plugins/tool-hooks.js.map +0 -1
- package/dist/plugins/tools.d.ts +0 -20
- package/dist/plugins/tools.d.ts.map +0 -1
- package/dist/plugins/tools.js +0 -42
- package/dist/plugins/tools.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -61
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/plugins/types.js +0 -2
- package/dist/plugins/types.js.map +0 -1
- package/dist/plugins/utils.d.ts +0 -4
- package/dist/plugins/utils.d.ts.map +0 -1
- package/dist/plugins/utils.js +0 -22
- package/dist/plugins/utils.js.map +0 -1
- package/dist/runner/agent-runtime.d.ts +0 -62
- package/dist/runner/agent-runtime.d.ts.map +0 -1
- package/dist/runner/agent-runtime.js +0 -186
- package/dist/runner/agent-runtime.js.map +0 -1
- package/dist/runner/announce-loop.d.ts +0 -41
- package/dist/runner/announce-loop.d.ts.map +0 -1
- package/dist/runner/announce-loop.js +0 -94
- package/dist/runner/announce-loop.js.map +0 -1
- package/dist/runner/event-dispatcher.d.ts +0 -12
- package/dist/runner/event-dispatcher.d.ts.map +0 -1
- package/dist/runner/event-dispatcher.js +0 -18
- package/dist/runner/event-dispatcher.js.map +0 -1
- package/dist/runner/finalizer.d.ts +0 -30
- package/dist/runner/finalizer.d.ts.map +0 -1
- package/dist/runner/finalizer.js +0 -75
- package/dist/runner/finalizer.js.map +0 -1
- package/dist/runner/invocation-resolver.d.ts +0 -67
- package/dist/runner/invocation-resolver.d.ts.map +0 -1
- package/dist/runner/invocation-resolver.js +0 -224
- package/dist/runner/invocation-resolver.js.map +0 -1
- package/dist/runner/plugin-context.d.ts +0 -18
- package/dist/runner/plugin-context.d.ts.map +0 -1
- package/dist/runner/plugin-context.js +0 -26
- package/dist/runner/plugin-context.js.map +0 -1
- package/dist/runner/run-context.d.ts +0 -38
- package/dist/runner/run-context.d.ts.map +0 -1
- package/dist/runner/run-context.js +0 -159
- package/dist/runner/run-context.js.map +0 -1
- package/dist/runner/runner-session.d.ts +0 -34
- package/dist/runner/runner-session.d.ts.map +0 -1
- package/dist/runner/runner-session.js +0 -61
- package/dist/runner/runner-session.js.map +0 -1
- package/dist/runner/runner.d.ts +0 -13
- package/dist/runner/runner.d.ts.map +0 -1
- package/dist/runner/runner.js +0 -234
- package/dist/runner/runner.js.map +0 -1
- package/dist/runner/runtime.d.ts +0 -7
- package/dist/runner/runtime.d.ts.map +0 -1
- package/dist/runner/runtime.js +0 -21
- package/dist/runner/runtime.js.map +0 -1
- package/dist/runner/session-lifecycle.d.ts +0 -31
- package/dist/runner/session-lifecycle.d.ts.map +0 -1
- package/dist/runner/session-lifecycle.js +0 -38
- package/dist/runner/session-lifecycle.js.map +0 -1
- package/dist/runner/skill-usage.d.ts +0 -29
- package/dist/runner/skill-usage.d.ts.map +0 -1
- package/dist/runner/skill-usage.js +0 -65
- package/dist/runner/skill-usage.js.map +0 -1
- package/dist/runner/title.d.ts +0 -3
- package/dist/runner/title.d.ts.map +0 -1
- package/dist/runner/title.js +0 -6
- package/dist/runner/title.js.map +0 -1
- package/dist/runner/turn-executor.d.ts +0 -51
- package/dist/runner/turn-executor.d.ts.map +0 -1
- package/dist/runner/turn-executor.js +0 -294
- package/dist/runner/turn-executor.js.map +0 -1
- package/dist/security/command-dangerous-rules.d.ts +0 -4
- package/dist/security/command-dangerous-rules.d.ts.map +0 -1
- package/dist/security/command-dangerous-rules.js +0 -26
- package/dist/security/command-dangerous-rules.js.map +0 -1
- package/dist/security/command-parser.d.ts +0 -3
- package/dist/security/command-parser.d.ts.map +0 -1
- package/dist/security/command-parser.js +0 -191
- package/dist/security/command-parser.js.map +0 -1
- package/dist/security/command-path-guard.d.ts +0 -10
- package/dist/security/command-path-guard.d.ts.map +0 -1
- package/dist/security/command-path-guard.js +0 -126
- package/dist/security/command-path-guard.js.map +0 -1
- package/dist/security/command-policy-config.d.ts +0 -5
- package/dist/security/command-policy-config.d.ts.map +0 -1
- package/dist/security/command-policy-config.js +0 -212
- package/dist/security/command-policy-config.js.map +0 -1
- package/dist/security/command-policy-engine.d.ts +0 -8
- package/dist/security/command-policy-engine.d.ts.map +0 -1
- package/dist/security/command-policy-engine.js +0 -122
- package/dist/security/command-policy-engine.js.map +0 -1
- package/dist/security/command-policy-types.d.ts +0 -67
- package/dist/security/command-policy-types.d.ts.map +0 -1
- package/dist/security/command-policy-types.js +0 -2
- package/dist/security/command-policy-types.js.map +0 -1
- package/dist/security/command-safe-bins.d.ts +0 -4
- package/dist/security/command-safe-bins.d.ts.map +0 -1
- package/dist/security/command-safe-bins.js +0 -84
- package/dist/security/command-safe-bins.js.map +0 -1
- package/dist/security/command-trusted-executables.d.ts +0 -6
- package/dist/security/command-trusted-executables.d.ts.map +0 -1
- package/dist/security/command-trusted-executables.js +0 -57
- package/dist/security/command-trusted-executables.js.map +0 -1
- package/dist/session/session.d.ts +0 -45
- package/dist/session/session.d.ts.map +0 -1
- package/dist/session/session.js +0 -167
- package/dist/session/session.js.map +0 -1
- package/dist/skills/skills.d.ts +0 -23
- package/dist/skills/skills.d.ts.map +0 -1
- package/dist/skills/skills.js +0 -109
- package/dist/skills/skills.js.map +0 -1
- package/dist/subagent/registry-persist.d.ts +0 -31
- package/dist/subagent/registry-persist.d.ts.map +0 -1
- package/dist/subagent/registry-persist.js +0 -115
- package/dist/subagent/registry-persist.js.map +0 -1
- package/dist/subagent/registry.d.ts +0 -52
- package/dist/subagent/registry.d.ts.map +0 -1
- package/dist/subagent/registry.js +0 -122
- package/dist/subagent/registry.js.map +0 -1
- package/dist/subagent/types.d.ts +0 -20
- package/dist/subagent/types.d.ts.map +0 -1
- package/dist/subagent/types.js +0 -2
- package/dist/subagent/types.js.map +0 -1
- package/dist/system-prompt/builder.d.ts +0 -50
- package/dist/system-prompt/builder.d.ts.map +0 -1
- package/dist/system-prompt/builder.js +0 -335
- package/dist/system-prompt/builder.js.map +0 -1
- package/dist/tools/apply-patch.d.ts +0 -15
- package/dist/tools/apply-patch.d.ts.map +0 -1
- package/dist/tools/apply-patch.js +0 -425
- package/dist/tools/apply-patch.js.map +0 -1
- package/dist/tools/bash.d.ts +0 -11
- package/dist/tools/bash.d.ts.map +0 -1
- package/dist/tools/bash.js +0 -13
- package/dist/tools/bash.js.map +0 -1
- package/dist/tools/cron.d.ts +0 -30
- package/dist/tools/cron.d.ts.map +0 -1
- package/dist/tools/cron.js +0 -57
- package/dist/tools/cron.js.map +0 -1
- package/dist/tools/exec.d.ts +0 -18
- package/dist/tools/exec.d.ts.map +0 -1
- package/dist/tools/exec.js +0 -144
- package/dist/tools/exec.js.map +0 -1
- package/dist/tools/files.d.ts +0 -37
- package/dist/tools/files.d.ts.map +0 -1
- package/dist/tools/files.js +0 -191
- package/dist/tools/files.js.map +0 -1
- package/dist/tools/image.d.ts +0 -14
- package/dist/tools/image.d.ts.map +0 -1
- package/dist/tools/image.js +0 -26
- package/dist/tools/image.js.map +0 -1
- package/dist/tools/index.d.ts +0 -36
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -53
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/memory.d.ts +0 -41
- package/dist/tools/memory.d.ts.map +0 -1
- package/dist/tools/memory.js +0 -114
- package/dist/tools/memory.js.map +0 -1
- package/dist/tools/process-registry.d.ts +0 -47
- package/dist/tools/process-registry.d.ts.map +0 -1
- package/dist/tools/process-registry.js +0 -262
- package/dist/tools/process-registry.js.map +0 -1
- package/dist/tools/process.d.ts +0 -17
- package/dist/tools/process.d.ts.map +0 -1
- package/dist/tools/process.js +0 -114
- package/dist/tools/process.js.map +0 -1
- package/dist/tools/subagent-spawn.d.ts +0 -44
- package/dist/tools/subagent-spawn.d.ts.map +0 -1
- package/dist/tools/subagent-spawn.js +0 -101
- package/dist/tools/subagent-spawn.js.map +0 -1
- package/dist/tools/subagents.d.ts +0 -30
- package/dist/tools/subagents.d.ts.map +0 -1
- package/dist/tools/subagents.js +0 -101
- package/dist/tools/subagents.js.map +0 -1
- package/dist/types.d.ts +0 -153
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -6
- package/dist/types.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,42 +1,1605 @@
|
|
|
1
|
+
import { S as AgentsConfig, _ as saveAgentsConfig, a as listAgents, b as AgentConfig, c as normalizeAgentId, d as resolveAgentDir, f as resolveAgentIdByBinding, g as resolveModelString, h as resolveModelFallbacks, i as getAgentConfig, l as removeAgent, m as resolveDefaultAgentId, n as addBinding, o as listBindings, p as resolveAgentsConfigPath, s as loadAgentsConfig, t as addAgent, u as removeBindings, v as updateAgentIdentity, x as AgentModelConfig, y as AgentBinding } from "./index-BdfpRxFA.js";
|
|
2
|
+
import { AssistantMessage, Message } from "@mariozechner/pi-ai";
|
|
3
|
+
import { AgentTool } from "@mariozechner/pi-agent-core";
|
|
4
|
+
import { AgentProgressEvent, AgentProgressEvent as AgentProgressEvent$1, CallbackEventPayload, CallbackEventPayload as CallbackEventPayload$1, Channel, Channel as Channel$1, RunResultPayload, RunResultPayload as RunResultPayload$1 } from "@gencode/shared";
|
|
5
|
+
|
|
6
|
+
//#region src/loop-detection/tool-loop-detection.d.ts
|
|
7
|
+
type ToolLoopDetectionConfig = {
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
historySize?: number;
|
|
10
|
+
warningThreshold?: number;
|
|
11
|
+
criticalThreshold?: number;
|
|
12
|
+
globalCircuitBreakerThreshold?: number;
|
|
13
|
+
detectors?: {
|
|
14
|
+
genericRepeat?: boolean;
|
|
15
|
+
knownPollNoProgress?: boolean;
|
|
16
|
+
pingPong?: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/plugins/types.d.ts
|
|
21
|
+
type PluginDiagnostic = {
|
|
22
|
+
level: "warn" | "error";
|
|
23
|
+
message: string;
|
|
24
|
+
pluginId?: string;
|
|
25
|
+
source?: string;
|
|
26
|
+
};
|
|
27
|
+
type PluginOrigin = "bundled" | "global" | "workspace" | "config";
|
|
28
|
+
type PluginKind = "memory";
|
|
29
|
+
type PluginConfigUiHint = {
|
|
30
|
+
label?: string;
|
|
31
|
+
help?: string;
|
|
32
|
+
tags?: string[];
|
|
33
|
+
advanced?: boolean;
|
|
34
|
+
sensitive?: boolean;
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
};
|
|
37
|
+
type PluginManifest = {
|
|
38
|
+
id: string;
|
|
39
|
+
configSchema: Record<string, unknown>;
|
|
40
|
+
kind?: PluginKind;
|
|
41
|
+
skills?: string[];
|
|
42
|
+
name?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
version?: string;
|
|
45
|
+
uiHints?: Record<string, PluginConfigUiHint>;
|
|
46
|
+
};
|
|
47
|
+
type PluginManifestLoadResult = {
|
|
48
|
+
ok: true;
|
|
49
|
+
manifest: PluginManifest;
|
|
50
|
+
manifestPath: string;
|
|
51
|
+
} | {
|
|
52
|
+
ok: false;
|
|
53
|
+
error: string;
|
|
54
|
+
manifestPath: string;
|
|
55
|
+
};
|
|
56
|
+
type PluginCandidate = {
|
|
57
|
+
idHint: string;
|
|
58
|
+
source: string;
|
|
59
|
+
rootDir: string;
|
|
60
|
+
origin: PluginOrigin;
|
|
61
|
+
workspaceDir?: string;
|
|
62
|
+
packageName?: string;
|
|
63
|
+
packageVersion?: string;
|
|
64
|
+
packageDescription?: string;
|
|
65
|
+
packageDir?: string;
|
|
66
|
+
packageManifest?: AIMaxPackageManifest;
|
|
67
|
+
};
|
|
68
|
+
type AIMaxPackageManifest = {
|
|
69
|
+
extensions?: string[];
|
|
70
|
+
};
|
|
71
|
+
type PluginDiscoveryResult = {
|
|
72
|
+
candidates: PluginCandidate[];
|
|
73
|
+
diagnostics: PluginDiagnostic[];
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/plugins/manifest-registry.d.ts
|
|
77
|
+
type PluginManifestRecord = {
|
|
78
|
+
id: string;
|
|
79
|
+
rootDir: string;
|
|
80
|
+
source: string;
|
|
81
|
+
origin: PluginCandidate["origin"];
|
|
82
|
+
manifestPath: string;
|
|
83
|
+
manifest: PluginManifest;
|
|
84
|
+
};
|
|
85
|
+
type PluginManifestRegistry = {
|
|
86
|
+
manifests: Map<string, PluginManifestRecord>;
|
|
87
|
+
diagnostics: PluginDiagnostic[];
|
|
88
|
+
};
|
|
89
|
+
declare function loadPluginManifestRegistry(candidates: PluginCandidate[]): PluginManifestRegistry;
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/plugins/config-state.d.ts
|
|
92
|
+
type PluginEntryConfig = {
|
|
93
|
+
enabled?: boolean;
|
|
94
|
+
config?: Record<string, unknown>;
|
|
95
|
+
};
|
|
96
|
+
type PluginsConfig = {
|
|
97
|
+
enabled?: boolean;
|
|
98
|
+
allow?: string[];
|
|
99
|
+
deny?: string[];
|
|
100
|
+
llmAllowlist?: string[];
|
|
101
|
+
load?: {
|
|
102
|
+
paths?: string[];
|
|
103
|
+
};
|
|
104
|
+
entries?: Record<string, PluginEntryConfig>;
|
|
105
|
+
slots?: Partial<Record<PluginKind, string>>;
|
|
106
|
+
};
|
|
107
|
+
type NormalizedPluginsConfig = {
|
|
108
|
+
enabled: boolean;
|
|
109
|
+
allow: string[];
|
|
110
|
+
deny: string[];
|
|
111
|
+
loadPaths: string[];
|
|
112
|
+
entries: Record<string, PluginEntryConfig>;
|
|
113
|
+
slots: Partial<Record<PluginKind, string>>;
|
|
114
|
+
};
|
|
115
|
+
type PluginsConfigValidationResult = {
|
|
116
|
+
ok: boolean;
|
|
117
|
+
diagnostics: PluginDiagnostic[];
|
|
118
|
+
};
|
|
119
|
+
declare function normalizePluginsConfig(input?: PluginsConfig): NormalizedPluginsConfig;
|
|
120
|
+
declare function validatePluginsConfig(params: {
|
|
121
|
+
config: NormalizedPluginsConfig;
|
|
122
|
+
registry: PluginManifestRegistry;
|
|
123
|
+
}): PluginsConfigValidationResult;
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/types.d.ts
|
|
126
|
+
/** Context injected when this run is itself a subagent */
|
|
127
|
+
type SubagentContext = {
|
|
128
|
+
/** Nesting depth of this run (root = 0, first child = 1, …) */depth: number; /** Session ID of the parent that spawned this subagent */
|
|
129
|
+
parentSessionId: string;
|
|
130
|
+
};
|
|
131
|
+
type AgentRunParamsBase = {
|
|
132
|
+
/** User data directory path (e.g. /data/user1) */dataDir: string; /** Session ID to resume; if omitted, a new session is created */
|
|
133
|
+
sessionId?: string; /** Message ID for correlating events */
|
|
134
|
+
messageId?: string; /** Channel type for this session */
|
|
135
|
+
channel: Channel$1; /** LLM provider configuration */
|
|
136
|
+
llm: {
|
|
137
|
+
/** vLLM/OpenAI-compatible API base URL */baseUrl: string;
|
|
138
|
+
apiKey: string;
|
|
139
|
+
model: string; /** Context window size; defaults to 200000 */
|
|
140
|
+
contextWindow?: number;
|
|
141
|
+
}; /** In-process progress callback */
|
|
142
|
+
onProgress?: (event: AgentProgressEvent$1) => Promise<void>; /** Execution timeout in milliseconds; defaults to 600000 (10 min) */
|
|
143
|
+
timeoutMs?: number; /** Present when this run is itself a subagent; controls depth limits */
|
|
144
|
+
subagentContext?: SubagentContext; /** AbortSignal to cancel this run from outside (used by parent kill) */
|
|
145
|
+
abortSignal?: AbortSignal; /** Tool-loop detection guardrails (disabled by default) */
|
|
146
|
+
loopDetection?: ToolLoopDetectionConfig; /** Plugin system options (optional) */
|
|
147
|
+
plugins?: {
|
|
148
|
+
/** Plugin config structure (allow/deny/entries/slots/load.paths) */config?: PluginsConfig; /** Data dir used to resolve .aimax extensions */
|
|
149
|
+
dataDir?: string; /** Workspace dir exposed to plugin runtime/hooks */
|
|
150
|
+
workspaceDir?: string; /** Bundled plugins directory (disabled unless explicitly enabled) */
|
|
151
|
+
bundledDir?: string; /** Optional ownership uid override for security checks */
|
|
152
|
+
ownershipUid?: number | null; /** Optional tool allowlist for plugin tools */
|
|
153
|
+
toolAllowlist?: string[]; /** Optional allowlist for plugin LLM access (plugin id or tool name) */
|
|
154
|
+
llmAllowlist?: string[];
|
|
155
|
+
}; /** Memory system options (optional) */
|
|
156
|
+
memory?: {
|
|
157
|
+
/** Explicit memory provider id (overrides plugins.slots.memory) */providerId?: string; /** Explicit plugin id for memory provider (used when providerId not set) */
|
|
158
|
+
pluginId?: string; /** Whether memory replies should include source path/line hints */
|
|
159
|
+
citationsMode?: "off" | "on";
|
|
160
|
+
}; /** Messaging prompt controls */
|
|
161
|
+
messaging?: {
|
|
162
|
+
enabled?: boolean; /** Human-readable configured channel list */
|
|
163
|
+
channels?: string[];
|
|
164
|
+
}; /** Documentation context for prompt guidance */
|
|
165
|
+
docs?: {
|
|
166
|
+
localPath?: string;
|
|
167
|
+
webUrl?: string;
|
|
168
|
+
sourceUrl?: string;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Maximum number of recent user turns to include in context.
|
|
172
|
+
* Older turns are dropped before the history is sent to the LLM.
|
|
173
|
+
* 0 or undefined means no limit.
|
|
174
|
+
*/
|
|
175
|
+
historyLimit?: number;
|
|
176
|
+
};
|
|
177
|
+
/** Parameters for running an agent session */
|
|
178
|
+
type AgentRunParams = AgentRunParamsBase & ({
|
|
179
|
+
/** The user message to process */message: string; /** Structured messages to process for file-based runs */
|
|
180
|
+
messages?: never;
|
|
181
|
+
} | {
|
|
182
|
+
/** Structured messages to process for file-based runs */messages: Message[]; /** The user message to process */
|
|
183
|
+
message?: never;
|
|
184
|
+
});
|
|
185
|
+
/** Final result returned after agent execution completes */
|
|
186
|
+
type AgentRunResult = RunResultPayload$1 & {
|
|
187
|
+
sessionId: string;
|
|
188
|
+
};
|
|
189
|
+
/** HTTP callback body formats */
|
|
190
|
+
type CallbackPayload = CallbackEventPayload$1;
|
|
191
|
+
/** A user message turn */
|
|
192
|
+
type UserEntry = {
|
|
193
|
+
role: "user";
|
|
194
|
+
content: string;
|
|
195
|
+
timestamp: string;
|
|
196
|
+
};
|
|
197
|
+
/** An assistant message turn; may include tool calls when the LLM used tools */
|
|
198
|
+
type AssistantEntry = {
|
|
199
|
+
role: "assistant"; /** Text response from the assistant (may be empty when the turn is tool-only) */
|
|
200
|
+
content: string; /** Tool calls issued by the assistant during this turn */
|
|
201
|
+
toolCalls?: Array<{
|
|
202
|
+
id: string;
|
|
203
|
+
name: string;
|
|
204
|
+
arguments: Record<string, unknown>;
|
|
205
|
+
}>;
|
|
206
|
+
timestamp: string;
|
|
207
|
+
};
|
|
208
|
+
/** The result returned by a single tool execution */
|
|
209
|
+
type ToolResultEntry = {
|
|
210
|
+
role: "tool_result"; /** Matches AssistantEntry.toolCalls[].id */
|
|
211
|
+
toolCallId: string;
|
|
212
|
+
toolName: string; /** Text output of the tool */
|
|
213
|
+
content: string;
|
|
214
|
+
isError: boolean;
|
|
215
|
+
timestamp: string;
|
|
216
|
+
};
|
|
1
217
|
/**
|
|
2
|
-
*
|
|
218
|
+
* A compaction record written after LLM-based history summarisation.
|
|
219
|
+
* `content` holds the summary text so it is accessible via the common
|
|
220
|
+
* `.content` property without narrowing on `role`.
|
|
221
|
+
*/
|
|
222
|
+
type CompactionEntry = {
|
|
223
|
+
role: "compaction"; /** Summary of the dropped conversation history */
|
|
224
|
+
content: string;
|
|
225
|
+
keptCount: number;
|
|
226
|
+
droppedCount: number;
|
|
227
|
+
timestamp: string;
|
|
228
|
+
};
|
|
229
|
+
/** Union of all persisted transcript entry types */
|
|
230
|
+
type TranscriptEntry = UserEntry | AssistantEntry | ToolResultEntry | CompactionEntry;
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/subagent/types.d.ts
|
|
233
|
+
/** Status of a spawned subagent run */
|
|
234
|
+
type SubagentStatus = "running" | "done" | "error" | "killed";
|
|
235
|
+
/** Record tracking a single subagent run */
|
|
236
|
+
type SubagentRunRecord = {
|
|
237
|
+
runId: string;
|
|
238
|
+
childSessionId: string;
|
|
239
|
+
parentSessionId: string;
|
|
240
|
+
task: string;
|
|
241
|
+
label?: string; /** Nesting depth: parent is depth N, child is N+1 */
|
|
242
|
+
depth: number;
|
|
243
|
+
status: SubagentStatus;
|
|
244
|
+
result?: string;
|
|
245
|
+
error?: string;
|
|
246
|
+
startedAt: number;
|
|
247
|
+
endedAt?: number; /** Used to cancel the subagent run */
|
|
248
|
+
abortController: AbortController;
|
|
249
|
+
};
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/subagent/registry.d.ts
|
|
252
|
+
declare const MAX_SUBAGENT_DEPTH = 3;
|
|
253
|
+
declare const MAX_CHILDREN_PER_SESSION = 5;
|
|
254
|
+
/**
|
|
255
|
+
* In-memory registry for subagent runs scoped to a single parent runAgent call.
|
|
256
|
+
* Child spawns create their own SubagentRegistry instances for their children.
|
|
257
|
+
*/
|
|
258
|
+
declare class SubagentRegistry {
|
|
259
|
+
private readonly entries;
|
|
260
|
+
/** RunIds that have already been returned by consumeCompleted */
|
|
261
|
+
private readonly announced;
|
|
262
|
+
register(record: SubagentRunRecord, promise: Promise<void>): void;
|
|
263
|
+
complete(runId: string, result: string): void;
|
|
264
|
+
fail(runId: string, error: string): void;
|
|
265
|
+
/** Aborts and marks a specific run as killed. Returns false if not found or already ended. */
|
|
266
|
+
kill(runId: string): boolean;
|
|
267
|
+
/** Aborts all running subagents for the given parent session. Returns count killed. */
|
|
268
|
+
killAll(parentSessionId: string): number;
|
|
269
|
+
/** Lists all runs registered for the given parent session. */
|
|
270
|
+
list(parentSessionId: string): SubagentRunRecord[];
|
|
271
|
+
/** Returns true if any subagents for this session are still running. */
|
|
272
|
+
hasPending(parentSessionId: string): boolean;
|
|
273
|
+
/** Count of currently running children for a session. */
|
|
274
|
+
countActive(parentSessionId: string): number;
|
|
275
|
+
/**
|
|
276
|
+
* Waits until all currently-running subagents for the given session settle.
|
|
277
|
+
* Returns immediately if nothing is pending.
|
|
278
|
+
*/
|
|
279
|
+
waitForAll(parentSessionId: string): Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* Returns all finished runs that have not yet been returned by this method,
|
|
282
|
+
* and marks them as announced so they are not returned again.
|
|
283
|
+
*/
|
|
284
|
+
consumeCompleted(parentSessionId: string): SubagentRunRecord[];
|
|
285
|
+
/** Returns true if there are completed runs not yet returned by consumeCompleted. */
|
|
286
|
+
hasUnannounced(parentSessionId: string): boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Returns true if the announce loop should run another iteration:
|
|
289
|
+
* either subagents are still running, or completed runs await announcement.
|
|
290
|
+
*/
|
|
291
|
+
needsAnnounce(parentSessionId: string): boolean;
|
|
292
|
+
/** Checks whether a new child can be spawned given depth and active-children limits. */
|
|
293
|
+
checkSpawnAllowed(parentSessionId: string, depth: number): {
|
|
294
|
+
allowed: true;
|
|
295
|
+
} | {
|
|
296
|
+
allowed: false;
|
|
297
|
+
reason: string;
|
|
298
|
+
};
|
|
299
|
+
/** Returns the current status snapshot for a single run, or null if not found. */
|
|
300
|
+
getStatus(runId: string): SubagentStatus | null;
|
|
301
|
+
}
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/runner/title.d.ts
|
|
304
|
+
/** Generates a session title by truncating the first user message */
|
|
305
|
+
declare function generateSessionTitle(message: string, maxLength?: number): string;
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/runner/runner.d.ts
|
|
308
|
+
/**
|
|
309
|
+
* Runs an agent session end-to-end.
|
|
310
|
+
* Supports multi-agent: subagents spawned via sessions_spawn are automatically
|
|
311
|
+
* awaited and their results announced back to the parent agent.
|
|
312
|
+
*
|
|
313
|
+
* @param params - Run parameters.
|
|
314
|
+
* @param _registryForTesting - Internal: inject a pre-populated registry for unit tests.
|
|
315
|
+
*/
|
|
316
|
+
declare function runAgent(params: AgentRunParams, _registryForTesting?: SubagentRegistry): Promise<AgentRunResult>;
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/memory/config.d.ts
|
|
319
|
+
type MemorySearchConfig = {
|
|
320
|
+
chunkTokens: number;
|
|
321
|
+
chunkOverlap: number;
|
|
322
|
+
maxResults: number;
|
|
323
|
+
minScore: number;
|
|
324
|
+
embedding: {
|
|
325
|
+
providerId?: string;
|
|
326
|
+
};
|
|
327
|
+
experimental: {
|
|
328
|
+
sessionMemory: boolean;
|
|
329
|
+
};
|
|
330
|
+
sources: Array<"memory" | "sessions">;
|
|
331
|
+
store: {
|
|
332
|
+
vector: {
|
|
333
|
+
enabled: boolean;
|
|
334
|
+
extensionPath?: string;
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
hybrid: {
|
|
338
|
+
enabled: boolean;
|
|
339
|
+
vectorWeight: number;
|
|
340
|
+
textWeight: number;
|
|
341
|
+
candidateMultiplier: number;
|
|
342
|
+
mmr: {
|
|
343
|
+
enabled: boolean;
|
|
344
|
+
lambda: number;
|
|
345
|
+
};
|
|
346
|
+
temporalDecay: {
|
|
347
|
+
enabled: boolean;
|
|
348
|
+
halfLifeDays: number;
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
cache: {
|
|
352
|
+
enabled: boolean;
|
|
353
|
+
maxEntries?: number;
|
|
354
|
+
};
|
|
355
|
+
sync: {
|
|
356
|
+
onSessionStart: boolean;
|
|
357
|
+
onSearch: boolean;
|
|
358
|
+
watch: boolean;
|
|
359
|
+
watchDebounceMs: number;
|
|
360
|
+
sessions: {
|
|
361
|
+
deltaBytes: number;
|
|
362
|
+
deltaMessages: number;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
citations: "off" | "auto" | "on";
|
|
366
|
+
};
|
|
367
|
+
//#endregion
|
|
368
|
+
//#region src/memory/manager.d.ts
|
|
369
|
+
type MemorySearchResult$1 = {
|
|
370
|
+
path: string;
|
|
371
|
+
startLine: number;
|
|
372
|
+
endLine: number;
|
|
373
|
+
score: number;
|
|
374
|
+
snippet: string;
|
|
375
|
+
source: "memory" | "sessions";
|
|
376
|
+
citation?: string;
|
|
377
|
+
};
|
|
378
|
+
type MemoryProviderStatus = {
|
|
379
|
+
backend: "builtin";
|
|
380
|
+
provider: string;
|
|
381
|
+
model?: string;
|
|
382
|
+
files?: number;
|
|
383
|
+
chunks?: number;
|
|
384
|
+
dirty?: boolean;
|
|
385
|
+
workspaceDir?: string;
|
|
386
|
+
dbPath?: string;
|
|
387
|
+
sources?: Array<"memory" | "sessions">;
|
|
388
|
+
sourceCounts?: Array<{
|
|
389
|
+
source: "memory" | "sessions";
|
|
390
|
+
files: number;
|
|
391
|
+
chunks: number;
|
|
392
|
+
}>;
|
|
393
|
+
cache?: {
|
|
394
|
+
enabled: boolean;
|
|
395
|
+
entries?: number;
|
|
396
|
+
maxEntries?: number;
|
|
397
|
+
};
|
|
398
|
+
fts?: {
|
|
399
|
+
enabled: boolean;
|
|
400
|
+
available: boolean;
|
|
401
|
+
error?: string;
|
|
402
|
+
};
|
|
403
|
+
vector?: {
|
|
404
|
+
enabled: boolean;
|
|
405
|
+
available?: boolean;
|
|
406
|
+
extensionPath?: string;
|
|
407
|
+
loadError?: string;
|
|
408
|
+
dims?: number;
|
|
409
|
+
};
|
|
410
|
+
custom?: Record<string, unknown>;
|
|
411
|
+
};
|
|
412
|
+
declare class MemoryIndexManager {
|
|
413
|
+
private readonly dataDir;
|
|
414
|
+
private readonly memoryRoot;
|
|
415
|
+
private readonly storePath;
|
|
416
|
+
private readonly config;
|
|
417
|
+
private provider;
|
|
418
|
+
private providerKey;
|
|
419
|
+
private embeddingProviderId?;
|
|
420
|
+
private db;
|
|
421
|
+
private dirty;
|
|
422
|
+
private ftsAvailable;
|
|
423
|
+
private ftsError?;
|
|
424
|
+
private vector;
|
|
425
|
+
private vectorReady;
|
|
426
|
+
private watchers;
|
|
427
|
+
private watchTimer;
|
|
428
|
+
private sessionWatchTimer;
|
|
429
|
+
private sessionsDirty;
|
|
430
|
+
private sessionsDirtyFiles;
|
|
431
|
+
private sessionPendingFiles;
|
|
432
|
+
private sessionDeltas;
|
|
433
|
+
static get(dataDir: string, config?: Partial<MemorySearchConfig>): MemoryIndexManager;
|
|
434
|
+
private constructor();
|
|
435
|
+
private applyConfig;
|
|
436
|
+
warmSession(): void;
|
|
437
|
+
noteSessionUpdate(sessionFile: string): void;
|
|
438
|
+
status(): MemoryProviderStatus;
|
|
439
|
+
probeEmbeddingAvailability(): Promise<{
|
|
440
|
+
ok: boolean;
|
|
441
|
+
error?: string;
|
|
442
|
+
}>;
|
|
443
|
+
probeVectorAvailability(): Promise<boolean>;
|
|
444
|
+
search(query: string): Promise<MemorySearchResult$1[]>;
|
|
445
|
+
readFile(params: {
|
|
446
|
+
relPath: string;
|
|
447
|
+
from?: number;
|
|
448
|
+
lines?: number;
|
|
449
|
+
}): Promise<{
|
|
450
|
+
text: string;
|
|
451
|
+
path: string;
|
|
452
|
+
}>;
|
|
453
|
+
replaceFile(params: {
|
|
454
|
+
relPath: string;
|
|
455
|
+
content: string;
|
|
456
|
+
}): Promise<void>;
|
|
457
|
+
deleteFile(relPath: string): Promise<void>;
|
|
458
|
+
appendToMemory(content: string): Promise<void>;
|
|
459
|
+
private openDatabase;
|
|
460
|
+
private ensureSchema;
|
|
461
|
+
private ensureVectorReady;
|
|
462
|
+
private loadVectorExtension;
|
|
463
|
+
private ensureVectorTable;
|
|
464
|
+
private dropVectorTable;
|
|
465
|
+
private withTimeout;
|
|
466
|
+
private ensureWatcher;
|
|
467
|
+
private scheduleWatchSync;
|
|
468
|
+
private ensureSessionListener;
|
|
469
|
+
private scheduleSessionDirty;
|
|
470
|
+
private processSessionDeltaBatch;
|
|
471
|
+
private updateSessionDelta;
|
|
472
|
+
private countNewlines;
|
|
473
|
+
private computeProviderKey;
|
|
474
|
+
private resolveMemoryFilePath;
|
|
475
|
+
private applyEmbeddingProvider;
|
|
476
|
+
private readMeta;
|
|
477
|
+
private writeMeta;
|
|
478
|
+
private loadEmbeddingCache;
|
|
479
|
+
private upsertEmbeddingCache;
|
|
480
|
+
private embedChunks;
|
|
481
|
+
private indexFile;
|
|
482
|
+
private buildSourceFilter;
|
|
483
|
+
private searchVector;
|
|
484
|
+
private searchKeyword;
|
|
485
|
+
private resetIndex;
|
|
486
|
+
sync(params?: {
|
|
487
|
+
reason?: string;
|
|
488
|
+
}): Promise<void>;
|
|
489
|
+
private syncSessionFiles;
|
|
490
|
+
private resetSessionDelta;
|
|
491
|
+
private decorateCitations;
|
|
492
|
+
}
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region src/memory/provider.d.ts
|
|
495
|
+
type MemoryProviderContext = {
|
|
496
|
+
dataDir: string;
|
|
497
|
+
memoryDir: string;
|
|
498
|
+
sessionId?: string;
|
|
499
|
+
pluginId?: string;
|
|
500
|
+
config?: Record<string, unknown>;
|
|
501
|
+
rootDir?: string;
|
|
502
|
+
source?: string;
|
|
503
|
+
};
|
|
504
|
+
type MemorySearchOptions = {
|
|
505
|
+
limit?: number;
|
|
506
|
+
sources?: Array<"memory" | "sessions">;
|
|
507
|
+
};
|
|
508
|
+
type MemoryChangeSource = "memory" | "sessions";
|
|
509
|
+
type MemoryChangedEvent = {
|
|
510
|
+
reason: string;
|
|
511
|
+
files: string[];
|
|
512
|
+
source: MemoryChangeSource;
|
|
513
|
+
sessionId?: string;
|
|
514
|
+
providerId?: string;
|
|
515
|
+
timestamp: string;
|
|
516
|
+
};
|
|
517
|
+
type MemoryChangedHandler = (event: MemoryChangedEvent) => void | Promise<void>;
|
|
518
|
+
type MemoryProvider = {
|
|
519
|
+
id: string;
|
|
520
|
+
name?: string;
|
|
521
|
+
status: () => MemoryProviderStatus;
|
|
522
|
+
search: (query: string, options?: MemorySearchOptions) => Promise<MemorySearchResult$1[]>;
|
|
523
|
+
getLines: (file: string, startLine: number, endLine: number) => Promise<string[] | null>;
|
|
524
|
+
listFiles: () => Promise<string[]>;
|
|
525
|
+
append: (content: string) => Promise<void>;
|
|
526
|
+
updateFile: (file: string, content: string) => Promise<void>;
|
|
527
|
+
deleteFile: (file: string) => Promise<void>;
|
|
528
|
+
sync?: (reason?: string) => Promise<void>;
|
|
529
|
+
noteSessionUpdate?: (sessionFile: string) => void;
|
|
530
|
+
onMemoryChanged?: MemoryChangedHandler;
|
|
531
|
+
};
|
|
532
|
+
type MemoryProviderFactory = (ctx: MemoryProviderContext) => MemoryProvider;
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/session/session.d.ts
|
|
535
|
+
type SessionMetadata = {
|
|
536
|
+
id: string;
|
|
537
|
+
title: string;
|
|
538
|
+
channel: Channel;
|
|
539
|
+
createdAt: string;
|
|
540
|
+
updatedAt: string;
|
|
541
|
+
};
|
|
542
|
+
type SessionSummary = {
|
|
543
|
+
id: string;
|
|
544
|
+
title: string;
|
|
545
|
+
channel: Channel;
|
|
546
|
+
createdAt: string;
|
|
547
|
+
updatedAt: string;
|
|
548
|
+
};
|
|
549
|
+
/** Resolves the sessions directory path within a data directory */
|
|
550
|
+
declare function sessionsDir(dataDir: string): string;
|
|
551
|
+
/** Resolves the directory for a specific session */
|
|
552
|
+
declare function sessionDir(dataDir: string, sessionId: string): string;
|
|
553
|
+
/** Resolves the transcript file path for a session */
|
|
554
|
+
declare function transcriptPath(dataDir: string, sessionId: string): string;
|
|
555
|
+
/** Resolves the metadata file path for a session */
|
|
556
|
+
declare function metadataPath(dataDir: string, sessionId: string): string;
|
|
557
|
+
/** Creates a new session with a generated ID */
|
|
558
|
+
declare function createSession(dataDir: string, channel: Channel): Promise<string>;
|
|
559
|
+
/** Ensures a session directory exists (for resuming an existing session) */
|
|
560
|
+
declare function ensureSession(dataDir: string, sessionId: string): Promise<void>;
|
|
561
|
+
/** Loads all transcript entries from a session */
|
|
562
|
+
declare function loadTranscript(dataDir: string, sessionId: string): Promise<TranscriptEntry[]>;
|
|
563
|
+
/** Appends a single entry to the transcript file */
|
|
564
|
+
declare function appendTranscriptEntry(dataDir: string, sessionId: string, entry: TranscriptEntry, options?: {
|
|
565
|
+
providerId?: string;
|
|
566
|
+
pluginId?: string;
|
|
567
|
+
onMemoryChanged?: MemoryChangedHandler;
|
|
568
|
+
}): Promise<void>;
|
|
569
|
+
/** Lists all session IDs within a data directory */
|
|
570
|
+
declare function listSessions(dataDir: string): Promise<string[]>;
|
|
571
|
+
/** Saves session metadata to disk */
|
|
572
|
+
declare function saveSessionMetadata(dataDir: string, metadata: SessionMetadata): Promise<void>;
|
|
573
|
+
/** Loads session metadata from disk; returns null if not found */
|
|
574
|
+
declare function loadSessionMetadata(dataDir: string, sessionId: string): Promise<SessionMetadata | null>;
|
|
575
|
+
/** Lists all sessions with their metadata summaries, optionally filtered by channel */
|
|
576
|
+
declare function listSessionSummaries(dataDir: string, channel?: Channel): Promise<SessionSummary[]>;
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region src/bootstrap/bootstrap.d.ts
|
|
579
|
+
/** Maximum characters per bootstrap file before truncation */
|
|
580
|
+
declare const BOOTSTRAP_MAX_CHARS = 20000;
|
|
581
|
+
/** Maximum total characters across all bootstrap files */
|
|
582
|
+
declare const BOOTSTRAP_TOTAL_MAX_CHARS = 150000;
|
|
583
|
+
/** Names of bootstrap identity files, in injection order */
|
|
584
|
+
declare const BOOTSTRAP_FILE_NAMES: readonly ["AGENTS.md", "SOUL.md", "TOOLS.md", "IDENTITY.md", "USER.md", "HEARTBEAT.md", "MEMORY.md", "BOOTSTRAP.md"];
|
|
585
|
+
/** A loaded (or missing) bootstrap file */
|
|
586
|
+
type BootstrapFile = {
|
|
587
|
+
name: string;
|
|
588
|
+
path: string;
|
|
589
|
+
content: string | null;
|
|
590
|
+
missing: boolean;
|
|
591
|
+
};
|
|
592
|
+
/** A bootstrap file ready for system prompt injection */
|
|
593
|
+
type BootstrapContextFile = {
|
|
594
|
+
path: string;
|
|
595
|
+
content: string;
|
|
596
|
+
};
|
|
597
|
+
/** Resolves the base .aimax directory within a data directory */
|
|
598
|
+
declare function aimaxDir(dataDir: string): string;
|
|
599
|
+
/**
|
|
600
|
+
* Loads all standard bootstrap identity files from the .aimax directory.
|
|
601
|
+
* Missing files are included as `missing: true` entries.
|
|
602
|
+
* BOOTSTRAP.md is deleted after loading (one-time use).
|
|
603
|
+
*/
|
|
604
|
+
declare function loadBootstrapFiles(dataDir: string): Promise<BootstrapFile[]>;
|
|
605
|
+
/**
|
|
606
|
+
* Converts loaded bootstrap files into context file entries for system prompt injection.
|
|
607
|
+
* Applies per-file and total character budget limits.
|
|
608
|
+
*/
|
|
609
|
+
declare function buildBootstrapContextFiles(files: BootstrapFile[], opts?: {
|
|
610
|
+
maxChars?: number;
|
|
611
|
+
totalMaxChars?: number;
|
|
612
|
+
warn?: (message: string) => void;
|
|
613
|
+
}): BootstrapContextFile[];
|
|
614
|
+
//#endregion
|
|
615
|
+
//#region src/bootstrap/bootstrap-layout.d.ts
|
|
616
|
+
type BootstrapMountResult = {
|
|
617
|
+
dataDir: string;
|
|
618
|
+
createdDirs: string[];
|
|
619
|
+
skippedDirs: string[];
|
|
620
|
+
createdFiles: string[];
|
|
621
|
+
skippedFiles: string[];
|
|
622
|
+
};
|
|
623
|
+
type BootstrapMountStatus = {
|
|
624
|
+
dataDir: string;
|
|
625
|
+
ready: boolean;
|
|
626
|
+
missingDirs: string[];
|
|
627
|
+
missingFiles: string[];
|
|
628
|
+
};
|
|
629
|
+
type BootstrapEnsureResult = {
|
|
630
|
+
ready: boolean;
|
|
631
|
+
performedBootstrap: boolean;
|
|
632
|
+
result?: BootstrapMountResult;
|
|
633
|
+
};
|
|
634
|
+
declare function inspectBootstrapMountLayout(dataDir: string): Promise<BootstrapMountStatus>;
|
|
635
|
+
declare function isBootstrapMountLayoutReady(dataDir: string): Promise<boolean>;
|
|
636
|
+
declare function ensureBootstrapMountLayout(dataDir: string): Promise<BootstrapEnsureResult>;
|
|
637
|
+
declare function bootstrapMountLayout(dataDir: string): Promise<BootstrapMountResult>;
|
|
638
|
+
//#endregion
|
|
639
|
+
//#region src/memory/memory.d.ts
|
|
640
|
+
/** Resolves the memory root path within a data directory */
|
|
641
|
+
declare function memoryDir(dataDir: string): string;
|
|
642
|
+
/** Resolves the primary MEMORY.md path */
|
|
643
|
+
declare function primaryMemoryPath(dataDir: string): string;
|
|
644
|
+
/** A single search result from memory */
|
|
645
|
+
type MemorySearchResult = MemorySearchResult$1;
|
|
646
|
+
type MemoryCallOptions = {
|
|
647
|
+
providerId?: string;
|
|
648
|
+
pluginId?: string;
|
|
649
|
+
sessionId?: string;
|
|
650
|
+
onMemoryChanged?: MemoryChangedHandler;
|
|
651
|
+
};
|
|
652
|
+
/**
|
|
653
|
+
* Lists all memory file paths within the memory directory.
|
|
654
|
+
* Returns MEMORY.md first, then daily files (YYYY-MM-DD.md) sorted by date descending.
|
|
655
|
+
*/
|
|
656
|
+
declare function listMemoryFiles(dataDir: string): Promise<string[]>;
|
|
657
|
+
/**
|
|
658
|
+
* Reads a memory file and returns its content.
|
|
659
|
+
* Returns null if the file does not exist.
|
|
660
|
+
*/
|
|
661
|
+
declare function readMemoryFile(filePath: string): Promise<string | null>;
|
|
662
|
+
/**
|
|
663
|
+
* Reads the primary MEMORY.md file.
|
|
664
|
+
* Returns null if it does not exist.
|
|
665
|
+
*/
|
|
666
|
+
declare function readPrimaryMemory(dataDir: string): Promise<string | null>;
|
|
667
|
+
/**
|
|
668
|
+
* Searches memory files for lines matching a query string (case-insensitive substring match).
|
|
669
|
+
* Returns matching lines with their file path and line number.
|
|
670
|
+
*/
|
|
671
|
+
declare function searchMemory(dataDir: string, query: string, options?: MemoryCallOptions): Promise<MemorySearchResult[]>;
|
|
672
|
+
/**
|
|
673
|
+
* Reads specific line ranges from a memory file.
|
|
674
|
+
* Returns the requested lines (1-based line numbers), or null if file not found.
|
|
675
|
+
*/
|
|
676
|
+
declare function getMemoryLines(dataDir: string, filePath: string, startLine: number, endLine: number, options?: MemoryCallOptions): Promise<string[] | null>;
|
|
677
|
+
/**
|
|
678
|
+
* Appends content to the primary MEMORY.md file, creating it if necessary.
|
|
679
|
+
*/
|
|
680
|
+
declare function appendToMemory(dataDir: string, content: string, options?: MemoryCallOptions): Promise<void>;
|
|
681
|
+
declare function replaceMemoryFile(dataDir: string, filePath: string, content: string, options?: MemoryCallOptions): Promise<void>;
|
|
682
|
+
declare function deleteMemoryFile(dataDir: string, filePath: string, options?: MemoryCallOptions): Promise<void>;
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region src/memory/embeddings.d.ts
|
|
685
|
+
type EmbeddingProvider = {
|
|
686
|
+
id: string;
|
|
687
|
+
model: string;
|
|
688
|
+
embedQuery: (text: string) => Promise<number[]>;
|
|
689
|
+
embedBatch: (texts: string[]) => Promise<number[][]>;
|
|
690
|
+
};
|
|
691
|
+
//#endregion
|
|
692
|
+
//#region src/memory/embedding-registry.d.ts
|
|
693
|
+
type EmbeddingProviderContext = {
|
|
694
|
+
dataDir: string;
|
|
695
|
+
memoryDir: string;
|
|
696
|
+
pluginId?: string;
|
|
697
|
+
config?: Record<string, unknown>;
|
|
698
|
+
rootDir?: string;
|
|
699
|
+
source?: string;
|
|
700
|
+
};
|
|
701
|
+
type EmbeddingProviderFactory = (ctx: EmbeddingProviderContext) => EmbeddingProvider;
|
|
702
|
+
type EmbeddingProviderRegistration = {
|
|
703
|
+
id: string;
|
|
704
|
+
pluginId?: string;
|
|
705
|
+
create: EmbeddingProviderFactory;
|
|
706
|
+
config?: Record<string, unknown>;
|
|
707
|
+
rootDir?: string;
|
|
708
|
+
source?: string;
|
|
709
|
+
};
|
|
710
|
+
declare function registerEmbeddingProvider(params: {
|
|
711
|
+
pluginId: string;
|
|
712
|
+
create: EmbeddingProviderFactory;
|
|
713
|
+
id?: string;
|
|
714
|
+
config?: Record<string, unknown>;
|
|
715
|
+
rootDir?: string;
|
|
716
|
+
source?: string;
|
|
717
|
+
}): string;
|
|
718
|
+
declare function resolveEmbeddingProvider(params: {
|
|
719
|
+
providerId?: string;
|
|
720
|
+
pluginId?: string;
|
|
721
|
+
dataDir: string;
|
|
722
|
+
memoryDir: string;
|
|
723
|
+
}): {
|
|
724
|
+
provider: EmbeddingProvider;
|
|
725
|
+
registration: EmbeddingProviderRegistration;
|
|
726
|
+
} | null;
|
|
727
|
+
declare function resetEmbeddingProviderRegistryForTests(): void;
|
|
728
|
+
//#endregion
|
|
729
|
+
//#region src/memory/builtin-provider.d.ts
|
|
730
|
+
declare function createBuiltinMemoryProvider(ctx: MemoryProviderContext, options?: {
|
|
731
|
+
includeSessions?: boolean;
|
|
732
|
+
}): MemoryProvider;
|
|
733
|
+
//#endregion
|
|
734
|
+
//#region src/memory/provider-registry.d.ts
|
|
735
|
+
type MemoryProviderRegistration = {
|
|
736
|
+
id: string;
|
|
737
|
+
pluginId?: string;
|
|
738
|
+
create: MemoryProviderFactory;
|
|
739
|
+
config?: Record<string, unknown>;
|
|
740
|
+
rootDir?: string;
|
|
741
|
+
source?: string;
|
|
742
|
+
};
|
|
743
|
+
declare function registerMemoryProvider(params: {
|
|
744
|
+
pluginId: string;
|
|
745
|
+
create: MemoryProviderFactory;
|
|
746
|
+
id?: string;
|
|
747
|
+
config?: Record<string, unknown>;
|
|
748
|
+
rootDir?: string;
|
|
749
|
+
source?: string;
|
|
750
|
+
}): string;
|
|
751
|
+
declare function resolveMemoryProvider(params: {
|
|
752
|
+
providerId?: string;
|
|
753
|
+
pluginId?: string;
|
|
754
|
+
dataDir: string;
|
|
755
|
+
memoryDir: string;
|
|
756
|
+
sessionId?: string;
|
|
757
|
+
}): {
|
|
758
|
+
provider: MemoryProvider;
|
|
759
|
+
registration: MemoryProviderRegistration;
|
|
760
|
+
} | null;
|
|
761
|
+
declare function resetMemoryProviderRegistryForTests(): void;
|
|
762
|
+
//#endregion
|
|
763
|
+
//#region src/skills/skills.d.ts
|
|
764
|
+
/** Resolves the skills directory path within a data directory */
|
|
765
|
+
declare function skillsDir(dataDir: string): string;
|
|
766
|
+
/** Represents a loaded skill */
|
|
767
|
+
type Skill = {
|
|
768
|
+
name: string;
|
|
769
|
+
description: string;
|
|
770
|
+
location: string;
|
|
771
|
+
};
|
|
772
|
+
/**
|
|
773
|
+
* Loads all installed skills from the skills directory.
|
|
774
|
+
* Each skill is a directory containing a SKILL.md file.
|
|
775
|
+
* Returns at most MAX_SKILLS_IN_PROMPT skills.
|
|
776
|
+
*/
|
|
777
|
+
declare function loadSkills(dataDir: string): Promise<Skill[]>;
|
|
778
|
+
declare function loadSkillsWithPluginDirs(dataDir: string, pluginDirs: string[]): Promise<Skill[]>;
|
|
779
|
+
declare function loadSkillsFromDirs(dirs: string[]): Promise<Skill[]>;
|
|
780
|
+
/**
|
|
781
|
+
* Builds the skills section of the system prompt.
|
|
782
|
+
* Returns an empty string when no skills are available.
|
|
783
|
+
* Format matches openclaw's <available_skills> XML structure.
|
|
784
|
+
*/
|
|
785
|
+
declare function buildSkillsPrompt(skills: Skill[]): string;
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/commands/types.d.ts
|
|
788
|
+
type SlashCommandSpec = {
|
|
789
|
+
name: string;
|
|
790
|
+
description: string;
|
|
791
|
+
};
|
|
792
|
+
type SlashCommandList = {
|
|
793
|
+
builtin: SlashCommandSpec[];
|
|
794
|
+
skillCommands: SlashCommandSpec[];
|
|
795
|
+
all: SlashCommandSpec[];
|
|
796
|
+
};
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/commands/registry.d.ts
|
|
799
|
+
declare function listAvailableSlashCommands(skills: Skill[]): SlashCommandList;
|
|
800
|
+
//#endregion
|
|
801
|
+
//#region src/system-prompt/builder.d.ts
|
|
802
|
+
type PromptMode = "full" | "minimal" | "none";
|
|
803
|
+
type MemoryCitationsMode = "off" | "on";
|
|
804
|
+
/** Parameters for building the agent system prompt */
|
|
805
|
+
type SystemPromptParams = {
|
|
806
|
+
dataDir: string;
|
|
807
|
+
skills?: Skill[];
|
|
808
|
+
contextFiles?: BootstrapContextFile[];
|
|
809
|
+
runtimeInfo?: {
|
|
810
|
+
os?: string;
|
|
811
|
+
node?: string;
|
|
812
|
+
model?: string;
|
|
813
|
+
hostname?: string;
|
|
814
|
+
};
|
|
815
|
+
toolNames?: string[];
|
|
816
|
+
toolSummaries?: Record<string, string>;
|
|
817
|
+
promptMode?: PromptMode;
|
|
818
|
+
heartbeatPrompt?: string;
|
|
819
|
+
bootstrapWarnings?: string[];
|
|
820
|
+
memoryCitationsMode?: MemoryCitationsMode;
|
|
821
|
+
sandboxInfo?: {
|
|
822
|
+
enabled?: boolean;
|
|
823
|
+
hostWorkspaceDir?: string;
|
|
824
|
+
containerWorkspaceDir?: string;
|
|
825
|
+
};
|
|
826
|
+
messaging?: {
|
|
827
|
+
enabled?: boolean;
|
|
828
|
+
channels?: string[];
|
|
829
|
+
};
|
|
830
|
+
docs?: {
|
|
831
|
+
localPath?: string;
|
|
832
|
+
webUrl?: string;
|
|
833
|
+
sourceUrl?: string;
|
|
834
|
+
};
|
|
835
|
+
currentDate?: string;
|
|
836
|
+
timezone?: string;
|
|
837
|
+
/**
|
|
838
|
+
* Summary of prior conversation history produced by compaction.
|
|
839
|
+
* When provided, it is appended to the system prompt so the agent
|
|
840
|
+
* understands what happened before the retained message window.
|
|
841
|
+
*/
|
|
842
|
+
priorConversationSummary?: string;
|
|
843
|
+
};
|
|
844
|
+
/**
|
|
845
|
+
* Builds the complete system prompt for the agent.
|
|
846
|
+
* Assembles all sections in the correct order.
|
|
847
|
+
*/
|
|
848
|
+
declare function buildSystemPrompt(params: SystemPromptParams): string;
|
|
849
|
+
//#endregion
|
|
850
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/symbols/symbols.d.ts
|
|
851
|
+
/** Symbol key applied to readonly types */
|
|
852
|
+
declare const ReadonlyKind: unique symbol;
|
|
853
|
+
/** Symbol key applied to optional types */
|
|
854
|
+
declare const OptionalKind: unique symbol;
|
|
855
|
+
/** Symbol key applied to types */
|
|
856
|
+
declare const Hint: unique symbol;
|
|
857
|
+
/** Symbol key applied to types */
|
|
858
|
+
declare const Kind: unique symbol;
|
|
859
|
+
//#endregion
|
|
860
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/readonly/readonly.d.ts
|
|
861
|
+
type TReadonly<T extends TSchema> = T & {
|
|
862
|
+
[ReadonlyKind]: 'Readonly';
|
|
863
|
+
};
|
|
864
|
+
//#endregion
|
|
865
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/literal/literal.d.ts
|
|
866
|
+
type TLiteralValue = boolean | number | string;
|
|
867
|
+
interface TLiteral<T extends TLiteralValue = TLiteralValue> extends TSchema {
|
|
868
|
+
[Kind]: 'Literal';
|
|
869
|
+
static: T;
|
|
870
|
+
const: T;
|
|
871
|
+
}
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/union/union-type.d.ts
|
|
874
|
+
type UnionStatic<T extends TSchema[], P extends unknown[]> = { [K in keyof T]: T[K] extends TSchema ? Static<T[K], P> : never }[number];
|
|
875
|
+
interface TUnion<T extends TSchema[] = TSchema[]> extends TSchema {
|
|
876
|
+
[Kind]: 'Union';
|
|
877
|
+
static: UnionStatic<T, this['params']>;
|
|
878
|
+
anyOf: T;
|
|
879
|
+
}
|
|
880
|
+
//#endregion
|
|
881
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/string/string.d.ts
|
|
882
|
+
type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string);
|
|
883
|
+
type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
|
|
884
|
+
interface StringOptions extends SchemaOptions {
|
|
885
|
+
/** The maximum string length */
|
|
886
|
+
maxLength?: number;
|
|
887
|
+
/** The minimum string length */
|
|
888
|
+
minLength?: number;
|
|
889
|
+
/** A regular expression pattern this string should match */
|
|
890
|
+
pattern?: string;
|
|
891
|
+
/** A format this string should match */
|
|
892
|
+
format?: StringFormatOption;
|
|
893
|
+
/** The content encoding for this string */
|
|
894
|
+
contentEncoding?: StringContentEncodingOption;
|
|
895
|
+
/** The content media type for this string */
|
|
896
|
+
contentMediaType?: string;
|
|
897
|
+
}
|
|
898
|
+
interface TString extends TSchema, StringOptions {
|
|
899
|
+
[Kind]: 'String';
|
|
900
|
+
static: string;
|
|
901
|
+
type: 'string';
|
|
902
|
+
}
|
|
903
|
+
//#endregion
|
|
904
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/boolean/boolean.d.ts
|
|
905
|
+
interface TBoolean extends TSchema {
|
|
906
|
+
[Kind]: 'Boolean';
|
|
907
|
+
static: boolean;
|
|
908
|
+
type: 'boolean';
|
|
909
|
+
}
|
|
910
|
+
//#endregion
|
|
911
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/number/number.d.ts
|
|
912
|
+
interface NumberOptions extends SchemaOptions {
|
|
913
|
+
exclusiveMaximum?: number;
|
|
914
|
+
exclusiveMinimum?: number;
|
|
915
|
+
maximum?: number;
|
|
916
|
+
minimum?: number;
|
|
917
|
+
multipleOf?: number;
|
|
918
|
+
}
|
|
919
|
+
interface TNumber extends TSchema, NumberOptions {
|
|
920
|
+
[Kind]: 'Number';
|
|
921
|
+
static: number;
|
|
922
|
+
type: 'number';
|
|
923
|
+
}
|
|
924
|
+
//#endregion
|
|
925
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/optional/optional.d.ts
|
|
926
|
+
type TOptional<T extends TSchema> = T & {
|
|
927
|
+
[OptionalKind]: 'Optional';
|
|
928
|
+
};
|
|
929
|
+
//#endregion
|
|
930
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/record/record.d.ts
|
|
931
|
+
type RecordStatic<Key extends TSchema, Type extends TSchema, P extends unknown[]> = (Evaluate<{ [_ in Assert<Static<Key>, PropertyKey>]: Static<Type, P> }>);
|
|
932
|
+
interface TRecord<Key extends TSchema = TSchema, Type extends TSchema = TSchema> extends TSchema {
|
|
933
|
+
[Kind]: 'Record';
|
|
934
|
+
static: RecordStatic<Key, Type, this['params']>;
|
|
935
|
+
type: 'object';
|
|
936
|
+
patternProperties: {
|
|
937
|
+
[pattern: string]: Type;
|
|
938
|
+
};
|
|
939
|
+
additionalProperties: TAdditionalProperties;
|
|
940
|
+
}
|
|
941
|
+
//#endregion
|
|
942
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/static/static.d.ts
|
|
943
|
+
/** Creates a static type from a TypeBox type */
|
|
944
|
+
type Static<Type extends TSchema, Params extends unknown[] = [], Result = (Type & {
|
|
945
|
+
params: Params;
|
|
946
|
+
})['static']> = Result;
|
|
947
|
+
//#endregion
|
|
948
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/object/object.d.ts
|
|
949
|
+
type ReadonlyOptionalPropertyKeys<T extends TProperties> = { [K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never }[keyof T];
|
|
950
|
+
type ReadonlyPropertyKeys<T extends TProperties> = { [K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? never : K) : never }[keyof T];
|
|
951
|
+
type OptionalPropertyKeys<T extends TProperties> = { [K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never }[keyof T];
|
|
952
|
+
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
953
|
+
type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
|
|
954
|
+
type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, { [K in keyof T]: Static<T[K], P> }>;
|
|
955
|
+
type TPropertyKey = string | number;
|
|
956
|
+
type TProperties = Record<TPropertyKey, TSchema>;
|
|
957
|
+
type TIsLiteralString<Type extends string> = ([Type] extends [string] ? [string] extends [Type] ? false : true : false);
|
|
958
|
+
type IsRequiredArrayLiteralConstant<RequiredTuple extends string[]> = (RequiredTuple extends [infer Left extends string, ...infer _ extends string[]] ? TIsLiteralString<Left> : false);
|
|
959
|
+
type TRequiredArray<Properties extends TProperties, RequiredProperties extends TProperties = { [Key in keyof Properties as Properties[Key] extends TOptional<Properties[Key]> ? never : Key]: Properties[Key] }, RequiredUnion extends string = Extract<keyof RequiredProperties, string>, RequiredTuple extends string[] = UnionToTuple<RequiredUnion>, Result extends string[] | undefined = (IsRequiredArrayLiteralConstant<RequiredTuple> extends true ? RequiredTuple : string[] | undefined)> = Result;
|
|
960
|
+
type TAdditionalProperties = undefined | TSchema | boolean;
|
|
961
|
+
interface ObjectOptions extends SchemaOptions {
|
|
962
|
+
/** Additional property constraints for this object */
|
|
963
|
+
additionalProperties?: TAdditionalProperties;
|
|
964
|
+
/** The minimum number of properties allowed on this object */
|
|
965
|
+
minProperties?: number;
|
|
966
|
+
/** The maximum number of properties allowed on this object */
|
|
967
|
+
maxProperties?: number;
|
|
968
|
+
}
|
|
969
|
+
interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
|
|
970
|
+
[Kind]: 'Object';
|
|
971
|
+
static: ObjectStatic<T, this['params']>;
|
|
972
|
+
additionalProperties?: TAdditionalProperties;
|
|
973
|
+
type: 'object';
|
|
974
|
+
properties: T;
|
|
975
|
+
required: TRequiredArray<T>;
|
|
976
|
+
}
|
|
977
|
+
//#endregion
|
|
978
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/helpers/helpers.d.ts
|
|
979
|
+
type UnionToIntersect<U> = (U extends unknown ? (arg: U) => 0 : never) extends ((arg: infer I) => 0) ? I : never;
|
|
980
|
+
type UnionLast<U> = UnionToIntersect<U extends unknown ? (x: U) => 0 : never> extends ((x: infer L) => 0) ? L : never;
|
|
981
|
+
type UnionToTuple<U, Acc extends unknown[] = [], R = UnionLast<U>> = [U] extends [never] ? Acc : UnionToTuple<Exclude<U, R>, [Extract<U, R>, ...Acc]>;
|
|
982
|
+
type Assert<T, E> = T extends E ? T : never;
|
|
983
|
+
type Evaluate<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
|
|
984
|
+
//#endregion
|
|
985
|
+
//#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/cjs/type/schema/schema.d.ts
|
|
986
|
+
interface SchemaOptions {
|
|
987
|
+
$schema?: string;
|
|
988
|
+
/** Id for this schema */
|
|
989
|
+
$id?: string;
|
|
990
|
+
/** Title of this schema */
|
|
991
|
+
title?: string;
|
|
992
|
+
/** Description of this schema */
|
|
993
|
+
description?: string;
|
|
994
|
+
/** Default value for this schema */
|
|
995
|
+
default?: any;
|
|
996
|
+
/** Example values matching this schema */
|
|
997
|
+
examples?: any;
|
|
998
|
+
/** Optional annotation for readOnly */
|
|
999
|
+
readOnly?: boolean;
|
|
1000
|
+
/** Optional annotation for writeOnly */
|
|
1001
|
+
writeOnly?: boolean;
|
|
1002
|
+
[prop: string]: any;
|
|
1003
|
+
}
|
|
1004
|
+
interface TKind {
|
|
1005
|
+
[Kind]: string;
|
|
1006
|
+
}
|
|
1007
|
+
interface TSchema extends TKind, SchemaOptions {
|
|
1008
|
+
[ReadonlyKind]?: string;
|
|
1009
|
+
[OptionalKind]?: string;
|
|
1010
|
+
[Hint]?: string;
|
|
1011
|
+
params: unknown[];
|
|
1012
|
+
static: unknown;
|
|
1013
|
+
}
|
|
1014
|
+
//#endregion
|
|
1015
|
+
//#region src/tools/memory.d.ts
|
|
1016
|
+
type MemoryToolOptions = {
|
|
1017
|
+
providerId?: string;
|
|
1018
|
+
pluginId?: string;
|
|
1019
|
+
sessionId?: string;
|
|
1020
|
+
onMemoryChanged?: MemoryChangedHandler;
|
|
1021
|
+
};
|
|
1022
|
+
declare const memorySearchSchema: TObject<{
|
|
1023
|
+
query: TString;
|
|
1024
|
+
}>;
|
|
1025
|
+
type SearchResult = {
|
|
1026
|
+
matches: Array<{
|
|
1027
|
+
file: string;
|
|
1028
|
+
start_line: number;
|
|
1029
|
+
end_line: number;
|
|
1030
|
+
score: number;
|
|
1031
|
+
text: string;
|
|
1032
|
+
source: string;
|
|
1033
|
+
citation?: string;
|
|
1034
|
+
}>;
|
|
1035
|
+
};
|
|
1036
|
+
declare function createMemorySearchTool(dataDir: string, options?: MemoryToolOptions): AgentTool<typeof memorySearchSchema, SearchResult>;
|
|
1037
|
+
declare const memoryGetSchema: TObject<{
|
|
1038
|
+
file: TString;
|
|
1039
|
+
start_line: TNumber;
|
|
1040
|
+
end_line: TNumber;
|
|
1041
|
+
}>;
|
|
1042
|
+
type GetResult = {
|
|
1043
|
+
lines: string[] | null;
|
|
1044
|
+
};
|
|
1045
|
+
declare function createMemoryGetTool(dataDir: string, options?: MemoryToolOptions): AgentTool<typeof memoryGetSchema, GetResult>;
|
|
1046
|
+
declare const memoryAppendSchema: TObject<{
|
|
1047
|
+
content: TString;
|
|
1048
|
+
}>;
|
|
1049
|
+
declare function createMemoryAppendTool(dataDir: string, options?: MemoryToolOptions): AgentTool<typeof memoryAppendSchema, {
|
|
1050
|
+
appended: boolean;
|
|
1051
|
+
}>;
|
|
1052
|
+
//#endregion
|
|
1053
|
+
//#region src/tools/process-registry.d.ts
|
|
1054
|
+
type ProcessStatus = "running" | "completed" | "failed" | "killed" | "timeout";
|
|
1055
|
+
type ProcessSessionSnapshot = {
|
|
1056
|
+
sessionId: string;
|
|
1057
|
+
scopeKey?: string;
|
|
1058
|
+
command: string;
|
|
1059
|
+
cwd: string;
|
|
1060
|
+
pid?: number;
|
|
1061
|
+
startedAt: number;
|
|
1062
|
+
endedAt?: number;
|
|
1063
|
+
status: ProcessStatus;
|
|
1064
|
+
exitCode?: number | null;
|
|
1065
|
+
exitSignal?: NodeJS.Signals | null;
|
|
1066
|
+
outputTail: string;
|
|
1067
|
+
outputTruncated: boolean;
|
|
1068
|
+
};
|
|
1069
|
+
type ProcessLogSlice = {
|
|
1070
|
+
sessionId: string;
|
|
1071
|
+
status: ProcessStatus;
|
|
1072
|
+
text: string;
|
|
1073
|
+
totalLines: number;
|
|
1074
|
+
totalChars: number;
|
|
1075
|
+
truncated: boolean;
|
|
1076
|
+
exitCode?: number | null;
|
|
1077
|
+
exitSignal?: NodeJS.Signals | null;
|
|
1078
|
+
};
|
|
1079
|
+
type ProcessStartParams = {
|
|
1080
|
+
command: string;
|
|
1081
|
+
cwd: string;
|
|
1082
|
+
env?: Record<string, string>;
|
|
1083
|
+
timeoutSec: number;
|
|
1084
|
+
scopeKey?: string;
|
|
1085
|
+
};
|
|
1086
|
+
type ProcessRegistry = {
|
|
1087
|
+
start(params: ProcessStartParams): ProcessSessionSnapshot;
|
|
1088
|
+
get(sessionId: string, scopeKey?: string): ProcessSessionSnapshot | null;
|
|
1089
|
+
list(scopeKey?: string): ProcessSessionSnapshot[];
|
|
1090
|
+
wait(sessionId: string, scopeKey: string | undefined, timeoutMs?: number): Promise<ProcessSessionSnapshot | null>;
|
|
1091
|
+
readLog(params: {
|
|
1092
|
+
sessionId: string;
|
|
1093
|
+
scopeKey?: string;
|
|
1094
|
+
offset?: number;
|
|
1095
|
+
limit?: number;
|
|
1096
|
+
}): ProcessLogSlice | null;
|
|
1097
|
+
terminate(sessionId: string, scopeKey?: string): Promise<ProcessSessionSnapshot | null>;
|
|
1098
|
+
};
|
|
1099
|
+
//#endregion
|
|
1100
|
+
//#region src/tools/exec.d.ts
|
|
1101
|
+
declare const execSchema: TObject<{
|
|
1102
|
+
command: TString;
|
|
1103
|
+
workdir: TOptional<TString>;
|
|
1104
|
+
env: TOptional<TRecord<TString, TString>>;
|
|
1105
|
+
timeout: TOptional<TNumber>;
|
|
1106
|
+
yieldMs: TOptional<TNumber>;
|
|
1107
|
+
background: TOptional<TBoolean>;
|
|
1108
|
+
}>;
|
|
1109
|
+
type ExecToolOptions = {
|
|
1110
|
+
workspaceDir: string;
|
|
1111
|
+
registry: ProcessRegistry;
|
|
1112
|
+
scopeKey?: string;
|
|
1113
|
+
};
|
|
1114
|
+
declare function createExecTool(options: ExecToolOptions): AgentTool<typeof execSchema, Record<string, unknown>>;
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region src/tools/process.d.ts
|
|
1117
|
+
declare const processSchema: TObject<{
|
|
1118
|
+
action: TString;
|
|
1119
|
+
sessionId: TOptional<TString>;
|
|
1120
|
+
offset: TOptional<TNumber>;
|
|
1121
|
+
limit: TOptional<TNumber>;
|
|
1122
|
+
timeout: TOptional<TNumber>;
|
|
1123
|
+
}>;
|
|
1124
|
+
type ProcessToolOptions = {
|
|
1125
|
+
registry: ProcessRegistry;
|
|
1126
|
+
scopeKey?: string;
|
|
1127
|
+
};
|
|
1128
|
+
declare function createProcessTool(options: ProcessToolOptions): AgentTool<typeof processSchema, Record<string, unknown>>;
|
|
1129
|
+
//#endregion
|
|
1130
|
+
//#region src/tools/bash.d.ts
|
|
1131
|
+
/**
|
|
1132
|
+
* Backward-compatible alias kept for existing imports.
|
|
1133
|
+
* New code should use createExecTool + createProcessTool directly.
|
|
1134
|
+
*/
|
|
1135
|
+
declare function createBashTool(workspaceDir: string): AgentTool;
|
|
1136
|
+
//#endregion
|
|
1137
|
+
//#region src/tools/files.d.ts
|
|
1138
|
+
declare const readFileSchema: TObject<{
|
|
1139
|
+
path: TString;
|
|
1140
|
+
offset: TOptional<TNumber>;
|
|
1141
|
+
limit: TOptional<TNumber>;
|
|
1142
|
+
}>;
|
|
1143
|
+
type ReadFileResult = {
|
|
1144
|
+
content: string;
|
|
1145
|
+
lines: number;
|
|
1146
|
+
truncated: boolean;
|
|
1147
|
+
};
|
|
1148
|
+
declare function createReadFileTool(workspaceDir: string): AgentTool<typeof readFileSchema, ReadFileResult>;
|
|
1149
|
+
declare const writeFileSchema: TObject<{
|
|
1150
|
+
path: TString;
|
|
1151
|
+
content: TString;
|
|
1152
|
+
}>;
|
|
1153
|
+
declare function createWriteFileTool(workspaceDir: string): AgentTool<typeof writeFileSchema, {
|
|
1154
|
+
path: string;
|
|
1155
|
+
}>;
|
|
1156
|
+
declare const editFileSchema: TObject<{
|
|
1157
|
+
path: TString;
|
|
1158
|
+
old_string: TString;
|
|
1159
|
+
new_string: TString;
|
|
1160
|
+
}>;
|
|
1161
|
+
declare function createEditFileTool(workspaceDir: string): AgentTool<typeof editFileSchema, {
|
|
1162
|
+
path: string;
|
|
1163
|
+
occurrences: number;
|
|
1164
|
+
}>;
|
|
1165
|
+
declare const listDirSchema: TObject<{
|
|
1166
|
+
path: TOptional<TString>;
|
|
1167
|
+
}>;
|
|
1168
|
+
declare function createListDirTool(workspaceDir: string): AgentTool<typeof listDirSchema, {
|
|
1169
|
+
entries: string[];
|
|
1170
|
+
}>;
|
|
1171
|
+
//#endregion
|
|
1172
|
+
//#region src/tools/apply-patch.d.ts
|
|
1173
|
+
type ApplyPatchSummary = {
|
|
1174
|
+
added: string[];
|
|
1175
|
+
modified: string[];
|
|
1176
|
+
deleted: string[];
|
|
1177
|
+
};
|
|
1178
|
+
type ApplyPatchDetails = {
|
|
1179
|
+
summary: ApplyPatchSummary;
|
|
1180
|
+
};
|
|
1181
|
+
declare const applyPatchSchema: TObject<{
|
|
1182
|
+
input: TString;
|
|
1183
|
+
}>;
|
|
1184
|
+
declare function createApplyPatchTool(workspaceDir: string): AgentTool<typeof applyPatchSchema, ApplyPatchDetails>;
|
|
1185
|
+
//#endregion
|
|
1186
|
+
//#region src/tools/image.d.ts
|
|
1187
|
+
declare const imageSchema: TObject<{
|
|
1188
|
+
image: TString;
|
|
1189
|
+
prompt: TOptional<TString>;
|
|
1190
|
+
model: TOptional<TString>;
|
|
1191
|
+
maxBytesMb: TOptional<TNumber>;
|
|
1192
|
+
}>;
|
|
1193
|
+
type ImageResult = {
|
|
1194
|
+
implemented: boolean;
|
|
1195
|
+
error?: string;
|
|
1196
|
+
};
|
|
1197
|
+
declare function createImageTool(): AgentTool<typeof imageSchema, ImageResult>;
|
|
1198
|
+
//#endregion
|
|
1199
|
+
//#region src/tools/subagent-spawn.d.ts
|
|
1200
|
+
declare const spawnSchema: TObject<{
|
|
1201
|
+
task: TString;
|
|
1202
|
+
label: TOptional<TString>;
|
|
1203
|
+
}>;
|
|
1204
|
+
type SpawnResult = {
|
|
1205
|
+
status: "accepted";
|
|
1206
|
+
childSessionId: string;
|
|
1207
|
+
runId: string;
|
|
1208
|
+
note: string;
|
|
1209
|
+
} | {
|
|
1210
|
+
status: "forbidden";
|
|
1211
|
+
error: string;
|
|
1212
|
+
} | {
|
|
1213
|
+
status: "error";
|
|
1214
|
+
error: string;
|
|
1215
|
+
};
|
|
1216
|
+
/** Formats the announce message injected into the parent session when a subagent completes. */
|
|
1217
|
+
declare function buildSubagentAnnounceMessage(params: {
|
|
1218
|
+
task: string;
|
|
1219
|
+
label?: string;
|
|
1220
|
+
status: "done" | "error" | "killed";
|
|
1221
|
+
result?: string;
|
|
1222
|
+
error?: string;
|
|
1223
|
+
}): string;
|
|
1224
|
+
/**
|
|
1225
|
+
* Creates the sessions_spawn tool that allows an agent to delegate tasks to subagents.
|
|
3
1226
|
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//#
|
|
1227
|
+
* @param registry The parent session's subagent registry.
|
|
1228
|
+
* @param parentSessionId Session ID of the agent doing the spawning.
|
|
1229
|
+
* @param depth Current nesting depth of the spawning agent (child will be depth+1).
|
|
1230
|
+
* @param dataDir User data directory (shared between parent and child).
|
|
1231
|
+
* @param channel Channel inherited from the parent session.
|
|
1232
|
+
* @param llm LLM config inherited from the parent.
|
|
1233
|
+
* @param loopDetection Tool-loop detection config inherited from the parent.
|
|
1234
|
+
* @param spawnFn Function that actually runs a child agent (injected to avoid circular imports).
|
|
1235
|
+
*/
|
|
1236
|
+
declare function createSessionsSpawnTool(registry: SubagentRegistry, parentSessionId: string, depth: number, dataDir: string, channel: AgentRunParams["channel"], llm: AgentRunParams["llm"], loopDetection: ToolLoopDetectionConfig | undefined, inheritedRunParams: Pick<AgentRunParams, "plugins" | "memory" | "messaging" | "docs" | "historyLimit">, spawnFn: (params: AgentRunParams) => Promise<AgentRunResult>): AgentTool<typeof spawnSchema, SpawnResult>;
|
|
1237
|
+
//#endregion
|
|
1238
|
+
//#region src/tools/subagents.d.ts
|
|
1239
|
+
declare const ACTIONS: readonly ["list", "kill"];
|
|
1240
|
+
type SubagentsAction = (typeof ACTIONS)[number];
|
|
1241
|
+
declare const subagentsSchema: TObject<{
|
|
1242
|
+
action: TUnion<[TLiteral<"list">, TLiteral<"kill">]>;
|
|
1243
|
+
target: TOptional<TString>;
|
|
1244
|
+
}>;
|
|
1245
|
+
type SubagentsResult = {
|
|
1246
|
+
action: SubagentsAction;
|
|
1247
|
+
runs?: Array<{
|
|
1248
|
+
index: number;
|
|
1249
|
+
runId: string;
|
|
1250
|
+
label: string;
|
|
1251
|
+
task: string;
|
|
1252
|
+
status: string;
|
|
1253
|
+
depth: number;
|
|
1254
|
+
runtimeMs: number;
|
|
1255
|
+
}>;
|
|
1256
|
+
killed?: number;
|
|
1257
|
+
error?: string;
|
|
1258
|
+
text: string;
|
|
1259
|
+
};
|
|
1260
|
+
/**
|
|
1261
|
+
* Creates the subagents tool for listing and killing spawned subagents.
|
|
1262
|
+
*/
|
|
1263
|
+
declare function createSubagentsTool(registry: SubagentRegistry, parentSessionId: string): AgentTool<typeof subagentsSchema, SubagentsResult>;
|
|
1264
|
+
//#endregion
|
|
1265
|
+
//#region src/tools/index.d.ts
|
|
1266
|
+
/** Optional context for enabling subagent tools */
|
|
1267
|
+
type SubagentToolsContext = {
|
|
1268
|
+
registry: SubagentRegistry;
|
|
1269
|
+
parentSessionId: string; /** Depth of the current agent (root = 0) */
|
|
1270
|
+
depth: number;
|
|
1271
|
+
channel: AgentRunParams["channel"];
|
|
1272
|
+
llm: AgentRunParams["llm"];
|
|
1273
|
+
inheritedRunParams?: Pick<AgentRunParams, "plugins" | "memory" | "messaging" | "docs" | "historyLimit">;
|
|
1274
|
+
loopDetection?: ToolLoopDetectionConfig;
|
|
1275
|
+
memoryOptions?: MemoryToolOptions; /** Callback that runs a child agent; injected to avoid circular imports */
|
|
1276
|
+
spawnFn: (params: AgentRunParams) => Promise<AgentRunResult>;
|
|
1277
|
+
};
|
|
1278
|
+
/**
|
|
1279
|
+
* Creates the full set of agent tools for a given data directory.
|
|
1280
|
+
* File and exec/process tools are scoped to the workspace directory.
|
|
1281
|
+
* Memory tools are scoped to the data directory's .aimax root
|
|
1282
|
+
* (MEMORY.md + memory/*.md).
|
|
1283
|
+
* Subagent tools (sessions_spawn, subagents) are included when ctx is provided.
|
|
1284
|
+
*/
|
|
1285
|
+
declare function createAgentTools(dataDir: string, ctx?: SubagentToolsContext): AgentTool[];
|
|
1286
|
+
//#endregion
|
|
1287
|
+
//#region src/subagent/registry-persist.d.ts
|
|
1288
|
+
/** Persistable subagent run record (without AbortController) */
|
|
1289
|
+
type PersistedSubagentRunRecord = Omit<SubagentRunRecord, "abortController"> & {
|
|
1290
|
+
version?: number;
|
|
1291
|
+
};
|
|
1292
|
+
/**
|
|
1293
|
+
* Loads subagent run records from disk.
|
|
1294
|
+
* Returns an empty map if the file doesn't exist or is invalid.
|
|
1295
|
+
*/
|
|
1296
|
+
declare function loadSubagentRegistryFromDisk(dataDir: string): Promise<Map<string, SubagentRunRecord>>;
|
|
1297
|
+
/**
|
|
1298
|
+
* Saves subagent run records to disk.
|
|
1299
|
+
* Only records with a valid endedAt timestamp are persisted
|
|
1300
|
+
* (completed runs are kept for history, running runs are not persisted).
|
|
1301
|
+
*/
|
|
1302
|
+
declare function saveSubagentRegistryToDisk(dataDir: string, runs: Map<string, SubagentRunRecord>): Promise<void>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Lists subagent runs for a specific parent session from disk.
|
|
1305
|
+
* Useful for querying historical subagent runs.
|
|
1306
|
+
*/
|
|
1307
|
+
declare function listSubagentRunsFromDisk(dataDir: string, parentSessionId: string): Promise<PersistedSubagentRunRecord[]>;
|
|
1308
|
+
/**
|
|
1309
|
+
* Cleans up old subagent records from disk.
|
|
1310
|
+
* Removes records older than the specified number of days.
|
|
1311
|
+
*/
|
|
1312
|
+
declare function cleanupOldSubagentRecords(dataDir: string, olderThanDays?: number): Promise<number>;
|
|
1313
|
+
//#endregion
|
|
1314
|
+
//#region src/plugins/discovery.d.ts
|
|
1315
|
+
type PluginDiscoveryOptions = {
|
|
1316
|
+
dataDir?: string;
|
|
1317
|
+
workspaceDir?: string;
|
|
1318
|
+
extraPaths?: string[];
|
|
1319
|
+
bundledDir?: string;
|
|
1320
|
+
ownershipUid?: number | null;
|
|
1321
|
+
};
|
|
1322
|
+
declare function discoverAIMaxPlugins(options?: PluginDiscoveryOptions): PluginDiscoveryResult;
|
|
1323
|
+
//#endregion
|
|
1324
|
+
//#region src/plugins/manifest.d.ts
|
|
1325
|
+
declare const PLUGIN_MANIFEST_FILENAME = "aimax.plugin.json";
|
|
1326
|
+
declare const PLUGIN_MANIFEST_FILENAMES: readonly ["aimax.plugin.json"];
|
|
1327
|
+
declare function resolvePluginManifestPath(rootDir: string): string;
|
|
1328
|
+
declare function loadPluginManifest(rootDir: string, rejectHardlinks?: boolean): PluginManifestLoadResult;
|
|
1329
|
+
//#endregion
|
|
1330
|
+
//#region src/plugins/hooks.d.ts
|
|
1331
|
+
type PluginHookName = "before_model_resolve" | "before_prompt_build" | "after_prompt_build" | "llm_input" | "assistant_message_end" | "llm_output" | "before_tool_call" | "after_tool_call" | "agent_end" | "before_compaction" | "after_compaction" | "session_start" | "session_end" | "session_reset" | "memory_changed";
|
|
1332
|
+
type PluginHookAgentContext = {
|
|
1333
|
+
agentId?: string;
|
|
1334
|
+
sessionId?: string;
|
|
1335
|
+
workspaceDir?: string;
|
|
1336
|
+
channel?: AgentRunParams["channel"];
|
|
1337
|
+
};
|
|
1338
|
+
type PluginHookBeforeModelResolveEvent = {
|
|
1339
|
+
prompt: string;
|
|
1340
|
+
};
|
|
1341
|
+
type PluginHookBeforeModelResolveResult = {
|
|
1342
|
+
modelOverride?: string;
|
|
1343
|
+
};
|
|
1344
|
+
type PluginHookBeforePromptBuildEvent = {
|
|
1345
|
+
prompt: string;
|
|
1346
|
+
};
|
|
1347
|
+
type PluginHookBeforePromptBuildResult = {
|
|
1348
|
+
systemPrompt?: string;
|
|
1349
|
+
prependContext?: string;
|
|
1350
|
+
};
|
|
1351
|
+
type PluginHookAfterPromptBuildEvent = {
|
|
1352
|
+
prompt: string;
|
|
1353
|
+
systemPrompt: string;
|
|
1354
|
+
};
|
|
1355
|
+
type PluginHookLlmInputEvent = {
|
|
1356
|
+
sessionId: string;
|
|
1357
|
+
model: string;
|
|
1358
|
+
prompt: string;
|
|
1359
|
+
historyMessages: unknown[];
|
|
1360
|
+
};
|
|
1361
|
+
type PluginHookAssistantMessageEndEvent = {
|
|
1362
|
+
sessionId: string;
|
|
1363
|
+
model: string;
|
|
1364
|
+
assistantText: string;
|
|
1365
|
+
assistantMessage: AssistantMessage;
|
|
1366
|
+
hasToolCalls: boolean;
|
|
1367
|
+
durationMs?: number;
|
|
1368
|
+
usage?: {
|
|
1369
|
+
input?: number;
|
|
1370
|
+
output?: number;
|
|
1371
|
+
total?: number;
|
|
1372
|
+
};
|
|
1373
|
+
};
|
|
1374
|
+
type PluginHookLlmOutputEvent = {
|
|
1375
|
+
sessionId: string;
|
|
1376
|
+
model: string;
|
|
1377
|
+
assistantTexts: string[];
|
|
1378
|
+
lastAssistant?: AssistantMessage;
|
|
1379
|
+
usage?: {
|
|
1380
|
+
input?: number;
|
|
1381
|
+
output?: number;
|
|
1382
|
+
total?: number;
|
|
1383
|
+
};
|
|
1384
|
+
};
|
|
1385
|
+
type PluginHookBeforeToolCallEvent = {
|
|
1386
|
+
toolCallId: string;
|
|
1387
|
+
toolName: string;
|
|
1388
|
+
params: Record<string, unknown>;
|
|
1389
|
+
};
|
|
1390
|
+
type PluginHookBeforeToolCallResult = {
|
|
1391
|
+
params?: Record<string, unknown>;
|
|
1392
|
+
block?: boolean;
|
|
1393
|
+
blockReason?: string;
|
|
1394
|
+
};
|
|
1395
|
+
type PluginHookAfterToolCallEvent = {
|
|
1396
|
+
toolCallId: string;
|
|
1397
|
+
toolName: string;
|
|
1398
|
+
params: Record<string, unknown>;
|
|
1399
|
+
result?: unknown;
|
|
1400
|
+
error?: string;
|
|
1401
|
+
durationMs?: number;
|
|
1402
|
+
};
|
|
1403
|
+
type PluginHookAgentEndEvent = {
|
|
1404
|
+
success: boolean;
|
|
1405
|
+
error?: string;
|
|
1406
|
+
durationMs?: number;
|
|
1407
|
+
};
|
|
1408
|
+
type PluginHookBeforeCompactionEvent = {
|
|
1409
|
+
messageCount: number;
|
|
1410
|
+
compactingCount?: number;
|
|
1411
|
+
};
|
|
1412
|
+
type PluginHookAfterCompactionEvent = {
|
|
1413
|
+
messageCount: number;
|
|
1414
|
+
compactedCount: number;
|
|
1415
|
+
};
|
|
1416
|
+
type PluginHookSessionStartEvent = {
|
|
1417
|
+
sessionId: string;
|
|
1418
|
+
};
|
|
1419
|
+
type PluginHookSessionEndEvent = {
|
|
1420
|
+
sessionId: string;
|
|
1421
|
+
messageCount: number;
|
|
1422
|
+
durationMs?: number;
|
|
1423
|
+
};
|
|
1424
|
+
type PluginHookSessionResetEvent = {
|
|
1425
|
+
action: "new" | "reset";
|
|
1426
|
+
sessionId: string;
|
|
1427
|
+
previousSessionId?: string;
|
|
1428
|
+
message: string;
|
|
1429
|
+
};
|
|
1430
|
+
type PluginHookMemoryChangedEvent = MemoryChangedEvent;
|
|
1431
|
+
type PluginHookHandlerMap = {
|
|
1432
|
+
before_model_resolve: (event: PluginHookBeforeModelResolveEvent, ctx: PluginHookAgentContext) => PluginHookBeforeModelResolveResult | void | Promise<PluginHookBeforeModelResolveResult | void>;
|
|
1433
|
+
before_prompt_build: (event: PluginHookBeforePromptBuildEvent, ctx: PluginHookAgentContext) => PluginHookBeforePromptBuildResult | void | Promise<PluginHookBeforePromptBuildResult | void>;
|
|
1434
|
+
after_prompt_build: (event: PluginHookAfterPromptBuildEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1435
|
+
llm_input: (event: PluginHookLlmInputEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1436
|
+
assistant_message_end: (event: PluginHookAssistantMessageEndEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1437
|
+
llm_output: (event: PluginHookLlmOutputEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1438
|
+
before_tool_call: (event: PluginHookBeforeToolCallEvent, ctx: PluginHookAgentContext) => PluginHookBeforeToolCallResult | void | Promise<PluginHookBeforeToolCallResult | void>;
|
|
1439
|
+
after_tool_call: (event: PluginHookAfterToolCallEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1440
|
+
agent_end: (event: PluginHookAgentEndEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1441
|
+
before_compaction: (event: PluginHookBeforeCompactionEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1442
|
+
after_compaction: (event: PluginHookAfterCompactionEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1443
|
+
session_start: (event: PluginHookSessionStartEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1444
|
+
session_end: (event: PluginHookSessionEndEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1445
|
+
session_reset: (event: PluginHookSessionResetEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1446
|
+
memory_changed: (event: PluginHookMemoryChangedEvent, ctx: PluginHookAgentContext) => void | Promise<void>;
|
|
1447
|
+
};
|
|
1448
|
+
type PluginHookRegistration<K extends PluginHookName = PluginHookName> = {
|
|
1449
|
+
pluginId: string;
|
|
1450
|
+
hookName: K;
|
|
1451
|
+
handler: PluginHookHandlerMap[K];
|
|
1452
|
+
priority?: number;
|
|
1453
|
+
source: string;
|
|
1454
|
+
};
|
|
1455
|
+
declare class PluginHookRegistry {
|
|
1456
|
+
private readonly hooks;
|
|
1457
|
+
register<K extends PluginHookName>(registration: PluginHookRegistration<K>): void;
|
|
1458
|
+
dispatch<K extends PluginHookName>(hookName: K, event: Parameters<PluginHookHandlerMap[K]>[0], ctx: Parameters<PluginHookHandlerMap[K]>[1]): Promise<Array<Awaited<ReturnType<PluginHookHandlerMap[K]>>>>;
|
|
1459
|
+
}
|
|
1460
|
+
//#endregion
|
|
1461
|
+
//#region src/plugins/tools.d.ts
|
|
1462
|
+
type PluginToolOptions = {
|
|
1463
|
+
optional?: boolean;
|
|
1464
|
+
name?: string;
|
|
1465
|
+
names?: string[];
|
|
1466
|
+
};
|
|
1467
|
+
type RegisteredPluginTool = {
|
|
1468
|
+
pluginId: string;
|
|
1469
|
+
tool: AgentTool;
|
|
1470
|
+
optional: boolean;
|
|
1471
|
+
names: string[];
|
|
1472
|
+
};
|
|
1473
|
+
declare class PluginToolRegistry {
|
|
1474
|
+
private readonly tools;
|
|
1475
|
+
register(pluginId: string, tool: AgentTool, opts?: PluginToolOptions): void;
|
|
1476
|
+
list(): RegisteredPluginTool[];
|
|
1477
|
+
namesForPlugin(pluginId: string): string[];
|
|
1478
|
+
resolveEnabled(allowlist?: string[]): AgentTool[];
|
|
1479
|
+
}
|
|
1480
|
+
//#endregion
|
|
1481
|
+
//#region src/plugins/runtime.d.ts
|
|
1482
|
+
type PluginRuntime = {
|
|
1483
|
+
version: string;
|
|
1484
|
+
logging: {
|
|
1485
|
+
getLogger: (name: string) => {
|
|
1486
|
+
info: (message: string) => void;
|
|
1487
|
+
warn: (message: string) => void;
|
|
1488
|
+
error: (message: string) => void;
|
|
1489
|
+
};
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1492
|
+
type CreatePluginRuntimeOptions = {
|
|
1493
|
+
pluginId: string;
|
|
1494
|
+
};
|
|
1495
|
+
declare function createPluginRuntime(options: CreatePluginRuntimeOptions): PluginRuntime;
|
|
1496
|
+
//#endregion
|
|
1497
|
+
//#region src/llm/client.d.ts
|
|
1498
|
+
type LlmChatMessage = {
|
|
1499
|
+
role: "system" | "user" | "assistant";
|
|
1500
|
+
content: string;
|
|
1501
|
+
};
|
|
1502
|
+
type LlmChatParams = {
|
|
1503
|
+
system?: string;
|
|
1504
|
+
user?: string;
|
|
1505
|
+
messages?: LlmChatMessage[];
|
|
1506
|
+
model?: string;
|
|
1507
|
+
temperature?: number;
|
|
1508
|
+
maxTokens?: number;
|
|
1509
|
+
timeoutMs?: number;
|
|
1510
|
+
signal?: AbortSignal;
|
|
1511
|
+
};
|
|
1512
|
+
type LlmChatResult = {
|
|
1513
|
+
text: string;
|
|
1514
|
+
usage: {
|
|
1515
|
+
input: number;
|
|
1516
|
+
output: number;
|
|
1517
|
+
total: number;
|
|
1518
|
+
};
|
|
1519
|
+
raw?: unknown;
|
|
1520
|
+
};
|
|
1521
|
+
//#endregion
|
|
1522
|
+
//#region src/plugins/runtime-context.d.ts
|
|
1523
|
+
type PluginRuntimeContext = {
|
|
1524
|
+
llm?: {
|
|
1525
|
+
baseUrl: string;
|
|
1526
|
+
apiKey: string;
|
|
1527
|
+
model: string;
|
|
1528
|
+
contextWindow?: number;
|
|
1529
|
+
};
|
|
1530
|
+
hookCtx?: PluginHookAgentContext;
|
|
1531
|
+
llmAllowlist?: string[];
|
|
1532
|
+
};
|
|
1533
|
+
//#endregion
|
|
1534
|
+
//#region src/plugins/loader.d.ts
|
|
1535
|
+
type PluginRecord = {
|
|
1536
|
+
id: string;
|
|
1537
|
+
source: string;
|
|
1538
|
+
origin: PluginOrigin;
|
|
1539
|
+
enabled: boolean;
|
|
1540
|
+
status: "loaded" | "disabled" | "error";
|
|
1541
|
+
error?: string;
|
|
1542
|
+
toolCount: number;
|
|
1543
|
+
hookCount: number;
|
|
1544
|
+
skills: string[];
|
|
1545
|
+
configSchema: boolean;
|
|
1546
|
+
};
|
|
1547
|
+
type PluginRegistry = {
|
|
1548
|
+
plugins: PluginRecord[];
|
|
1549
|
+
diagnostics: PluginDiagnostic[];
|
|
1550
|
+
tools: PluginToolRegistry;
|
|
1551
|
+
hooks: PluginHookRegistry;
|
|
1552
|
+
skills: string[];
|
|
1553
|
+
};
|
|
1554
|
+
type PluginLoadOptions = {
|
|
1555
|
+
registry: PluginManifestRegistry;
|
|
1556
|
+
plugins: NormalizedPluginsConfig;
|
|
1557
|
+
workspaceDir?: string;
|
|
1558
|
+
runtime?: PluginRuntimeContext;
|
|
1559
|
+
};
|
|
1560
|
+
type PluginApi = {
|
|
1561
|
+
id: string;
|
|
1562
|
+
source: string;
|
|
1563
|
+
rootDir: string;
|
|
1564
|
+
config: Record<string, unknown> | undefined;
|
|
1565
|
+
runtime: ReturnType<typeof createPluginRuntime>;
|
|
1566
|
+
llm: {
|
|
1567
|
+
chat: (params: LlmChatParams) => Promise<LlmChatResult>;
|
|
1568
|
+
};
|
|
1569
|
+
registerTool: (tool: Parameters<PluginToolRegistry["register"]>[1], opts?: Parameters<PluginToolRegistry["register"]>[2]) => void;
|
|
1570
|
+
registerEmbeddingProvider: (params: {
|
|
1571
|
+
id?: string;
|
|
1572
|
+
create: EmbeddingProviderFactory;
|
|
1573
|
+
}) => void;
|
|
1574
|
+
registerMemoryProvider: (params: {
|
|
1575
|
+
id?: string;
|
|
1576
|
+
create: MemoryProviderFactory;
|
|
1577
|
+
}) => void;
|
|
1578
|
+
registerHook: <K extends PluginHookName>(hookName: K, handler: PluginHookHandlerMap[K], opts?: {
|
|
1579
|
+
priority?: number;
|
|
1580
|
+
}) => void;
|
|
1581
|
+
registerSkillDir: (dir: string) => void;
|
|
1582
|
+
};
|
|
1583
|
+
declare function loadPlugins(options: PluginLoadOptions): PluginRegistry;
|
|
1584
|
+
//#endregion
|
|
1585
|
+
//#region src/plugins/manager.d.ts
|
|
1586
|
+
type PluginSystemOptions = {
|
|
1587
|
+
config?: PluginsConfig;
|
|
1588
|
+
dataDir?: string;
|
|
1589
|
+
workspaceDir?: string;
|
|
1590
|
+
bundledDir?: string;
|
|
1591
|
+
ownershipUid?: number | null;
|
|
1592
|
+
toolAllowlist?: string[];
|
|
1593
|
+
runtime?: PluginRuntimeContext;
|
|
1594
|
+
};
|
|
1595
|
+
type PluginSystem = {
|
|
1596
|
+
registry: PluginRegistry;
|
|
1597
|
+
diagnostics: PluginDiagnostic[];
|
|
1598
|
+
normalizedConfig: NormalizedPluginsConfig;
|
|
1599
|
+
};
|
|
1600
|
+
declare function initializePluginSystem(options?: PluginSystemOptions): PluginSystem;
|
|
1601
|
+
//#endregion
|
|
1602
|
+
//#region src/plugins/tool-hooks.d.ts
|
|
1603
|
+
declare function wrapToolsWithHooks(tools: AgentTool[], hooks: PluginHookRegistry, ctx: PluginHookAgentContext): AgentTool[];
|
|
1604
|
+
//#endregion
|
|
1605
|
+
export { AgentBinding, AgentConfig, AgentModelConfig, type AgentProgressEvent, type AgentRunParams, type AgentRunResult, AgentsConfig, BOOTSTRAP_FILE_NAMES, BOOTSTRAP_MAX_CHARS, BOOTSTRAP_TOTAL_MAX_CHARS, type BootstrapContextFile, type BootstrapEnsureResult, type BootstrapFile, type BootstrapMountResult, type BootstrapMountStatus, type CallbackEventPayload, type CallbackPayload, type Channel, type EmbeddingProvider, type EmbeddingProviderContext, type EmbeddingProviderFactory, type EmbeddingProviderRegistration, MAX_CHILDREN_PER_SESSION, MAX_SUBAGENT_DEPTH, type MemoryCallOptions, type MemoryChangeSource, type MemoryChangedEvent, type MemoryChangedHandler, MemoryIndexManager, type MemoryProvider, type MemoryProviderContext, type MemoryProviderFactory, type MemoryProviderRegistration, type MemoryProviderStatus, type MemorySearchOptions, type MemorySearchResult, type NormalizedPluginsConfig, PLUGIN_MANIFEST_FILENAME, PLUGIN_MANIFEST_FILENAMES, type PersistedSubagentRunRecord, type PluginApi, type PluginCandidate, type PluginConfigUiHint, type PluginDiagnostic, type PluginDiscoveryOptions, type PluginDiscoveryResult, type PluginEntryConfig, type PluginHookAfterCompactionEvent, type PluginHookAfterPromptBuildEvent, type PluginHookAfterToolCallEvent, type PluginHookAgentContext, type PluginHookAgentEndEvent, type PluginHookAssistantMessageEndEvent, type PluginHookBeforeCompactionEvent, type PluginHookBeforeModelResolveEvent, type PluginHookBeforeModelResolveResult, type PluginHookBeforePromptBuildEvent, type PluginHookBeforePromptBuildResult, type PluginHookBeforeToolCallEvent, type PluginHookBeforeToolCallResult, type PluginHookHandlerMap, type PluginHookLlmInputEvent, type PluginHookLlmOutputEvent, type PluginHookMemoryChangedEvent, type PluginHookName, PluginHookRegistry, type PluginHookSessionEndEvent, type PluginHookSessionResetEvent, type PluginHookSessionStartEvent, type PluginKind, type PluginManifest, type PluginManifestLoadResult, type PluginManifestRegistry, type PluginOrigin, type PluginRecord, type PluginRegistry, type PluginRuntime, type PluginRuntimeContext, type PluginSystem, type PluginSystemOptions, type PluginToolOptions, PluginToolRegistry, type PluginsConfig, type PluginsConfigValidationResult, type RegisteredPluginTool, type RunResultPayload, type SessionMetadata, type SessionSummary, type Skill, type SlashCommandList, type SubagentContext, SubagentRegistry, type SubagentRunRecord, type SubagentStatus, type SubagentToolsContext, type SystemPromptParams, type ToolLoopDetectionConfig, type TranscriptEntry, addAgent, addBinding, aimaxDir, appendToMemory, appendTranscriptEntry, bootstrapMountLayout, buildBootstrapContextFiles, buildSkillsPrompt, buildSubagentAnnounceMessage, buildSystemPrompt, cleanupOldSubagentRecords, createAgentTools, createApplyPatchTool, createBashTool, createBuiltinMemoryProvider, createEditFileTool, createExecTool, createImageTool, createListDirTool, createMemoryAppendTool, createMemoryGetTool, createMemorySearchTool, createPluginRuntime, createProcessTool, createReadFileTool, createSession, createSessionsSpawnTool, createSubagentsTool, createWriteFileTool, deleteMemoryFile, discoverAIMaxPlugins, ensureBootstrapMountLayout, ensureSession, generateSessionTitle, getAgentConfig, getMemoryLines, initializePluginSystem, inspectBootstrapMountLayout, isBootstrapMountLayoutReady, listAgents, listAvailableSlashCommands, listBindings, listMemoryFiles, listSessionSummaries, listSessions, listSubagentRunsFromDisk, loadAgentsConfig, loadBootstrapFiles, loadPluginManifest, loadPluginManifestRegistry, loadPlugins, loadSessionMetadata, loadSkills, loadSkillsFromDirs, loadSkillsWithPluginDirs, loadSubagentRegistryFromDisk, loadTranscript, memoryDir, metadataPath, normalizeAgentId, normalizePluginsConfig, primaryMemoryPath, readMemoryFile, readPrimaryMemory, registerEmbeddingProvider, registerMemoryProvider, removeAgent, removeBindings, replaceMemoryFile, resetEmbeddingProviderRegistryForTests, resetMemoryProviderRegistryForTests, resolveAgentDir, resolveAgentIdByBinding, resolveAgentsConfigPath, resolveDefaultAgentId, resolveEmbeddingProvider, resolveMemoryProvider, resolveModelFallbacks, resolveModelString, resolvePluginManifestPath, runAgent, saveAgentsConfig, saveSessionMetadata, saveSubagentRegistryToDisk, searchMemory, sessionDir, sessionsDir, skillsDir, transcriptPath, updateAgentIdentity, validatePluginsConfig, wrapToolsWithHooks };
|