@comma-agents/core 2.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +18 -0
- package/dist/abortable/abortable.d.ts +5 -0
- package/dist/abortable/abortable.types.d.ts +10 -0
- package/dist/abortable/index.d.ts +2 -0
- package/dist/agents/agent/agent.constants.d.ts +5 -0
- package/dist/agents/agent/agent.d.ts +24 -0
- package/dist/agents/agent/agent.types.d.ts +408 -0
- package/dist/agents/agent/agent.utils.d.ts +107 -0
- package/dist/agents/built-in/user/user-agent.d.ts +32 -0
- package/dist/agents/built-in/user/user-agent.types.d.ts +53 -0
- package/dist/agents/built-in/user/user-agent.utils.d.ts +2 -0
- package/dist/agents/hook-into-agent/hook-into-agent.d.ts +29 -0
- package/dist/agents/hooks/hooks.types.d.ts +64 -0
- package/dist/agents/hooks/hooks.utils.d.ts +9 -0
- package/dist/agents/hooks/index.d.ts +2 -0
- package/dist/agents/loader/index.d.ts +4 -0
- package/dist/agents/loader/loader.d.ts +49 -0
- package/dist/agents/loader/loader.schema.d.ts +270 -0
- package/dist/agents/loader/loader.types.d.ts +15 -0
- package/dist/conversation-context/conversation-context.d.ts +78 -0
- package/dist/conversation-context/conversation-context.types.d.ts +111 -0
- package/dist/conversation-context/conversation-context.utils.d.ts +6 -0
- package/dist/conversation-context/index.d.ts +3 -0
- package/dist/conversation-context/retention/compaction/compaction.constants.d.ts +3 -0
- package/dist/conversation-context/retention/compaction/compaction.d.ts +21 -0
- package/dist/conversation-context/retention/compaction/compaction.types.d.ts +26 -0
- package/dist/conversation-context/retention/compaction/index.d.ts +2 -0
- package/dist/conversation-context/retention/index.d.ts +4 -0
- package/dist/conversation-context/retention/retention.d.ts +9 -0
- package/dist/conversation-context/retention/retention.types.d.ts +90 -0
- package/dist/conversation-context/retention/retention.utils.d.ts +3 -0
- package/dist/conversation-context/retention/rolling-window/index.d.ts +2 -0
- package/dist/conversation-context/retention/rolling-window/rolling-window.d.ts +13 -0
- package/dist/conversation-context/retention/rolling-window/rolling-window.types.d.ts +5 -0
- package/dist/credentials/backends/json-file.d.ts +21 -0
- package/dist/credentials/credentials.constants.d.ts +9 -0
- package/dist/credentials/credentials.d.ts +18 -0
- package/dist/credentials/credentials.schema.d.ts +102 -0
- package/dist/credentials/credentials.types.d.ts +118 -0
- package/dist/credentials/credentials.utils.d.ts +30 -0
- package/dist/credentials/index.d.ts +6 -0
- package/dist/defaults/defaults.d.ts +108 -0
- package/dist/defaults/defaults.types.d.ts +51 -0
- package/dist/defaults/index.d.ts +2 -0
- package/dist/errors/index.d.ts +70 -0
- package/dist/flows/built-in/broadcast/broadcast-flow.constants.d.ts +2 -0
- package/dist/flows/built-in/broadcast/broadcast-flow.d.ts +30 -0
- package/dist/flows/built-in/cycle/cycle-flow.d.ts +53 -0
- package/dist/flows/built-in/sequential/sequential-flow.d.ts +25 -0
- package/dist/flows/flow/flow.d.ts +79 -0
- package/dist/flows/flow/flow.types.d.ts +179 -0
- package/dist/flows/flow/flow.utils.d.ts +18 -0
- package/dist/flows/hook-into-flow/hook-into-flow.d.ts +30 -0
- package/dist/flows/index.d.ts +6 -0
- package/dist/flows/loader/index.d.ts +4 -0
- package/dist/flows/loader/loader.d.ts +55 -0
- package/dist/flows/loader/loader.schema.d.ts +195 -0
- package/dist/flows/loader/loader.types.d.ts +27 -0
- package/dist/guard/guard.d.ts +17 -0
- package/dist/guard/guard.types.d.ts +112 -0
- package/dist/guard/index.d.ts +3 -0
- package/dist/guard/policies.d.ts +28 -0
- package/dist/hooks/built-in/token-tracking/index.d.ts +2 -0
- package/dist/hooks/built-in/token-tracking/token-tracking.constants.d.ts +14 -0
- package/dist/hooks/built-in/token-tracking/token-tracking.d.ts +87 -0
- package/dist/hooks/built-in/token-tracking/token-tracking.types.d.ts +136 -0
- package/dist/hooks/hooks.d.ts +10 -0
- package/dist/hooks/hooks.types.d.ts +11 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +8961 -0
- package/dist/language/index.d.ts +1 -0
- package/dist/language/language.types.d.ts +60 -0
- package/dist/model/index.d.ts +5 -0
- package/dist/model/model.d.ts +63 -0
- package/dist/model/model.types.d.ts +85 -0
- package/dist/model/model.utils.d.ts +151 -0
- package/dist/model/providers/catalog/catalog.d.ts +57 -0
- package/dist/model/providers/catalog/catalog.types.d.ts +50 -0
- package/dist/model/providers/catalog/catalog.utils.d.ts +15 -0
- package/dist/model/providers/catalog/index.d.ts +3 -0
- package/dist/model/providers/index.d.ts +7 -0
- package/dist/model/providers/listers/copilot.d.ts +10 -0
- package/dist/model/providers/listers/index.d.ts +2 -0
- package/dist/model/providers/listers/ollama.d.ts +9 -0
- package/dist/model/providers/providers.d.ts +69 -0
- package/dist/model/providers/providers.types.d.ts +157 -0
- package/dist/model/providers/providers.utils.d.ts +16 -0
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/message-builder.d.ts +89 -0
- package/dist/prompts/prompts.types.d.ts +86 -0
- package/dist/prompts/template/prompt-template.d.ts +22 -0
- package/dist/sandbox/in-sandbox.d.ts +31 -0
- package/dist/sandbox/index.d.ts +4 -0
- package/dist/sandbox/sandbox.constants.d.ts +31 -0
- package/dist/sandbox/sandbox.d.ts +11 -0
- package/dist/sandbox/sandbox.types.d.ts +105 -0
- package/dist/skills/index.d.ts +4 -0
- package/dist/skills/skills.constants.d.ts +10 -0
- package/dist/skills/skills.loader.d.ts +46 -0
- package/dist/skills/skills.registry.d.ts +18 -0
- package/dist/skills/skills.types.d.ts +66 -0
- package/dist/skills/skills.utils.d.ts +37 -0
- package/dist/strategy/discover/discover.d.ts +16 -0
- package/dist/strategy/discover/discover.types.d.ts +70 -0
- package/dist/strategy/discover/discover.utils.d.ts +95 -0
- package/dist/strategy/discover/index.d.ts +3 -0
- package/dist/strategy/exporter/exporter.d.ts +27 -0
- package/dist/strategy/exporter/exporter.types.d.ts +6 -0
- package/dist/strategy/index.d.ts +10 -0
- package/dist/strategy/loader/loader.d.ts +39 -0
- package/dist/strategy/loader/loader.types.d.ts +106 -0
- package/dist/strategy/loader/loader.utils.d.ts +20 -0
- package/dist/strategy/loader/project-loader.d.ts +9 -0
- package/dist/strategy/schema.d.ts +1032 -0
- package/dist/timeline/index.d.ts +4 -0
- package/dist/timeline/projections/conversation-context.d.ts +19 -0
- package/dist/timeline/projections/file-state.d.ts +8 -0
- package/dist/timeline/projections/index.d.ts +3 -0
- package/dist/timeline/timeline.d.ts +11 -0
- package/dist/timeline/timeline.types.d.ts +97 -0
- package/dist/tools/build-tool-system-prompt.d.ts +41 -0
- package/dist/tools/built-in/ask-question/ask-question.d.ts +21 -0
- package/dist/tools/built-in/ask-question/index.d.ts +2 -0
- package/dist/tools/built-in/create-file/create-file.d.ts +18 -0
- package/dist/tools/built-in/create-file/create-file.types.d.ts +11 -0
- package/dist/tools/built-in/create-file/index.d.ts +2 -0
- package/dist/tools/built-in/delete-file/delete-file.constants.d.ts +14 -0
- package/dist/tools/built-in/delete-file/delete-file.d.ts +5 -0
- package/dist/tools/built-in/delete-file/delete-file.types.d.ts +26 -0
- package/dist/tools/built-in/delete-file/index.d.ts +2 -0
- package/dist/tools/built-in/describe-tool.d.ts +61 -0
- package/dist/tools/built-in/edit-file/edit-file.d.ts +46 -0
- package/dist/tools/built-in/edit-file/edit-file.replacers.d.ts +81 -0
- package/dist/tools/built-in/edit-file/edit-file.types.d.ts +59 -0
- package/dist/tools/built-in/edit-file/edit-file.utils.d.ts +70 -0
- package/dist/tools/built-in/edit-file/index.d.ts +2 -0
- package/dist/tools/built-in/glob/glob.constants.d.ts +3 -0
- package/dist/tools/built-in/glob/glob.d.ts +25 -0
- package/dist/tools/built-in/glob/glob.types.d.ts +31 -0
- package/dist/tools/built-in/glob/glob.utils.d.ts +4 -0
- package/dist/tools/built-in/glob/index.d.ts +2 -0
- package/dist/tools/built-in/launch-strategy/index.d.ts +2 -0
- package/dist/tools/built-in/launch-strategy/launch-strategy.d.ts +26 -0
- package/dist/tools/built-in/launch-strategy/launch-strategy.types.d.ts +14 -0
- package/dist/tools/built-in/list-directory/index.d.ts +2 -0
- package/dist/tools/built-in/list-directory/list-directory.constants.d.ts +3 -0
- package/dist/tools/built-in/list-directory/list-directory.d.ts +20 -0
- package/dist/tools/built-in/list-directory/list-directory.types.d.ts +41 -0
- package/dist/tools/built-in/list-directory/list-directory.utils.d.ts +4 -0
- package/dist/tools/built-in/list-skills/index.d.ts +2 -0
- package/dist/tools/built-in/list-skills/list-skills.d.ts +5 -0
- package/dist/tools/built-in/list-skills/list-skills.types.d.ts +10 -0
- package/dist/tools/built-in/list-strategy/index.d.ts +2 -0
- package/dist/tools/built-in/list-strategy/list-strategy.d.ts +14 -0
- package/dist/tools/built-in/list-strategy/list-strategy.types.d.ts +33 -0
- package/dist/tools/built-in/load-skill/index.d.ts +2 -0
- package/dist/tools/built-in/load-skill/load-skill.d.ts +24 -0
- package/dist/tools/built-in/load-skill/load-skill.types.d.ts +15 -0
- package/dist/tools/built-in/lsp-request/index.d.ts +2 -0
- package/dist/tools/built-in/lsp-request/lsp-request.d.ts +4 -0
- package/dist/tools/built-in/lsp-request/lsp-request.schema.d.ts +23 -0
- package/dist/tools/built-in/lsp-request/lsp-request.types.d.ts +4 -0
- package/dist/tools/built-in/move-file/index.d.ts +2 -0
- package/dist/tools/built-in/move-file/move-file.d.ts +21 -0
- package/dist/tools/built-in/move-file/move-file.types.d.ts +12 -0
- package/dist/tools/built-in/read-file/index.d.ts +2 -0
- package/dist/tools/built-in/read-file/read-file.constants.d.ts +1 -0
- package/dist/tools/built-in/read-file/read-file.d.ts +32 -0
- package/dist/tools/built-in/read-file/read-file.types.d.ts +34 -0
- package/dist/tools/built-in/read-file/read-file.utils.d.ts +14 -0
- package/dist/tools/built-in/restore-file/index.d.ts +2 -0
- package/dist/tools/built-in/restore-file/restore-file.d.ts +16 -0
- package/dist/tools/built-in/restore-file/restore-file.types.d.ts +11 -0
- package/dist/tools/built-in/run-command/index.d.ts +2 -0
- package/dist/tools/built-in/run-command/run-command.constants.d.ts +23 -0
- package/dist/tools/built-in/run-command/run-command.d.ts +21 -0
- package/dist/tools/built-in/run-command/run-command.types.d.ts +81 -0
- package/dist/tools/built-in/run-command/run-command.utils.d.ts +37 -0
- package/dist/tools/built-in/search-files/index.d.ts +2 -0
- package/dist/tools/built-in/search-files/search-files.constants.d.ts +5 -0
- package/dist/tools/built-in/search-files/search-files.d.ts +30 -0
- package/dist/tools/built-in/search-files/search-files.types.d.ts +19 -0
- package/dist/tools/built-in/search-files/search-files.utils.d.ts +11 -0
- package/dist/tools/built-in/todo/todo.d.ts +62 -0
- package/dist/tools/built-in/todo/todo.types.d.ts +7 -0
- package/dist/tools/built-in/webfetch/webfetch.constants.d.ts +3 -0
- package/dist/tools/built-in/webfetch/webfetch.d.ts +33 -0
- package/dist/tools/built-in/webfetch/webfetch.types.d.ts +8 -0
- package/dist/tools/built-in/webfetch/webfetch.utils.d.ts +19 -0
- package/dist/tools/built-in/write-file/index.d.ts +2 -0
- package/dist/tools/built-in/write-file/write-file.d.ts +18 -0
- package/dist/tools/built-in/write-file/write-file.types.d.ts +11 -0
- package/dist/tools/define/define-tool.d.ts +15 -0
- package/dist/tools/io/atomic-write.d.ts +37 -0
- package/dist/tools/io/audit-sink.d.ts +29 -0
- package/dist/tools/io/audit.types.d.ts +115 -0
- package/dist/tools/io/audit.utils.d.ts +48 -0
- package/dist/tools/io/binary.d.ts +16 -0
- package/dist/tools/io/bom.d.ts +15 -0
- package/dist/tools/io/diff.d.ts +27 -0
- package/dist/tools/io/hash.d.ts +25 -0
- package/dist/tools/io/index.d.ts +19 -0
- package/dist/tools/io/newline.d.ts +34 -0
- package/dist/tools/io/sandbox-error.d.ts +13 -0
- package/dist/tools/io/session-file-state.d.ts +68 -0
- package/dist/tools/io/stale-file.d.ts +9 -0
- package/dist/tools/io/trash.d.ts +57 -0
- package/dist/tools/launch-strategy.types.d.ts +38 -0
- package/dist/tools/result/index.d.ts +1 -0
- package/dist/tools/result/result.d.ts +47 -0
- package/dist/tools/tool.constants.d.ts +7 -0
- package/dist/tools/tool.registry.d.ts +54 -0
- package/dist/tools/tool.types.d.ts +191 -0
- package/package.json +48 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata about a model's token limits.
|
|
3
|
+
*
|
|
4
|
+
* Used to compute context budget estimates (percentage used, remaining tokens).
|
|
5
|
+
* If context window information is unavailable, budget-related fields on
|
|
6
|
+
* `TokenSnapshot` will be `undefined`.
|
|
7
|
+
*/
|
|
8
|
+
export interface ModelMetadata {
|
|
9
|
+
/** Total context window size in tokens. */
|
|
10
|
+
readonly contextWindow: number;
|
|
11
|
+
/** Maximum output tokens the model can generate per response. */
|
|
12
|
+
readonly maxOutputTokens?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configuration for creating a TokenTracker.
|
|
16
|
+
*/
|
|
17
|
+
export interface TokenTrackerConfig {
|
|
18
|
+
/**
|
|
19
|
+
* Model identifier in `"providerID/modelID"` format (e.g., `"openai/gpt-4o"`).
|
|
20
|
+
* Used to look up context window metadata from the built-in model catalog.
|
|
21
|
+
*/
|
|
22
|
+
readonly model?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Explicit model metadata. When provided, overrides the built-in catalog lookup.
|
|
25
|
+
* Use this for models not in the catalog, or to override catalog values.
|
|
26
|
+
*/
|
|
27
|
+
readonly modelMetadata?: ModelMetadata;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A single recorded call's token usage, captured from the `afterCallResult` hook.
|
|
31
|
+
*/
|
|
32
|
+
export interface TokenUsageRecord {
|
|
33
|
+
/** Number of prompt (input) tokens for this call. */
|
|
34
|
+
readonly promptTokens: number;
|
|
35
|
+
/** Number of completion (output) tokens for this call. */
|
|
36
|
+
readonly completionTokens: number;
|
|
37
|
+
/** Total tokens for this call (`promptTokens + completionTokens`). */
|
|
38
|
+
readonly totalTokens: number;
|
|
39
|
+
/** Timestamp of when this usage was recorded. */
|
|
40
|
+
readonly timestamp: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A point-in-time snapshot of the tracker's accumulated state.
|
|
44
|
+
*
|
|
45
|
+
* All token counts are real values reported by the provider (post-call),
|
|
46
|
+
* not estimates. Context budget fields are present only when model metadata
|
|
47
|
+
* (context window size) is available.
|
|
48
|
+
*/
|
|
49
|
+
export interface TokenSnapshot {
|
|
50
|
+
/** Total prompt tokens across all recorded calls. */
|
|
51
|
+
readonly totalPromptTokens: number;
|
|
52
|
+
/** Total completion tokens across all recorded calls. */
|
|
53
|
+
readonly totalCompletionTokens: number;
|
|
54
|
+
/** Total tokens across all recorded calls. */
|
|
55
|
+
readonly totalTokens: number;
|
|
56
|
+
/** Number of calls recorded so far. */
|
|
57
|
+
readonly callCount: number;
|
|
58
|
+
/**
|
|
59
|
+
* The most recent call's prompt token count.
|
|
60
|
+
* This represents the current context window usage for the last call —
|
|
61
|
+
* the best indicator of how full the context window is right now.
|
|
62
|
+
* `undefined` if no calls have been recorded.
|
|
63
|
+
*/
|
|
64
|
+
readonly lastPromptTokens: number | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Context window size in tokens, if model metadata is available.
|
|
67
|
+
* `undefined` when no model metadata was provided or found in the catalog.
|
|
68
|
+
*/
|
|
69
|
+
readonly contextWindow: number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Maximum output tokens per response, if model metadata is available.
|
|
72
|
+
* `undefined` when not specified in metadata.
|
|
73
|
+
*/
|
|
74
|
+
readonly maxOutputTokens: number | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Percentage of the context window used by the most recent call's prompt.
|
|
77
|
+
* Value between 0 and 1 (e.g., 0.75 = 75% used).
|
|
78
|
+
* `undefined` when context window or last prompt token count is unavailable.
|
|
79
|
+
*/
|
|
80
|
+
readonly contextUsagePercent: number | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Estimated tokens remaining in the context window based on the most
|
|
83
|
+
* recent call's prompt token count.
|
|
84
|
+
* `undefined` when context window or last prompt token count is unavailable.
|
|
85
|
+
*/
|
|
86
|
+
readonly contextRemaining: number | undefined;
|
|
87
|
+
/** Individual call records in chronological order. */
|
|
88
|
+
readonly calls: readonly TokenUsageRecord[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A mutable token usage tracker. Accumulates real token usage from
|
|
92
|
+
* `afterCallResult` hooks and provides queryable snapshots.
|
|
93
|
+
*
|
|
94
|
+
* Created via `createTokenTracker()` and attached to agents via `useTokenTracking()`.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* import { useTokenTracking } from "@comma-agents/core";
|
|
99
|
+
*
|
|
100
|
+
* const tracker = useTokenTracking(agent, { model: "openai/gpt-4o" });
|
|
101
|
+
*
|
|
102
|
+
* await agent.call("Hello");
|
|
103
|
+
* const snapshot = tracker.snapshot();
|
|
104
|
+
* console.log(`Used ${snapshot.totalTokens} tokens`);
|
|
105
|
+
* console.log(`Context ${(snapshot.contextUsagePercent! * 100).toFixed(1)}% full`);
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export interface TokenTracker {
|
|
109
|
+
/**
|
|
110
|
+
* Record a call's token usage. Called automatically by the `afterCallResult`
|
|
111
|
+
* hook installed by `useTokenTracking()`.
|
|
112
|
+
*/
|
|
113
|
+
record(promptTokens: number, completionTokens: number): void;
|
|
114
|
+
/** Take a snapshot of accumulated usage. */
|
|
115
|
+
snapshot(): TokenSnapshot;
|
|
116
|
+
/** Clear all recorded usage data. */
|
|
117
|
+
reset(): void;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Configuration for `useTokenTracking()`.
|
|
121
|
+
*
|
|
122
|
+
* All fields are optional — when omitted, the model is auto-detected from
|
|
123
|
+
* the agent's config and looked up in the built-in catalog.
|
|
124
|
+
*/
|
|
125
|
+
export interface UseTokenTrackingConfig {
|
|
126
|
+
/**
|
|
127
|
+
* Explicit model identifier in `"providerID/modelID"` format.
|
|
128
|
+
* Overrides auto-detection from the agent's config.
|
|
129
|
+
*/
|
|
130
|
+
readonly model?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Explicit model metadata. When provided, overrides both auto-detection
|
|
133
|
+
* and catalog lookup. Use this for models not in the catalog.
|
|
134
|
+
*/
|
|
135
|
+
readonly modelMetadata?: ModelMetadata;
|
|
136
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SideEffectHook, TransformHook } from "./hooks.types";
|
|
2
|
+
/**
|
|
3
|
+
* Execute an array of side-effect hooks in order.
|
|
4
|
+
*/
|
|
5
|
+
export declare function runSideEffectHooks<HookValue>(hooks: ReadonlyArray<SideEffectHook<HookValue>> | undefined, value: HookValue): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Execute an array of transform hooks in order, chaining outputs.
|
|
8
|
+
* Returns the final transformed value.
|
|
9
|
+
*/
|
|
10
|
+
export declare function runTransformHooks<HookValue>(hooks: ReadonlyArray<TransformHook<HookValue>> | undefined, value: HookValue): Promise<HookValue>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A side-effect hook that receives context but does not transform values.
|
|
3
|
+
* Used for logging, metrics, state management, etc.
|
|
4
|
+
*/
|
|
5
|
+
export type SideEffectHook<HookValue> = (value: HookValue) => void | Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* A transform hook that receives a value and returns a (possibly modified) value.
|
|
8
|
+
* Used for altering messages, responses, etc. The output of one hook becomes
|
|
9
|
+
* the input of the next (chained).
|
|
10
|
+
*/
|
|
11
|
+
export type TransformHook<HookValue> = (value: HookValue) => HookValue | Promise<HookValue>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type { AbortableAsyncGenerator, AbortablePromise, } from "./abortable";
|
|
2
|
+
export { createAbortableGenerator, createAbortablePromise, } from "./abortable";
|
|
3
|
+
export { createAgent } from "./agents/agent/agent";
|
|
4
|
+
export type { Agent, AgentCallResult, AgentConfig, AgentOutputSchema, AgentStreamEvent, ModelOptions, } from "./agents/agent/agent.types";
|
|
5
|
+
export { createUserAgent } from "./agents/built-in/user/user-agent";
|
|
6
|
+
export type { InputCollector, InputRequest, UserAgentConfig, } from "./agents/built-in/user/user-agent.types";
|
|
7
|
+
export { hookIntoAgent } from "./agents/hook-into-agent/hook-into-agent";
|
|
8
|
+
export type { AgentHooks, ToolHooks } from "./agents/hooks/hooks.types";
|
|
9
|
+
export type { AgentDescription, LoadAgentOptions } from "./agents/loader/index";
|
|
10
|
+
export { AgentDescriptionSchema, loadAgent, loadAgentFromString, } from "./agents/loader/index";
|
|
11
|
+
export type { AssistantModelMessage, CompactionOptions, ContextPrepareInput, ContextUsage, ContextRecordTransform, ContextRetentionOptions, ContextTransformInput, ConversationHistory, ConversationRecord, ConversationRecordStatus, ConversationRetentionEvent, ConversationUsage, CreateConversationRecordInput, ModelMessage, ResponseMessage, RollingWindowOptions, SummarizeRecords, ToolModelMessage, UserModelMessage, } from "./conversation-context";
|
|
12
|
+
export type { ConversationContext, ConversationContextOptions, } from "./conversation-context/index";
|
|
13
|
+
export { applyCompaction, applyRollingWindow, contextUsageFromSteps, createConversationContext, createConversationRecord, parseConversationJson, parseConversationJsonl, parseConversationYaml, prepareContextRecords, recordsToMessages, recordToJsonlLine, serializeConversationRecordsJson, serializeConversationRecords, serializeConversationRecordsYaml, } from "./conversation-context/index";
|
|
14
|
+
export type { ApiCredential, AuthStatus, CreateCredentialStoreOptions, Credential, CredentialBackend, CredentialStore, CredentialStoreData, CustomCredential, EnvVarMap, OAuthCredential, } from "./credentials/index";
|
|
15
|
+
export { ApiCredentialSchema, CredentialSchema, CustomCredentialSchema, createCredentialStore, createJsonFileBackend, OAuthCredentialSchema, resolveCredentialsPath, resolveDataDir, } from "./credentials/index";
|
|
16
|
+
export type { GlobalDefaults, ProviderRegistration } from "./defaults/index";
|
|
17
|
+
export { getGlobalCredentialStore, getGlobalDefaults, getGlobalProviderResolver, registerProvider, resetGlobalDefaults, setGlobalCredentialStore, setProviderCacheDir, unregisterProvider, } from "./defaults/index";
|
|
18
|
+
export { AgentCallError, CommaAgentsError, FlowExecutionError, HookExecutionError, ModelResolutionError, SandboxViolationError, StrategyValidationError, ToolExecutionError, } from "./errors/index";
|
|
19
|
+
export type { BroadcastFlowConfig, CustomFlowConfig, CycleFlowConfig, CycleHooks, FlowConfig, FlowContext, FlowExecutor, FlowHooks, FlowResult, } from "./flows/index";
|
|
20
|
+
export { buildFlowAgent, createBroadcastFlow, createCycleFlow, createFlow, createSequentialFlow, hookIntoFlow, } from "./flows/index";
|
|
21
|
+
export type { FlowDescription, LoadFlowOptions } from "./flows/loader/index";
|
|
22
|
+
export { FlowDescriptionSchema, loadFlow, loadFlowFromString, } from "./flows/loader/index";
|
|
23
|
+
export type { AccessRequest, AccessType, Guard, GuardCallbacks, GuardPermissionRequest, GuardPolicySnapshot, Policy, PolicyDecision, } from "./guard/index";
|
|
24
|
+
export { approveCommandsPolicy, buildDefaultPolicies, createGuard, denyCommandsPolicy, forbiddenGlobsPolicy, pathPolicy, } from "./guard/index";
|
|
25
|
+
export type { SideEffectHook, TransformHook } from "./hooks";
|
|
26
|
+
export { runSideEffectHooks, runTransformHooks } from "./hooks";
|
|
27
|
+
export type { ModelMetadata, TokenSnapshot, TokenTracker, TokenTrackerConfig, TokenUsageRecord, UseTokenTrackingConfig, } from "./hooks/built-in/token-tracking/index";
|
|
28
|
+
export { createTokenTracker, useTokenTracking, } from "./hooks/built-in/token-tracking/index";
|
|
29
|
+
export type { LanguageDiagnostic, LanguageDiagnosticSeverity, LanguageHoverResult, LanguageLocation, LanguagePosition, LanguageRange, LanguageService, LanguageSymbol, LspMethod, LspRequest, LspResponse, } from "./language/index";
|
|
30
|
+
export type { CatalogData, CatalogModel, CatalogProvider, ListModelsContext, ListModelsFn, ListModelsResult, Modality, ModelCapabilities, ModelCost, ModelInfo, ModelModalities, ModelStatus, ModelsSource, ParsedModel, ProviderDefinition, ProviderFactory, ProviderInfo, ProviderResolver, ProviderWithModels, } from "./model/index";
|
|
31
|
+
export { extractProviderIds, getCatalogModels, getCatalogProvider, getCatalogProviderSync, getCatalogSnapshot, getModelCapabilities, getModelMetadata, getQualifiedModelMetadata, getProviderDefinition, getProviderInfo, getProviderPackage, getProvidersForModel, getReverseModelIndex, isKnownProvider, listAllProviderModels, listCatalogProviders, listProviderDefinitions, listProviderModels, listProviders, loadCatalog, parseModel, refreshCatalog, registerModel, registerProviderDefinition, resetCatalog, resetModelRegistry, resetProviderRegistry, resolveCatalogCachePath, resolveModel, toModelInfo, unregisterModel, unregisterProviderDefinition, } from "./model/index";
|
|
32
|
+
export type { BuildMessagesOptions, PromptTemplate, PromptTemplateConfig, SystemPromptOptions, TemplateValue, TemplateVariables, } from "./prompts/index";
|
|
33
|
+
export { buildMessages, createPromptTemplate, resolveSystemPrompt, } from "./prompts/index";
|
|
34
|
+
export type { AccessMode, PathPolicy, PermissionDecision, PermissionOperation, PermissionRequest, PermissionRequester, PolicyPatch, Sandbox, SandboxConfig, } from "./sandbox/index";
|
|
35
|
+
export { createSandbox, DEFAULT_DAEMON_SANDBOX_CONFIG, DEFAULT_FORBIDDEN_GLOBS, DEFAULT_SANDBOX_CONFIG, getSandbox, inSandbox, PERMISSIVE_SANDBOX_CONFIG, } from "./sandbox/index";
|
|
36
|
+
export type { LoadSkillsOptions, Skill, SkillLoadResult, SkillLoadWarning, SkillMetadata, SkillRegistry, } from "./skills/index";
|
|
37
|
+
export { buildSkillsPromptHeader, createSkillRegistry, loadSkills, } from "./skills/index";
|
|
38
|
+
export type { AgentDef, AgentStep, BroadcastFlowDef, BuiltInToolName, CommaProjectManifest, CycleFlowDef, DiscoveredStrategy, DiscoveredStrategyOrigin, DiscoverStrategiesOptions, DiscoverStrategiesResult, DiscoveryWarning, ExportStrategyOptions, FlowDef, LLMAgentDef, LoadedProject, LoadedStrategy, LoadStrategyOptions, SequentialFlowDef, Strategy, UserAgentDef, } from "./strategy/index";
|
|
39
|
+
export { CommaProjectManifestSchema, discoverStrategies, exportStrategy, isAgentStep, isFlowDef, isLLMAgentDef, isUserAgentDef, loadProject, loadStrategy, loadStrategyFromString, readStrategyFile, StrategySchema, } from "./strategy/index";
|
|
40
|
+
export type { ProjectedConversationContext, Timeline, TimelineEvent, TimelineFilter, } from "./timeline/index";
|
|
41
|
+
export { createTimeline, projectConversationContext, projectFileState, } from "./timeline/index";
|
|
42
|
+
export { buildToolSystemPrompt, mergeSystemPrompts, } from "./tools/build-tool-system-prompt";
|
|
43
|
+
export type { LspRequestData } from "./tools/built-in/lsp-request";
|
|
44
|
+
export { defineTool } from "./tools/define/define-tool";
|
|
45
|
+
export type { AuditEntry, AuditOperation, AuditSink, FileAuditSinkOptions, NewlineStyle, SessionFileEntry, SessionFileState, TrashEntry, TrashMetadata, UnifiedDiffOptions, WriteAtomicOptions, } from "./tools/io";
|
|
46
|
+
export { applyBom, applyNewline, BINARY_DETECTION_SAMPLE_BYTES, BOM, buildSessionFileState, clearTrash, createFileAuditSink, createMemoryAuditSink, detectNewline, hasBom, isLikelyBinary, listTrash, moveToTrash, restoreFromTrash, STALE_FILE_RECOVERY_HINT, sha256OfBuffer, sha256OfFile, stripBom, toLF, trashWorkspaceDir, unifiedDiff, verifySessionFileState, writeAtomic, } from "./tools/io";
|
|
47
|
+
export type { LaunchStrategyHandle, LaunchStrategyRequest, LaunchStrategyResult, } from "./tools/launch-strategy.types";
|
|
48
|
+
export { errorResult, okResult, toolError } from "./tools/result";
|
|
49
|
+
export { getRegisteredToolNames, registerTool, resetToolRegistry, resolveTools, unregisterTool, } from "./tools/tool.registry";
|
|
50
|
+
export type { ToolContext, ToolDefinition as ToolDef, ToolError, ToolErrorKind, ToolResult, } from "./tools/tool.types";
|