inferoa 0.1.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 +176 -0
- package/README.md +154 -0
- package/dist/src/app.d.ts +16 -0
- package/dist/src/app.js +17 -0
- package/dist/src/app.js.map +1 -0
- package/dist/src/autoresearch/state.d.ts +106 -0
- package/dist/src/autoresearch/state.js +469 -0
- package/dist/src/autoresearch/state.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +415 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/code-intelligence/codegraph-engine.d.ts +55 -0
- package/dist/src/code-intelligence/codegraph-engine.js +593 -0
- package/dist/src/code-intelligence/codegraph-engine.js.map +1 -0
- package/dist/src/code-intelligence/hub.d.ts +37 -0
- package/dist/src/code-intelligence/hub.js +65 -0
- package/dist/src/code-intelligence/hub.js.map +1 -0
- package/dist/src/config/config.d.ts +12 -0
- package/dist/src/config/config.js +229 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/defaults.d.ts +2 -0
- package/dist/src/config/defaults.js +44 -0
- package/dist/src/config/defaults.js.map +1 -0
- package/dist/src/config/secret-vault.d.ts +3 -0
- package/dist/src/config/secret-vault.js +106 -0
- package/dist/src/config/secret-vault.js.map +1 -0
- package/dist/src/context/compressor.d.ts +33 -0
- package/dist/src/context/compressor.js +501 -0
- package/dist/src/context/compressor.js.map +1 -0
- package/dist/src/context/prompt.d.ts +26 -0
- package/dist/src/context/prompt.js +572 -0
- package/dist/src/context/prompt.js.map +1 -0
- package/dist/src/daemon/serve.d.ts +2 -0
- package/dist/src/daemon/serve.js +11 -0
- package/dist/src/daemon/serve.js.map +1 -0
- package/dist/src/daemon/supervisor.d.ts +33 -0
- package/dist/src/daemon/supervisor.js +252 -0
- package/dist/src/daemon/supervisor.js.map +1 -0
- package/dist/src/goals/state.d.ts +105 -0
- package/dist/src/goals/state.js +736 -0
- package/dist/src/goals/state.js.map +1 -0
- package/dist/src/model/endpoint-signals.d.ts +15 -0
- package/dist/src/model/endpoint-signals.js +186 -0
- package/dist/src/model/endpoint-signals.js.map +1 -0
- package/dist/src/model/gateway.d.ts +11 -0
- package/dist/src/model/gateway.js +455 -0
- package/dist/src/model/gateway.js.map +1 -0
- package/dist/src/plans/state.d.ts +28 -0
- package/dist/src/plans/state.js +123 -0
- package/dist/src/plans/state.js.map +1 -0
- package/dist/src/runtime.d.ts +92 -0
- package/dist/src/runtime.js +757 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/session/store.d.ts +84 -0
- package/dist/src/session/store.js +593 -0
- package/dist/src/session/store.js.map +1 -0
- package/dist/src/session/workspace.d.ts +2 -0
- package/dist/src/session/workspace.js +14 -0
- package/dist/src/session/workspace.js.map +1 -0
- package/dist/src/skills/registry.d.ts +24 -0
- package/dist/src/skills/registry.js +203 -0
- package/dist/src/skills/registry.js.map +1 -0
- package/dist/src/tools/autoresearch-tools.d.ts +6 -0
- package/dist/src/tools/autoresearch-tools.js +412 -0
- package/dist/src/tools/autoresearch-tools.js.map +1 -0
- package/dist/src/tools/clarify-tool.d.ts +3 -0
- package/dist/src/tools/clarify-tool.js +107 -0
- package/dist/src/tools/clarify-tool.js.map +1 -0
- package/dist/src/tools/code-intelligence.d.ts +15 -0
- package/dist/src/tools/code-intelligence.js +391 -0
- package/dist/src/tools/code-intelligence.js.map +1 -0
- package/dist/src/tools/context.d.ts +11 -0
- package/dist/src/tools/context.js +2 -0
- package/dist/src/tools/context.js.map +1 -0
- package/dist/src/tools/goal-tools.d.ts +3 -0
- package/dist/src/tools/goal-tools.js +279 -0
- package/dist/src/tools/goal-tools.js.map +1 -0
- package/dist/src/tools/omni-tools.d.ts +8 -0
- package/dist/src/tools/omni-tools.js +349 -0
- package/dist/src/tools/omni-tools.js.map +1 -0
- package/dist/src/tools/permissions.d.ts +11 -0
- package/dist/src/tools/permissions.js +74 -0
- package/dist/src/tools/permissions.js.map +1 -0
- package/dist/src/tools/plan-tools.d.ts +3 -0
- package/dist/src/tools/plan-tools.js +314 -0
- package/dist/src/tools/plan-tools.js.map +1 -0
- package/dist/src/tools/process-tools.d.ts +6 -0
- package/dist/src/tools/process-tools.js +199 -0
- package/dist/src/tools/process-tools.js.map +1 -0
- package/dist/src/tools/registry.d.ts +20 -0
- package/dist/src/tools/registry.js +187 -0
- package/dist/src/tools/registry.js.map +1 -0
- package/dist/src/tools/schemas.d.ts +3 -0
- package/dist/src/tools/schemas.js +500 -0
- package/dist/src/tools/schemas.js.map +1 -0
- package/dist/src/tools/skill-tools.d.ts +6 -0
- package/dist/src/tools/skill-tools.js +124 -0
- package/dist/src/tools/skill-tools.js.map +1 -0
- package/dist/src/tools/text-args.d.ts +5 -0
- package/dist/src/tools/text-args.js +22 -0
- package/dist/src/tools/text-args.js.map +1 -0
- package/dist/src/tools/web-search.d.ts +5 -0
- package/dist/src/tools/web-search.js +602 -0
- package/dist/src/tools/web-search.js.map +1 -0
- package/dist/src/tools/workspace-tools.d.ts +17 -0
- package/dist/src/tools/workspace-tools.js +561 -0
- package/dist/src/tools/workspace-tools.js.map +1 -0
- package/dist/src/tui/activity.d.ts +11 -0
- package/dist/src/tui/activity.js +75 -0
- package/dist/src/tui/activity.js.map +1 -0
- package/dist/src/tui/ansi.d.ts +24 -0
- package/dist/src/tui/ansi.js +131 -0
- package/dist/src/tui/ansi.js.map +1 -0
- package/dist/src/tui/app.d.ts +163 -0
- package/dist/src/tui/app.js +4204 -0
- package/dist/src/tui/app.js.map +1 -0
- package/dist/src/tui/cache-footer.d.ts +21 -0
- package/dist/src/tui/cache-footer.js +75 -0
- package/dist/src/tui/cache-footer.js.map +1 -0
- package/dist/src/tui/clarify.d.ts +14 -0
- package/dist/src/tui/clarify.js +187 -0
- package/dist/src/tui/clarify.js.map +1 -0
- package/dist/src/tui/composer.d.ts +79 -0
- package/dist/src/tui/composer.js +592 -0
- package/dist/src/tui/composer.js.map +1 -0
- package/dist/src/tui/event-view.d.ts +5 -0
- package/dist/src/tui/event-view.js +392 -0
- package/dist/src/tui/event-view.js.map +1 -0
- package/dist/src/tui/home.d.ts +7 -0
- package/dist/src/tui/home.js +92 -0
- package/dist/src/tui/home.js.map +1 -0
- package/dist/src/tui/markdown.d.ts +18 -0
- package/dist/src/tui/markdown.js +271 -0
- package/dist/src/tui/markdown.js.map +1 -0
- package/dist/src/tui/mode-footer.d.ts +9 -0
- package/dist/src/tui/mode-footer.js +62 -0
- package/dist/src/tui/mode-footer.js.map +1 -0
- package/dist/src/tui/plan-view.d.ts +8 -0
- package/dist/src/tui/plan-view.js +45 -0
- package/dist/src/tui/plan-view.js.map +1 -0
- package/dist/src/tui/prompt-queue.d.ts +18 -0
- package/dist/src/tui/prompt-queue.js +27 -0
- package/dist/src/tui/prompt-queue.js.map +1 -0
- package/dist/src/tui/resize.d.ts +7 -0
- package/dist/src/tui/resize.js +15 -0
- package/dist/src/tui/resize.js.map +1 -0
- package/dist/src/tui/session-picker.d.ts +10 -0
- package/dist/src/tui/session-picker.js +17 -0
- package/dist/src/tui/session-picker.js.map +1 -0
- package/dist/src/tui/session-transcript.d.ts +2 -0
- package/dist/src/tui/session-transcript.js +44 -0
- package/dist/src/tui/session-transcript.js.map +1 -0
- package/dist/src/tui/slash-notice.d.ts +2 -0
- package/dist/src/tui/slash-notice.js +9 -0
- package/dist/src/tui/slash-notice.js.map +1 -0
- package/dist/src/tui/slash.d.ts +21 -0
- package/dist/src/tui/slash.js +103 -0
- package/dist/src/tui/slash.js.map +1 -0
- package/dist/src/tui/splash.d.ts +4 -0
- package/dist/src/tui/splash.js +64 -0
- package/dist/src/tui/splash.js.map +1 -0
- package/dist/src/tui/tool-renderer.d.ts +6 -0
- package/dist/src/tui/tool-renderer.js +1024 -0
- package/dist/src/tui/tool-renderer.js.map +1 -0
- package/dist/src/tui/transcript-spacing.d.ts +1 -0
- package/dist/src/tui/transcript-spacing.js +4 -0
- package/dist/src/tui/transcript-spacing.js.map +1 -0
- package/dist/src/types.d.ts +220 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/util/abort.d.ts +3 -0
- package/dist/src/util/abort.js +19 -0
- package/dist/src/util/abort.js.map +1 -0
- package/dist/src/util/clock.d.ts +2 -0
- package/dist/src/util/clock.js +7 -0
- package/dist/src/util/clock.js.map +1 -0
- package/dist/src/util/fs.d.ts +13 -0
- package/dist/src/util/fs.js +75 -0
- package/dist/src/util/fs.js.map +1 -0
- package/dist/src/util/hash.d.ts +6 -0
- package/dist/src/util/hash.js +50 -0
- package/dist/src/util/hash.js.map +1 -0
- package/dist/src/util/limit.d.ts +11 -0
- package/dist/src/util/limit.js +29 -0
- package/dist/src/util/limit.js.map +1 -0
- package/dist/src/util/types.d.ts +22 -0
- package/dist/src/util/types.js +33 -0
- package/dist/src/util/types.js.map +1 -0
- package/dist/src/validation/acceptance.d.ts +12 -0
- package/dist/src/validation/acceptance.js +251 -0
- package/dist/src/validation/acceptance.js.map +1 -0
- package/dist/src/validation/milestone.d.ts +2 -0
- package/dist/src/validation/milestone.js +141 -0
- package/dist/src/validation/milestone.js.map +1 -0
- package/docs/final-acceptance-task.md +193 -0
- package/docs/public-source-hygiene.md +21 -0
- package/docs/roadmap.md +265 -0
- package/docs/tui-product-design.md +270 -0
- package/package.json +67 -0
- package/skills/coding-workflow/SKILL.md +16 -0
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
function objectSchema(properties, required = []) {
|
|
2
|
+
return {
|
|
3
|
+
type: "object",
|
|
4
|
+
additionalProperties: false,
|
|
5
|
+
properties,
|
|
6
|
+
required,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
const string = (description) => ({ type: "string", description });
|
|
10
|
+
const number = (description) => ({ type: "number", description });
|
|
11
|
+
const boolean = (description) => ({ type: "boolean", description });
|
|
12
|
+
const jsonObject = (description) => ({ type: "object", description, additionalProperties: true });
|
|
13
|
+
const goalStep = objectSchema({
|
|
14
|
+
id: string("Optional stable step id. If omitted, one is derived from the title."),
|
|
15
|
+
title: string("Concrete goal step title."),
|
|
16
|
+
status: string("Optional status: pending, in_progress, completed, blocked, or skipped."),
|
|
17
|
+
notes: string("Optional short notes for the step."),
|
|
18
|
+
evidence: jsonObject("Optional structured evidence for this step."),
|
|
19
|
+
}, ["title"]);
|
|
20
|
+
const clarifyChoice = objectSchema({
|
|
21
|
+
id: string("Optional stable choice id."),
|
|
22
|
+
label: string("User-facing choice label."),
|
|
23
|
+
description: string("Optional short explanation of this choice."),
|
|
24
|
+
}, ["label"]);
|
|
25
|
+
const DEFINITIONS = [
|
|
26
|
+
{
|
|
27
|
+
name: "apply_patch",
|
|
28
|
+
description: "Apply a complete unified diff patch in the workspace. Prefer this for code edits. Include file headers and valid hunk headers/context; read the target file first when uncertain.",
|
|
29
|
+
permission: "write",
|
|
30
|
+
parameters: objectSchema({ patch: string("Complete unified diff patch with file headers and valid hunks.") }, ["patch"]),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "ast_edit",
|
|
34
|
+
description: "Apply a structured AST edit for TypeScript/JavaScript or Python selectors. Escaped newlines in content are normalized, and successful edits return a diff.",
|
|
35
|
+
permission: "write",
|
|
36
|
+
parameters: objectSchema({
|
|
37
|
+
language: string("Language id: typescript, javascript, tsx, jsx, or python."),
|
|
38
|
+
path: string("Workspace-relative file path."),
|
|
39
|
+
operation: string("replace_node, insert_before, insert_after, or delete_node."),
|
|
40
|
+
selector: string("Selector such as function:name, class:name, import, or text:literal."),
|
|
41
|
+
content: string("Replacement or inserted content. JSON escaped newlines such as \\n are accepted."),
|
|
42
|
+
position: string("Optional language-specific position hint."),
|
|
43
|
+
}, ["language", "path", "operation", "selector"]),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "ast_grep",
|
|
47
|
+
description: "Search TypeScript/JavaScript or Python structure with a compact selector.",
|
|
48
|
+
permission: "read",
|
|
49
|
+
parameters: objectSchema({
|
|
50
|
+
language: string("Language id."),
|
|
51
|
+
path: string("Workspace-relative file path."),
|
|
52
|
+
selector: string("Selector such as function:name, class:name, import, or text:literal."),
|
|
53
|
+
limit: number("Maximum matches."),
|
|
54
|
+
page: string("Opaque page token."),
|
|
55
|
+
}, ["language", "path", "selector"]),
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "audio_generation",
|
|
59
|
+
description: "Generate audio through a configured endpoint-backed Omni tool.",
|
|
60
|
+
permission: "network",
|
|
61
|
+
parameters: objectSchema({
|
|
62
|
+
prompt: string("Audio generation prompt."),
|
|
63
|
+
model: string("Optional model override."),
|
|
64
|
+
duration: number("Optional duration in seconds."),
|
|
65
|
+
voice: string("Optional voice name."),
|
|
66
|
+
}, ["prompt"]),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "audio_understanding",
|
|
70
|
+
description: "Analyze audio inputs through a configured endpoint-backed Omni tool.",
|
|
71
|
+
permission: "network",
|
|
72
|
+
parameters: objectSchema({
|
|
73
|
+
inputs: { type: "array", items: string("Audio URL, file path, or data URI.") },
|
|
74
|
+
prompt: string("Question or instruction."),
|
|
75
|
+
model: string("Optional model override."),
|
|
76
|
+
}, ["inputs", "prompt"]),
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "clarify",
|
|
80
|
+
description: "Ask the user for a missing decision before taking an action that would otherwise rely on a risky assumption. Provide concise choices when possible, allow free-form input when the user may need to explain constraints, and use the returned answer as tool evidence.",
|
|
81
|
+
permission: "read",
|
|
82
|
+
parameters: objectSchema({
|
|
83
|
+
question: string("The specific question to ask the user."),
|
|
84
|
+
details: string("Optional short context explaining why the answer is needed."),
|
|
85
|
+
choices: { type: "array", description: "Optional mutually exclusive choices for the user.", items: clarifyChoice },
|
|
86
|
+
allow_freeform: boolean("Allow the user to type a custom answer. Defaults to true."),
|
|
87
|
+
placeholder: string("Optional placeholder for free-form input."),
|
|
88
|
+
}, ["question"]),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "complete_step",
|
|
92
|
+
description: "Record that a milestone/task step completed with concrete evidence.",
|
|
93
|
+
permission: "read",
|
|
94
|
+
parameters: objectSchema({
|
|
95
|
+
step_id: string("Stable step id."),
|
|
96
|
+
evidence: jsonObject("Evidence object or concise structured proof."),
|
|
97
|
+
}, ["step_id", "evidence"]),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: "edit_file",
|
|
101
|
+
description: "Replace exact text in a workspace file. If no exact match is found, the result includes nearby similar lines; escaped multiline text is accepted as a fallback.",
|
|
102
|
+
permission: "write",
|
|
103
|
+
parameters: objectSchema({
|
|
104
|
+
path: string("Workspace-relative file path."),
|
|
105
|
+
old_text: string("Exact text to replace. Escaped multiline text such as \\n is accepted as a fallback."),
|
|
106
|
+
new_text: string("Replacement text."),
|
|
107
|
+
occurrence: number("1-based occurrence to replace. Defaults to 1."),
|
|
108
|
+
}, ["path", "old_text", "new_text"]),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "file_search",
|
|
112
|
+
description: "Search workspace text using rg when available, then grep or a bounded built-in fallback.",
|
|
113
|
+
permission: "read",
|
|
114
|
+
parameters: objectSchema({
|
|
115
|
+
query: string("Search query or regex."),
|
|
116
|
+
path: string("Optional workspace-relative path."),
|
|
117
|
+
glob: string("Optional glob filter."),
|
|
118
|
+
regex: boolean("Treat query as regex."),
|
|
119
|
+
case_sensitive: boolean("Case-sensitive search."),
|
|
120
|
+
limit: number("Maximum results."),
|
|
121
|
+
page: string("Opaque page token."),
|
|
122
|
+
}, ["query"]),
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "git_diff",
|
|
126
|
+
description: "Show bounded git diff output.",
|
|
127
|
+
permission: "read",
|
|
128
|
+
parameters: objectSchema({
|
|
129
|
+
cwd: string("Optional workspace-relative cwd."),
|
|
130
|
+
staged: boolean("Show staged diff."),
|
|
131
|
+
path: string("Optional path filter."),
|
|
132
|
+
}),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "git_show",
|
|
136
|
+
description: "Show a bounded git object or file at revision.",
|
|
137
|
+
permission: "read",
|
|
138
|
+
parameters: objectSchema({
|
|
139
|
+
rev: string("Revision or object."),
|
|
140
|
+
cwd: string("Optional workspace-relative cwd."),
|
|
141
|
+
path: string("Optional path filter."),
|
|
142
|
+
}, ["rev"]),
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "git_status",
|
|
146
|
+
description: "Show bounded git status.",
|
|
147
|
+
permission: "read",
|
|
148
|
+
parameters: objectSchema({ cwd: string("Optional workspace-relative cwd.") }),
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "glob",
|
|
152
|
+
description: "Find workspace paths using a simple glob pattern.",
|
|
153
|
+
permission: "read",
|
|
154
|
+
parameters: objectSchema({
|
|
155
|
+
pattern: string("Glob pattern."),
|
|
156
|
+
cwd: string("Optional workspace-relative cwd."),
|
|
157
|
+
limit: number("Maximum paths."),
|
|
158
|
+
page: string("Opaque page token."),
|
|
159
|
+
}, ["pattern"]),
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "goal",
|
|
163
|
+
description: "Manage the active goal-mode objective and its internal planning state for this session. Use create only when no goal exists; decompose/update_plan to keep a native step plan current; update_step as work, evidence, and blockers change; get to inspect budget/status; resume for paused goals; complete only after the objective is genuinely achieved and include a summary; drop only when the goal should be discarded.",
|
|
164
|
+
permission: "read",
|
|
165
|
+
parameters: objectSchema({
|
|
166
|
+
op: string("Operation: create, get, decompose, update_plan, update_step, resume, complete, or drop."),
|
|
167
|
+
objective: string("Goal objective. Required for op=create."),
|
|
168
|
+
token_budget: number("Optional positive token budget for op=create."),
|
|
169
|
+
steps: { type: "array", description: "Concrete internal goal steps for op=create, decompose, or update_plan.", items: goalStep },
|
|
170
|
+
active_step_id: string("Optional active step id for op=create, decompose, update_plan, or update_step."),
|
|
171
|
+
step_id: string("Step id to update for op=update_step."),
|
|
172
|
+
title: string("Optional replacement title or title for a newly inserted step when op=update_step."),
|
|
173
|
+
status: string("Step status for op=update_step: pending, in_progress, completed, blocked, or skipped."),
|
|
174
|
+
notes: string("Optional notes for op=update_step. Empty string clears notes."),
|
|
175
|
+
evidence: jsonObject("Optional structured step evidence for op=update_step."),
|
|
176
|
+
summary: string("Completion summary for op=complete, or reason for op=drop."),
|
|
177
|
+
force: boolean("Allow op=complete even if internal goal plan has unfinished steps."),
|
|
178
|
+
}, ["op"]),
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "image_generation",
|
|
182
|
+
description: "Generate images through a configured endpoint-backed Omni tool.",
|
|
183
|
+
permission: "network",
|
|
184
|
+
parameters: objectSchema({
|
|
185
|
+
prompt: string("Image generation prompt."),
|
|
186
|
+
model: string("Optional model override."),
|
|
187
|
+
size: string("Optional size such as 1024x1024."),
|
|
188
|
+
seed: number("Optional seed."),
|
|
189
|
+
}, ["prompt"]),
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "init_experiment",
|
|
193
|
+
description: "Initialize an active autoresearch experiment after ./autoresearch.sh exists. Defines the primary metric, direction, scope, constraints, and soft iteration cap.",
|
|
194
|
+
permission: "read",
|
|
195
|
+
parameters: objectSchema({
|
|
196
|
+
name: string("Experiment name."),
|
|
197
|
+
goal: string("Optional experiment goal."),
|
|
198
|
+
primary_metric: string("Primary metric name printed by the harness as METRIC name=value."),
|
|
199
|
+
metric_unit: string("Metric unit such as ms, tokens, or percent."),
|
|
200
|
+
direction: string("Better direction: lower or higher."),
|
|
201
|
+
scope_paths: { type: "array", items: string("Expected-to-modify path or glob.") },
|
|
202
|
+
off_limits: { type: "array", items: string("Path or glob that should not be modified.") },
|
|
203
|
+
constraints: { type: "array", items: string("Free-form experiment constraint.") },
|
|
204
|
+
max_iterations: number("Optional positive keep-run cap."),
|
|
205
|
+
validate_harness: boolean("Run ./autoresearch.sh during initialization and require the primary metric. Defaults to true."),
|
|
206
|
+
}, ["name", "primary_metric"]),
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "list_dir",
|
|
210
|
+
description: "List files and folders in a workspace directory.",
|
|
211
|
+
permission: "read",
|
|
212
|
+
parameters: objectSchema({
|
|
213
|
+
path: string("Workspace-relative directory path. Use '.' or '/' for the workspace root; absolute filesystem paths are not allowed."),
|
|
214
|
+
limit: number("Maximum entries."),
|
|
215
|
+
page: string("Opaque page token."),
|
|
216
|
+
}, ["path"]),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "plan",
|
|
220
|
+
description: "Manage plan mode for this session. Use create only to start planning; when a plan is already active, use get/update instead. Use update to persist questions, decisions, markdown plan body, and summary. Use approve only when the plan is ready for the user to confirm execution.",
|
|
221
|
+
permission: "read",
|
|
222
|
+
parameters: objectSchema({
|
|
223
|
+
op: string("Operation: create, get, update, approve, pause, resume, or drop."),
|
|
224
|
+
objective: string("Plan objective. Required for op=create when no active plan exists; optional replacement for op=update."),
|
|
225
|
+
body: string("Self-contained markdown plan body for op=create, update, or approve."),
|
|
226
|
+
summary: string("Concise plan summary or approval summary."),
|
|
227
|
+
}, ["op"]),
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "log_experiment",
|
|
231
|
+
description: "Log the latest pending autoresearch run. Use keep for accepted improvements, discard/crash/checks_failed for failed runs. Records the primary metric, description, secondary metrics, and ASI metadata.",
|
|
232
|
+
permission: "read",
|
|
233
|
+
parameters: objectSchema({
|
|
234
|
+
status: string("Run outcome: keep, discard, crash, or checks_failed."),
|
|
235
|
+
metric: number("Primary metric value to record. Optional when the pending run parsed the primary metric."),
|
|
236
|
+
description: string("Short description of what changed or what the run measured."),
|
|
237
|
+
metrics: jsonObject("Optional secondary metric values."),
|
|
238
|
+
asi: jsonObject("Optional structured autoresearch metadata."),
|
|
239
|
+
}, ["status", "description"]),
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "lsp",
|
|
243
|
+
description: "Run lightweight code-intelligence actions such as status, diagnostics, symbols, hover, references, and rename.",
|
|
244
|
+
permission: "read",
|
|
245
|
+
parameters: objectSchema({
|
|
246
|
+
action: string("status, diagnostics, definition, references, hover, symbols, rename, rename_file, or code_actions."),
|
|
247
|
+
path: string("Workspace-relative path."),
|
|
248
|
+
line: number("1-based line."),
|
|
249
|
+
character: number("1-based character."),
|
|
250
|
+
symbol: string("Symbol name."),
|
|
251
|
+
query: string("Search query."),
|
|
252
|
+
new_name: string("Rename target."),
|
|
253
|
+
apply: boolean("Apply mutation for rename actions."),
|
|
254
|
+
timeout_ms: number("Timeout in milliseconds."),
|
|
255
|
+
}, ["action"]),
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: "read_file",
|
|
259
|
+
description: "Read a bounded window from a workspace file.",
|
|
260
|
+
permission: "read",
|
|
261
|
+
parameters: objectSchema({
|
|
262
|
+
path: string("Workspace-relative file path."),
|
|
263
|
+
start_line: number("1-based start line."),
|
|
264
|
+
line_count: number("Number of lines."),
|
|
265
|
+
}, ["path"]),
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "read_process",
|
|
269
|
+
description: "Read recent output from a background process.",
|
|
270
|
+
permission: "read",
|
|
271
|
+
parameters: objectSchema({
|
|
272
|
+
process_id: string("Session-scoped process id."),
|
|
273
|
+
since_seq: number("Read output after this sequence."),
|
|
274
|
+
max_bytes: number("Maximum bytes."),
|
|
275
|
+
}, ["process_id"]),
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "read_resource",
|
|
279
|
+
description: "Read a bounded page from a managed resource URI. Use uri='list' to discover current-session resources; unique short suffixes are accepted.",
|
|
280
|
+
permission: "read",
|
|
281
|
+
parameters: objectSchema({
|
|
282
|
+
uri: string("Managed resource URI, 'list', or a unique suffix of a current-session resource URI."),
|
|
283
|
+
page: string("Opaque page token or numeric offset."),
|
|
284
|
+
line_count: number("Number of lines to read."),
|
|
285
|
+
}, ["uri"]),
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: "run_command",
|
|
289
|
+
description: "Run a bounded shell command, optionally as a background process.",
|
|
290
|
+
permission: "shell",
|
|
291
|
+
parameters: objectSchema({
|
|
292
|
+
command: string("Shell command to run."),
|
|
293
|
+
cwd: string("Optional workspace-relative cwd."),
|
|
294
|
+
timeout_ms: number("Timeout in milliseconds."),
|
|
295
|
+
env: jsonObject("Additional environment variables."),
|
|
296
|
+
background: boolean("Run in background and return process_id."),
|
|
297
|
+
}, ["command"]),
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "run_experiment",
|
|
301
|
+
description: "Run the active autoresearch benchmark harness with `bash autoresearch.sh`, capture output as a resource, and parse METRIC and ASI lines.",
|
|
302
|
+
permission: "shell",
|
|
303
|
+
parameters: objectSchema({
|
|
304
|
+
timeout_ms: number("Timeout in milliseconds. Defaults to 600000."),
|
|
305
|
+
timeout_seconds: number("Timeout in seconds. Used when timeout_ms is not supplied."),
|
|
306
|
+
}),
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: "session_note",
|
|
310
|
+
description: "Append a durable session note.",
|
|
311
|
+
permission: "read",
|
|
312
|
+
parameters: objectSchema({
|
|
313
|
+
note: string("Note body."),
|
|
314
|
+
tags: { type: "array", items: string("Tag.") },
|
|
315
|
+
}, ["note"]),
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "skill_list",
|
|
319
|
+
description: "List discovered skills as a compact index without loading full skill bodies.",
|
|
320
|
+
permission: "read",
|
|
321
|
+
parameters: objectSchema({
|
|
322
|
+
query: string("Optional case-insensitive filter over id, name, or description."),
|
|
323
|
+
include_disabled: boolean("Include skills that are not enabled in config. Defaults to true."),
|
|
324
|
+
limit: number("Maximum skills."),
|
|
325
|
+
}),
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: "skill_enable",
|
|
329
|
+
description: "Enable discovered skills by id or name and persist the workspace skill selection.",
|
|
330
|
+
permission: "write",
|
|
331
|
+
parameters: objectSchema({
|
|
332
|
+
ids: { type: "array", items: string("Skill id or exact skill name.") },
|
|
333
|
+
}, ["ids"]),
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: "skill_disable",
|
|
337
|
+
description: "Disable skills by id or name and persist the workspace skill selection.",
|
|
338
|
+
permission: "write",
|
|
339
|
+
parameters: objectSchema({
|
|
340
|
+
ids: { type: "array", items: string("Skill id, exact skill name, or enabled entry.") },
|
|
341
|
+
}, ["ids"]),
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "skill_read",
|
|
345
|
+
description: "Read the full body for one discovered skill by id or name.",
|
|
346
|
+
permission: "read",
|
|
347
|
+
parameters: objectSchema({
|
|
348
|
+
id: string("Skill id or exact skill name."),
|
|
349
|
+
line_count: number("Maximum lines to return."),
|
|
350
|
+
}, ["id"]),
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
name: "stop_process",
|
|
354
|
+
description: "Stop a background process.",
|
|
355
|
+
permission: "shell",
|
|
356
|
+
parameters: objectSchema({
|
|
357
|
+
process_id: string("Session-scoped process id."),
|
|
358
|
+
signal: string("Signal name. Defaults to SIGTERM."),
|
|
359
|
+
}, ["process_id"]),
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: "todo_write",
|
|
363
|
+
description: "Replace the durable task ledger for this session.",
|
|
364
|
+
permission: "read",
|
|
365
|
+
parameters: objectSchema({
|
|
366
|
+
items: {
|
|
367
|
+
type: "array",
|
|
368
|
+
items: {
|
|
369
|
+
type: "object",
|
|
370
|
+
additionalProperties: true,
|
|
371
|
+
},
|
|
372
|
+
},
|
|
373
|
+
}, ["items"]),
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
name: "update_notes",
|
|
377
|
+
description: "Persist the active autoresearch notes or append a single idea under an Ideas section.",
|
|
378
|
+
permission: "read",
|
|
379
|
+
parameters: objectSchema({
|
|
380
|
+
body: string("Replacement notes body. Defaults to existing notes when append_idea is set."),
|
|
381
|
+
append_idea: string("Optional idea to append as a bullet."),
|
|
382
|
+
}),
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
name: "video_generation",
|
|
386
|
+
description: "Generate videos through a configured endpoint-backed Omni tool.",
|
|
387
|
+
permission: "network",
|
|
388
|
+
parameters: objectSchema({
|
|
389
|
+
prompt: string("Video generation prompt."),
|
|
390
|
+
model: string("Optional model override."),
|
|
391
|
+
duration: number("Duration in seconds."),
|
|
392
|
+
size: string("Optional size."),
|
|
393
|
+
width: number("Optional video width."),
|
|
394
|
+
height: number("Optional video height."),
|
|
395
|
+
num_frames: number("Optional frame count."),
|
|
396
|
+
fps: number("Optional frames per second."),
|
|
397
|
+
seed: number("Optional seed."),
|
|
398
|
+
timeout_ms: number("Optional job timeout in milliseconds."),
|
|
399
|
+
poll_ms: number("Optional polling interval in milliseconds."),
|
|
400
|
+
}, ["prompt"]),
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
name: "video_understanding",
|
|
404
|
+
description: "Analyze video inputs through a configured endpoint-backed Omni tool.",
|
|
405
|
+
permission: "network",
|
|
406
|
+
parameters: objectSchema({
|
|
407
|
+
inputs: { type: "array", items: string("Video URL, file path, or data URI.") },
|
|
408
|
+
prompt: string("Question or instruction."),
|
|
409
|
+
model: string("Optional model override."),
|
|
410
|
+
detail: string("Optional detail level."),
|
|
411
|
+
}, ["inputs", "prompt"]),
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: "vision_understanding",
|
|
415
|
+
description: "Analyze images or screenshots through a configured multimodal endpoint.",
|
|
416
|
+
permission: "network",
|
|
417
|
+
parameters: objectSchema({
|
|
418
|
+
inputs: { type: "array", items: string("Image URL, file path, or data URI.") },
|
|
419
|
+
prompt: string("Question or instruction."),
|
|
420
|
+
model: string("Optional model override."),
|
|
421
|
+
detail: string("Optional detail level."),
|
|
422
|
+
}, ["inputs", "prompt"]),
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
name: "web_fetch",
|
|
426
|
+
description: "Fetch a direct HTTP/HTTPS URL and extract readable text. This does not require a web_search provider. Use this for any user-provided URL or search result inspection.",
|
|
427
|
+
permission: "network",
|
|
428
|
+
parameters: objectSchema({
|
|
429
|
+
url: string("HTTP or HTTPS URL to fetch."),
|
|
430
|
+
max_bytes: number("Maximum response bytes to read. Defaults to 1000000."),
|
|
431
|
+
timeout_ms: number("Request timeout in milliseconds. Defaults to 20000."),
|
|
432
|
+
format: string("text for extracted readable text, or html for raw HTML."),
|
|
433
|
+
}, ["url"]),
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
name: "web_open",
|
|
437
|
+
description: "Open/surface an HTTP/HTTPS URL and return a lightweight readable preview. This does not require a web_search provider. Use web_fetch when the task needs full extraction controls.",
|
|
438
|
+
permission: "network",
|
|
439
|
+
parameters: objectSchema({
|
|
440
|
+
url: string("HTTP or HTTPS URL to open, surface, and preview."),
|
|
441
|
+
note: string("Optional reason or instruction for the opened URL."),
|
|
442
|
+
max_bytes: number("Maximum response bytes to read for the preview. Defaults to 500000."),
|
|
443
|
+
timeout_ms: number("Request timeout in milliseconds. Defaults to 20000."),
|
|
444
|
+
format: string("text for extracted readable text, or html for raw HTML."),
|
|
445
|
+
}, ["url"]),
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
name: "web_search",
|
|
449
|
+
description: "Search the web for keyword queries through the configured provider or the default zero-key HTTP fallback chain. If the query contains a direct HTTP/HTTPS URL, it is fetched directly instead of being searched.",
|
|
450
|
+
permission: "network",
|
|
451
|
+
parameters: objectSchema({
|
|
452
|
+
query: string("Search query."),
|
|
453
|
+
limit: number("Maximum results."),
|
|
454
|
+
recency_days: number("Optional recency filter in days."),
|
|
455
|
+
}, ["query"]),
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: "write_file",
|
|
459
|
+
description: "Create or replace a workspace file.",
|
|
460
|
+
permission: "write",
|
|
461
|
+
parameters: objectSchema({
|
|
462
|
+
path: string("Workspace-relative file path."),
|
|
463
|
+
content: string("Full file content."),
|
|
464
|
+
overwrite: boolean("Allow replacing an existing file."),
|
|
465
|
+
}, ["path", "content"]),
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: "write_process",
|
|
469
|
+
description: "Write stdin to a background process.",
|
|
470
|
+
permission: "shell",
|
|
471
|
+
parameters: objectSchema({
|
|
472
|
+
process_id: string("Session-scoped process id."),
|
|
473
|
+
input: string("Input to write."),
|
|
474
|
+
close_stdin: boolean("Close stdin after writing."),
|
|
475
|
+
}, ["process_id", "input"]),
|
|
476
|
+
},
|
|
477
|
+
];
|
|
478
|
+
export const CORE_TOOL_DEFINITIONS = DEFINITIONS.slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
479
|
+
const OMNI_TOOL_CAPABILITY = {
|
|
480
|
+
audio_generation: "audio_generation",
|
|
481
|
+
audio_understanding: "audio_understanding",
|
|
482
|
+
image_generation: "image_generation",
|
|
483
|
+
video_generation: "video_generation",
|
|
484
|
+
video_understanding: "video_understanding",
|
|
485
|
+
vision_understanding: "vision",
|
|
486
|
+
};
|
|
487
|
+
export function configuredToolDefinitions(config) {
|
|
488
|
+
return CORE_TOOL_DEFINITIONS.filter((tool) => {
|
|
489
|
+
const capability = OMNI_TOOL_CAPABILITY[tool.name];
|
|
490
|
+
if (!capability) {
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
if (!config.omni.enabled) {
|
|
494
|
+
return false;
|
|
495
|
+
}
|
|
496
|
+
const endpoint = config.omni.endpoints[capability];
|
|
497
|
+
return Boolean(endpoint?.base_url && endpoint.model);
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/tools/schemas.ts"],"names":[],"mappings":"AAEA,SAAS,YAAY,CAAC,UAAsC,EAAE,WAAqB,EAAE;IACnF,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,UAAU;QACV,QAAQ;KACT,CAAC;AACJ,CAAC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AAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JsonObject, ToolResult } from "../types.js";
|
|
2
|
+
import type { ToolExecutionContext } from "./context.js";
|
|
3
|
+
export declare function skillList(args: JsonObject, context: ToolExecutionContext): Promise<ToolResult>;
|
|
4
|
+
export declare function skillRead(args: JsonObject, context: ToolExecutionContext): Promise<ToolResult>;
|
|
5
|
+
export declare function skillEnable(args: JsonObject, context: ToolExecutionContext): Promise<ToolResult>;
|
|
6
|
+
export declare function skillDisable(args: JsonObject, context: ToolExecutionContext): Promise<ToolResult>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import { saveUserConfig } from "../config/config.js";
|
|
3
|
+
import { SkillRegistry } from "../skills/registry.js";
|
|
4
|
+
import { clampLimit, fail, ok } from "../util/limit.js";
|
|
5
|
+
export async function skillList(args, context) {
|
|
6
|
+
const query = typeof args.query === "string" ? args.query.toLowerCase() : "";
|
|
7
|
+
const includeDisabled = args.include_disabled !== false;
|
|
8
|
+
const limit = clampLimit(args.limit, 50, 500);
|
|
9
|
+
const enabled = new Set(context.config.skills.enabled);
|
|
10
|
+
const skills = await new SkillRegistry(context.workspace, context.config).discover();
|
|
11
|
+
const filtered = skills
|
|
12
|
+
.filter((skill) => includeDisabled || enabled.has(skill.id) || enabled.has(skill.name))
|
|
13
|
+
.filter((skill) => !query || `${skill.id} ${skill.name} ${skill.description}`.toLowerCase().includes(query))
|
|
14
|
+
.slice(0, limit)
|
|
15
|
+
.map((skill) => ({
|
|
16
|
+
id: skill.id,
|
|
17
|
+
name: skill.name,
|
|
18
|
+
description: skill.description,
|
|
19
|
+
trust: skill.trust,
|
|
20
|
+
source: skill.source,
|
|
21
|
+
enabled: enabled.has(skill.id) || enabled.has(skill.name),
|
|
22
|
+
required_tools: skill.required_tools,
|
|
23
|
+
activation: skill.activation,
|
|
24
|
+
}));
|
|
25
|
+
return ok(`Listed ${filtered.length} skills`, { skills: filtered });
|
|
26
|
+
}
|
|
27
|
+
export async function skillRead(args, context) {
|
|
28
|
+
const id = String(args.id ?? "");
|
|
29
|
+
if (!id) {
|
|
30
|
+
return fail("skill_id_required", "skill_read requires id");
|
|
31
|
+
}
|
|
32
|
+
const skills = await new SkillRegistry(context.workspace, context.config).discover();
|
|
33
|
+
const skill = skills.find((item) => item.id === id || item.name === id);
|
|
34
|
+
if (!skill?.path) {
|
|
35
|
+
return fail("skill_not_found", `Skill not found: ${id}`);
|
|
36
|
+
}
|
|
37
|
+
const body = await fs.readFile(skill.path, "utf8");
|
|
38
|
+
const lines = body.split(/\r?\n/);
|
|
39
|
+
const lineCount = clampLimit(args.line_count, 240, 2000);
|
|
40
|
+
const content = lines.slice(0, lineCount).map((line, index) => `${index + 1}: ${line}`).join("\n");
|
|
41
|
+
const resource = lines.length > lineCount || body.length > 24_000
|
|
42
|
+
? context.store.putResource(context.session_id, "skill.body", body, {
|
|
43
|
+
id: skill.id,
|
|
44
|
+
name: skill.name,
|
|
45
|
+
source: skill.source,
|
|
46
|
+
}).uri
|
|
47
|
+
: undefined;
|
|
48
|
+
return {
|
|
49
|
+
...ok(`Read skill ${skill.id}`, {
|
|
50
|
+
id: skill.id,
|
|
51
|
+
name: skill.name,
|
|
52
|
+
description: skill.description,
|
|
53
|
+
trust: skill.trust,
|
|
54
|
+
source: skill.source,
|
|
55
|
+
content,
|
|
56
|
+
total_lines: lines.length,
|
|
57
|
+
}),
|
|
58
|
+
resource_uri: resource,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export async function skillEnable(args, context) {
|
|
62
|
+
const requested = parseSkillIds(args);
|
|
63
|
+
if (!requested.length) {
|
|
64
|
+
return fail("skill_ids_required", "skill_enable requires ids");
|
|
65
|
+
}
|
|
66
|
+
const skills = await new SkillRegistry(context.workspace, context.config).discover();
|
|
67
|
+
const resolved = resolveSkills(requested, skills);
|
|
68
|
+
if (resolved.missing.length) {
|
|
69
|
+
return fail("skill_not_found", `Skill not found: ${resolved.missing.join(", ")}`);
|
|
70
|
+
}
|
|
71
|
+
const enabled = new Set(context.config.skills.enabled);
|
|
72
|
+
for (const skill of resolved.ids) {
|
|
73
|
+
enabled.add(skill);
|
|
74
|
+
}
|
|
75
|
+
context.config.skills.enabled = [...enabled].sort();
|
|
76
|
+
const target = await saveUserConfig(context.config);
|
|
77
|
+
return ok(`Enabled ${resolved.ids.length} skills`, {
|
|
78
|
+
enabled: context.config.skills.enabled,
|
|
79
|
+
config_path: target,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export async function skillDisable(args, context) {
|
|
83
|
+
const requested = parseSkillIds(args);
|
|
84
|
+
if (!requested.length) {
|
|
85
|
+
return fail("skill_ids_required", "skill_disable requires ids");
|
|
86
|
+
}
|
|
87
|
+
const skills = await new SkillRegistry(context.workspace, context.config).discover();
|
|
88
|
+
const resolved = resolveSkills(requested, skills, true);
|
|
89
|
+
const enabled = new Set(context.config.skills.enabled);
|
|
90
|
+
for (const id of resolved.ids) {
|
|
91
|
+
enabled.delete(id);
|
|
92
|
+
}
|
|
93
|
+
context.config.skills.enabled = [...enabled].sort();
|
|
94
|
+
const target = await saveUserConfig(context.config);
|
|
95
|
+
return ok(`Disabled ${resolved.ids.length} skills`, {
|
|
96
|
+
disabled: resolved.ids,
|
|
97
|
+
missing: resolved.missing,
|
|
98
|
+
enabled: context.config.skills.enabled,
|
|
99
|
+
config_path: target,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function parseSkillIds(args) {
|
|
103
|
+
const ids = Array.isArray(args.ids) ? args.ids : [];
|
|
104
|
+
return ids.map((id) => (typeof id === "string" ? id.trim() : "")).filter(Boolean);
|
|
105
|
+
}
|
|
106
|
+
function resolveSkills(ids, skills, allowEnabledEntries = false) {
|
|
107
|
+
const byId = new Map(skills.flatMap((skill) => [[skill.id, skill.id], [skill.name, skill.id]]));
|
|
108
|
+
const resolved = [];
|
|
109
|
+
const missing = [];
|
|
110
|
+
for (const id of ids) {
|
|
111
|
+
const match = byId.get(id);
|
|
112
|
+
if (match) {
|
|
113
|
+
resolved.push(match);
|
|
114
|
+
}
|
|
115
|
+
else if (allowEnabledEntries) {
|
|
116
|
+
resolved.push(id);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
missing.push(id);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return { ids: [...new Set(resolved)], missing };
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=skill-tools.js.map
|