apex-code 0.0.1-alpha.5 → 0.0.1-alpha.6
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/CHANGELOG.md +29 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +10 -1
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +18 -3
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +15 -0
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/sandbox/cli-launch.d.ts +43 -0
- package/dist/core/sandbox/cli-launch.d.ts.map +1 -1
- package/dist/core/sandbox/cli-launch.js +70 -3
- package/dist/core/sandbox/cli-launch.js.map +1 -1
- package/dist/core/sandbox/cli-supervisor.d.ts +2 -0
- package/dist/core/sandbox/cli-supervisor.d.ts.map +1 -1
- package/dist/core/sandbox/cli-supervisor.js +1 -0
- package/dist/core/sandbox/cli-supervisor.js.map +1 -1
- package/dist/core/skills.d.ts +19 -7
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +77 -19
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +3 -3
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/index.d.ts +5 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +12 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/skill-search.d.ts +32 -0
- package/dist/core/tools/skill-search.d.ts.map +1 -0
- package/dist/core/tools/skill-search.js +56 -0
- package/dist/core/tools/skill-search.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +19 -6
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +172 -89
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +2 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +2 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/docs/skills.md +54 -4
- package/npm-shrinkwrap.json +5 -5
- package/package.json +2 -2
|
@@ -36,10 +36,12 @@ import { evaluateToolCall } from "./permissions/gate.js";
|
|
|
36
36
|
import { createInteractiveResponder } from "./permissions/responder.js";
|
|
37
37
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
38
38
|
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry, TODO_CUSTOM_ENTRY_TYPE, } from "./session-manager.js";
|
|
39
|
+
import { slugifySkillCommandName } from "./skills.js";
|
|
39
40
|
import { createSyntheticSourceInfo } from "./source-info.js";
|
|
40
41
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
41
42
|
import { createLocalBashOperations } from "./tools/bash.js";
|
|
42
43
|
import { createAllToolDefinitions } from "./tools/index.js";
|
|
44
|
+
import { createSkillSearchToolDefinition } from "./tools/skill-search.js";
|
|
43
45
|
import { createTodoWriteToolDefinition } from "./tools/todo-write.js";
|
|
44
46
|
import { createToolDefinitionFromAgentTool } from "./tools/tool-definition-wrapper.js";
|
|
45
47
|
import { createToolSchemaToolDefinition } from "./tools/tool-schema.js";
|
|
@@ -1052,9 +1054,16 @@ export class AgentSession {
|
|
|
1052
1054
|
if (!text.startsWith("/skill:"))
|
|
1053
1055
|
return text;
|
|
1054
1056
|
const spaceIndex = text.indexOf(" ");
|
|
1055
|
-
const
|
|
1057
|
+
const commandToken = spaceIndex === -1 ? text.slice(7) : text.slice(7, spaceIndex);
|
|
1056
1058
|
const args = spaceIndex === -1 ? "" : text.slice(spaceIndex + 1).trim();
|
|
1057
|
-
|
|
1059
|
+
// Matched against the slugged command token (SKILL.5), not the raw frontmatter
|
|
1060
|
+
// name -- identity for an already command-safe name, so an exactly-typed raw
|
|
1061
|
+
// name still matches too. A skill whose name contains a space or other
|
|
1062
|
+
// slash-command-breaking character (docs/skills.md's lenient loading allows
|
|
1063
|
+
// this) is only reachable through its slugged token.
|
|
1064
|
+
const skill = this.resourceLoader
|
|
1065
|
+
.getSkills()
|
|
1066
|
+
.skills.find((s) => slugifySkillCommandName(s.name) === commandToken);
|
|
1058
1067
|
if (!skill)
|
|
1059
1068
|
return text; // Unknown skill, pass through
|
|
1060
1069
|
try {
|
|
@@ -1933,7 +1942,7 @@ export class AgentSession {
|
|
|
1933
1942
|
sourceInfo: template.sourceInfo,
|
|
1934
1943
|
}));
|
|
1935
1944
|
const skills = this._resourceLoader.getSkills().skills.map((skill) => ({
|
|
1936
|
-
name: `skill:${skill.name}`,
|
|
1945
|
+
name: `skill:${slugifySkillCommandName(skill.name)}`,
|
|
1937
1946
|
description: skill.description,
|
|
1938
1947
|
source: "skill",
|
|
1939
1948
|
sourceInfo: skill.sourceInfo,
|
|
@@ -2152,6 +2161,12 @@ export class AgentSession {
|
|
|
2152
2161
|
this.sessionManager.appendCustomEntry(TODO_CUSTOM_ENTRY_TYPE, todos);
|
|
2153
2162
|
},
|
|
2154
2163
|
});
|
|
2164
|
+
// Reads the resource loader live on every call (not a snapshot taken here), so
|
|
2165
|
+
// a project-trust change or a settings reload that alters the loaded skill set
|
|
2166
|
+
// is reflected on the next search without rebuilding the tool registry.
|
|
2167
|
+
baseToolDefinitions.skill_search = createSkillSearchToolDefinition({
|
|
2168
|
+
getSkills: () => this.resourceLoader.getSkills().skills,
|
|
2169
|
+
});
|
|
2155
2170
|
this._baseToolDefinitions = new Map(Object.entries(baseToolDefinitions).map(([name, tool]) => [name, tool]));
|
|
2156
2171
|
const extensionsResult = this._resourceLoader.getExtensions();
|
|
2157
2172
|
if (options.flagValues) {
|