@alisio/core 0.1.0-alpha.20 → 0.1.0-alpha.22

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.
Files changed (104) hide show
  1. package/dist/agents/active.d.ts +19 -0
  2. package/dist/agents/active.js +41 -0
  3. package/dist/agents/capabilities.d.ts +26 -0
  4. package/dist/agents/capabilities.js +120 -0
  5. package/dist/agents/create-agent-skill.d.ts +11 -0
  6. package/dist/agents/create-agent-skill.js +60 -0
  7. package/dist/agents/definitions.d.ts +88 -0
  8. package/dist/agents/definitions.js +404 -0
  9. package/dist/agents/draft.d.ts +41 -0
  10. package/dist/agents/draft.js +133 -0
  11. package/dist/agents/service.d.ts +57 -0
  12. package/dist/agents/service.js +86 -0
  13. package/dist/agents/templates.d.ts +8 -0
  14. package/dist/agents/templates.js +102 -0
  15. package/dist/analysis/capabilities.d.ts +48 -0
  16. package/dist/analysis/capabilities.js +90 -0
  17. package/dist/analysis/data/csv.d.ts +46 -0
  18. package/dist/analysis/data/csv.js +240 -0
  19. package/dist/analysis/data/datasets.d.ts +132 -0
  20. package/dist/analysis/data/datasets.js +441 -0
  21. package/dist/analysis/data/describe.d.ts +27 -0
  22. package/dist/analysis/data/describe.js +103 -0
  23. package/dist/analysis/data/engine-client.d.ts +58 -0
  24. package/dist/analysis/data/engine-client.js +304 -0
  25. package/dist/analysis/data/engine-entry.d.ts +1 -0
  26. package/dist/analysis/data/engine-entry.js +59 -0
  27. package/dist/analysis/data/engine-source.d.ts +4 -0
  28. package/dist/analysis/data/engine-source.js +6 -0
  29. package/dist/analysis/data/engine-types.d.ts +86 -0
  30. package/dist/analysis/data/engine-types.js +7 -0
  31. package/dist/analysis/data/infer.d.ts +42 -0
  32. package/dist/analysis/data/infer.js +118 -0
  33. package/dist/analysis/data/ingest-worker.d.ts +17 -0
  34. package/dist/analysis/data/ingest-worker.js +365 -0
  35. package/dist/analysis/data/json.d.ts +19 -0
  36. package/dist/analysis/data/json.js +44 -0
  37. package/dist/analysis/data/query-worker.d.ts +12 -0
  38. package/dist/analysis/data/query-worker.js +75 -0
  39. package/dist/analysis/data/rows.d.ts +39 -0
  40. package/dist/analysis/data/rows.js +120 -0
  41. package/dist/analysis/data/sql-guard.d.ts +20 -0
  42. package/dist/analysis/data/sql-guard.js +129 -0
  43. package/dist/analysis/data/stats.d.ts +18 -0
  44. package/dist/analysis/data/stats.js +77 -0
  45. package/dist/analysis/install-hints.d.ts +33 -0
  46. package/dist/analysis/install-hints.js +144 -0
  47. package/dist/analysis/janitor.d.ts +60 -0
  48. package/dist/analysis/janitor.js +264 -0
  49. package/dist/analysis/jobs.d.ts +94 -0
  50. package/dist/analysis/jobs.js +165 -0
  51. package/dist/analysis/oci.d.ts +129 -0
  52. package/dist/analysis/oci.js +330 -0
  53. package/dist/analysis/python/sources.d.ts +2 -0
  54. package/dist/analysis/python/sources.js +10 -0
  55. package/dist/analysis/requirements.d.ts +32 -0
  56. package/dist/analysis/requirements.js +73 -0
  57. package/dist/analysis/rerun.d.ts +40 -0
  58. package/dist/analysis/rerun.js +136 -0
  59. package/dist/analysis/runtime-manager.d.ts +146 -0
  60. package/dist/analysis/runtime-manager.js +472 -0
  61. package/dist/analysis/status.d.ts +21 -0
  62. package/dist/analysis/status.js +52 -0
  63. package/dist/application.d.ts +48 -0
  64. package/dist/application.js +228 -0
  65. package/dist/artifacts/kinds.d.ts +35 -0
  66. package/dist/artifacts/kinds.js +177 -0
  67. package/dist/artifacts/publisher.d.ts +7 -0
  68. package/dist/artifacts/publisher.js +29 -0
  69. package/dist/artifacts/store.d.ts +119 -0
  70. package/dist/artifacts/store.js +581 -0
  71. package/dist/commands/builtins.js +13 -0
  72. package/dist/commands/catalog.js +13 -1
  73. package/dist/config.d.ts +102 -0
  74. package/dist/config.js +167 -6
  75. package/dist/core/contracts.d.ts +69 -1
  76. package/dist/core/runner.d.ts +34 -4
  77. package/dist/core/runner.js +388 -130
  78. package/dist/index.d.ts +30 -5
  79. package/dist/index.js +29 -4
  80. package/dist/mcp/rich.js +4 -0
  81. package/dist/plugins/host.js +14 -6
  82. package/dist/runtime/blobs.d.ts +22 -0
  83. package/dist/runtime/blobs.js +84 -1
  84. package/dist/runtime/ids.d.ts +8 -0
  85. package/dist/runtime/ids.js +32 -0
  86. package/dist/runtime/paths.d.ts +5 -0
  87. package/dist/runtime/paths.js +6 -0
  88. package/dist/runtime/process.d.ts +12 -0
  89. package/dist/runtime/process.js +64 -4
  90. package/dist/runtime/sqlite.d.ts +2 -0
  91. package/dist/runtime/sqlite.js +18 -0
  92. package/dist/runtime/store.d.ts +5 -0
  93. package/dist/runtime/store.js +75 -0
  94. package/dist/runtime/zip.d.ts +24 -0
  95. package/dist/runtime/zip.js +126 -0
  96. package/dist/sessions/children.js +4 -0
  97. package/dist/tools/analysis.d.ts +37 -0
  98. package/dist/tools/analysis.js +572 -0
  99. package/dist/tools/artifacts.d.ts +14 -0
  100. package/dist/tools/artifacts.js +143 -0
  101. package/dist/tools/data.d.ts +7 -0
  102. package/dist/tools/data.js +160 -0
  103. package/dist/tools/execute.js +6 -2
  104. package/package.json +2 -2
@@ -9,6 +9,7 @@
9
9
  * agent only when it is marked main-capable (`mode: primary|all`), which the subagents plugin
10
10
  * publishes for the host to read.
11
11
  */
12
+ import type { CommandDescriptor } from "@alisio/sdk";
12
13
  export interface ActiveAgent {
13
14
  /** Stable id, also the persisted `agents.active` value. */
14
15
  id: string;
@@ -20,6 +21,10 @@ export interface ActiveAgent {
20
21
  model?: string;
21
22
  /** Read-only agents run with write/process/external tools disabled and approvals off. */
22
23
  readOnly?: boolean;
24
+ /** Default reasoning effort (`alisio.reasoning.effort`); an explicit session/user effort wins. */
25
+ effort?: string;
26
+ /** Definition file of a contributed agent (shows its Project/Global scope). */
27
+ path?: string;
23
28
  /** Product built-ins are shown as built-in and never shadowed by contributed definitions. */
24
29
  source: "builtin" | "user" | "plugin";
25
30
  }
@@ -32,6 +37,7 @@ export interface MainCapableAgentRecord {
32
37
  prompt: string;
33
38
  model?: string;
34
39
  readOnly?: boolean;
40
+ effort?: string;
35
41
  source: string;
36
42
  path?: string;
37
43
  }
@@ -56,7 +62,20 @@ export declare function agentRunOptions(agent: ActiveAgent | undefined): {
56
62
  external: false;
57
63
  };
58
64
  approvals?: false;
65
+ reasoningEffort?: string;
59
66
  };
67
+ /**
68
+ * Every loaded agent is also a slash command `/agent:<id>` that activates it. The `agent:`
69
+ * namespace keeps these commands from ever colliding with built-ins, plugin commands, prompt
70
+ * templates or `skill:<id>` entries; when a higher-precedence source already owns the exact name
71
+ * (e.g. a plugin with id `agent`), the agent command is skipped.
72
+ */
73
+ export declare const AGENT_COMMAND_PREFIX = "agent:";
74
+ export declare const agentCommandName: (id: string) => string;
75
+ /** The agent id a `/agent:<id>` command names, or undefined for any other command. */
76
+ export declare function agentIdFromCommand(name: string): string | undefined;
77
+ /** `/agent:<id>` descriptors for `agents`, skipping names already in `taken`. */
78
+ export declare function agentCommandDescriptors(agents: ActiveAgent[], taken?: ReadonlySet<string>): CommandDescriptor[];
60
79
  export interface AgentPickerItem {
61
80
  value: string;
62
81
  label: string;
@@ -36,6 +36,8 @@ export function mainAgentFromRecord(record) {
36
36
  ...(record.prompt ? { instructions: record.prompt } : {}),
37
37
  ...(record.model ? { model: record.model } : {}),
38
38
  ...(record.readOnly ? { readOnly: true } : {}),
39
+ ...(typeof record.effort === "string" && record.effort ? { effort: record.effort } : {}),
40
+ ...(typeof record.path === "string" && record.path ? { path: record.path } : {}),
39
41
  ...(source.startsWith("plugin:")
40
42
  ? { source: "plugin" }
41
43
  : { source: "user" }),
@@ -82,6 +84,7 @@ export function agentRunOptions(agent) {
82
84
  return {};
83
85
  return {
84
86
  ...(agent.instructions ? { instructions: agent.instructions } : {}),
87
+ ...(agent.effort ? { reasoningEffort: agent.effort } : {}),
85
88
  ...(agent.readOnly
86
89
  ? {
87
90
  policy: { write: false, process: false, external: false },
@@ -90,6 +93,44 @@ export function agentRunOptions(agent) {
90
93
  : {}),
91
94
  };
92
95
  }
96
+ /**
97
+ * Every loaded agent is also a slash command `/agent:<id>` that activates it. The `agent:`
98
+ * namespace keeps these commands from ever colliding with built-ins, plugin commands, prompt
99
+ * templates or `skill:<id>` entries; when a higher-precedence source already owns the exact name
100
+ * (e.g. a plugin with id `agent`), the agent command is skipped.
101
+ */
102
+ export const AGENT_COMMAND_PREFIX = "agent:";
103
+ const COMMAND_SAFE_ID = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;
104
+ export const agentCommandName = (id) => `${AGENT_COMMAND_PREFIX}${id}`;
105
+ /** The agent id a `/agent:<id>` command names, or undefined for any other command. */
106
+ export function agentIdFromCommand(name) {
107
+ if (!name.startsWith(AGENT_COMMAND_PREFIX))
108
+ return undefined;
109
+ const id = name.slice(AGENT_COMMAND_PREFIX.length);
110
+ return COMMAND_SAFE_ID.test(id) ? id : undefined;
111
+ }
112
+ /** `/agent:<id>` descriptors for `agents`, skipping names already in `taken`. */
113
+ export function agentCommandDescriptors(agents, taken = new Set()) {
114
+ const out = [];
115
+ const seen = new Set(taken);
116
+ for (const agent of agents) {
117
+ if (!COMMAND_SAFE_ID.test(agent.id))
118
+ continue;
119
+ const name = agentCommandName(agent.id);
120
+ if (seen.has(name))
121
+ continue;
122
+ seen.add(name);
123
+ out.push({
124
+ name,
125
+ description: `Activate the ${agent.name} agent${agent.id === DEFAULT_AGENT_ID ? " (default)" : ""}: ${agent.description}`,
126
+ source: "agent",
127
+ owner: agent.source,
128
+ surfaces: ["tui", "web", "api"],
129
+ execution: "surface",
130
+ });
131
+ }
132
+ return out;
133
+ }
93
134
  /** Picker rows for `/agents`: name with (current), built-in/default and read-only markers. */
94
135
  export function agentPickerItems(agents, activeId) {
95
136
  return agents.map((agent) => ({
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Capability-driven agent settings: which reasoning, summary, verbosity and text-format options a
3
+ * model supports, derived only from its catalog metadata (`ModelInfo.effort`, `inputModalities`,
4
+ * `capabilities`). Providers that declare nothing (most OpenAI-compatible `GET /models` answers)
5
+ * get a permissive default: every option is offered and `known` is false, so surfaces can say the
6
+ * support is unverified. Explicit `false` metadata always hides an option.
7
+ */
8
+ import type { AgentDefinitionInput, AgentModelCapabilities, AgentModelOption, AvailableProviderModel, ModelInfo } from "@alisio/sdk";
9
+ /** Levels offered when a reasoning model does not list its own. */
10
+ export declare const DEFAULT_EFFORT_LEVELS: string[];
11
+ /** What `model` supports for the agent editor (permissive when the catalog says nothing). */
12
+ export declare function agentModelCapabilities(model: ModelInfo | undefined): AgentModelCapabilities;
13
+ /** Short labels such as "Reasoning · Tools · Vision", only for declared support. */
14
+ export declare function agentModelLabels(capabilities: AgentModelCapabilities): string[];
15
+ /** The editor's model options from the configured catalogs; `active` marks the running model. */
16
+ export declare function agentModelOptions(available: AvailableProviderModel[], active?: {
17
+ profile?: string;
18
+ provider?: string;
19
+ model: string;
20
+ }): AgentModelOption[];
21
+ /**
22
+ * Drops or replaces settings `capabilities` does not support: unsupported reasoning settings are
23
+ * removed, an unknown effort level falls back to the model default (or is removed), an unsupported
24
+ * text format becomes `text`, unsupported verbosity is removed.
25
+ */
26
+ export declare function fitAgentSettings<T extends Pick<AgentDefinitionInput, "reasoning" | "text">>(settings: T, capabilities: AgentModelCapabilities): T;
@@ -0,0 +1,120 @@
1
+ /** Levels offered when a reasoning model does not list its own. */
2
+ export const DEFAULT_EFFORT_LEVELS = ["low", "medium", "high"];
3
+ const flag = (capabilities, keys) => {
4
+ if (!capabilities)
5
+ return undefined;
6
+ for (const key of keys) {
7
+ const value = capabilities[key];
8
+ if (typeof value === "boolean")
9
+ return value;
10
+ if (value === "true" || value === "supported")
11
+ return true;
12
+ if (value === "false" || value === "unsupported")
13
+ return false;
14
+ }
15
+ return undefined;
16
+ };
17
+ /** What `model` supports for the agent editor (permissive when the catalog says nothing). */
18
+ export function agentModelCapabilities(model) {
19
+ const caps = model?.capabilities;
20
+ const levels = model?.effort?.supportedLevels?.filter(Boolean) ?? [];
21
+ const declaredReasoning = flag(caps, ["reasoning", "reasoning_effort", "thinking"]);
22
+ const reasoning = levels.length > 0 || declaredReasoning !== false;
23
+ const summary = reasoning && flag(caps, ["reasoning_summary", "reasoningSummary"]) !== false;
24
+ const verbosity = flag(caps, ["verbosity", "text_verbosity"]) !== false;
25
+ const json = flag(caps, ["json_mode", "json_object", "response_format"]);
26
+ const schema = flag(caps, ["structured_outputs", "json_schema", "structuredOutputs"]);
27
+ const textFormats = ["text"];
28
+ if (json !== false)
29
+ textFormats.push("json_object");
30
+ if (schema !== false)
31
+ textFormats.push("json_schema");
32
+ const tools = flag(caps, ["tools", "tool_calling", "function_calling", "toolCalling"]);
33
+ const vision = model?.inputModalities?.includes("image") ||
34
+ model?.modalities?.includes("image") ||
35
+ flag(caps, ["vision", "image_input"]) === true
36
+ ? true
37
+ : flag(caps, ["vision", "image_input"]);
38
+ const known = !!levels.length ||
39
+ !!model?.inputModalities?.length ||
40
+ !!model?.modalities?.length ||
41
+ !!(caps && Object.keys(caps).length);
42
+ return {
43
+ known,
44
+ reasoning,
45
+ effortLevels: reasoning ? (levels.length ? levels : DEFAULT_EFFORT_LEVELS) : [],
46
+ ...(reasoning && model?.effort?.defaultLevel
47
+ ? { defaultEffort: model.effort.defaultLevel }
48
+ : {}),
49
+ summary,
50
+ verbosity,
51
+ textFormats,
52
+ ...(tools !== undefined ? { tools } : {}),
53
+ ...(vision !== undefined ? { vision } : {}),
54
+ };
55
+ }
56
+ /** Short labels such as "Reasoning · Tools · Vision", only for declared support. */
57
+ export function agentModelLabels(capabilities) {
58
+ if (!capabilities.known)
59
+ return [];
60
+ return [
61
+ capabilities.reasoning ? "Reasoning" : undefined,
62
+ capabilities.tools ? "Tools" : undefined,
63
+ capabilities.vision ? "Vision" : undefined,
64
+ capabilities.textFormats.includes("json_schema") ? "Structured output" : undefined,
65
+ ].filter((label) => !!label);
66
+ }
67
+ /** The editor's model options from the configured catalogs; `active` marks the running model. */
68
+ export function agentModelOptions(available, active) {
69
+ return available.map((entry) => {
70
+ const capabilities = agentModelCapabilities(entry.model);
71
+ return {
72
+ reference: entry.reference,
73
+ provider: entry.provider,
74
+ profile: entry.profile,
75
+ providerName: entry.providerName,
76
+ id: entry.model.id,
77
+ ...(entry.model.name ? { name: entry.model.name } : {}),
78
+ active: !!active &&
79
+ entry.model.id === active.model &&
80
+ (active.profile ? entry.profile === active.profile : entry.provider === active.provider),
81
+ capabilities,
82
+ labels: agentModelLabels(capabilities),
83
+ };
84
+ });
85
+ }
86
+ /**
87
+ * Drops or replaces settings `capabilities` does not support: unsupported reasoning settings are
88
+ * removed, an unknown effort level falls back to the model default (or is removed), an unsupported
89
+ * text format becomes `text`, unsupported verbosity is removed.
90
+ */
91
+ export function fitAgentSettings(settings, capabilities) {
92
+ const reasoning = { ...(settings.reasoning ?? {}) };
93
+ if (!capabilities.reasoning) {
94
+ delete reasoning.effort;
95
+ delete reasoning.summary;
96
+ }
97
+ else if (reasoning.effort && !capabilities.effortLevels.includes(reasoning.effort)) {
98
+ if (capabilities.defaultEffort)
99
+ reasoning.effort = capabilities.defaultEffort;
100
+ else
101
+ delete reasoning.effort;
102
+ }
103
+ if (!capabilities.summary)
104
+ delete reasoning.summary;
105
+ const text = { ...(settings.text ?? {}) };
106
+ if (text.format && !capabilities.textFormats.includes(text.format.type))
107
+ text.format = { type: "text" };
108
+ if (!capabilities.verbosity)
109
+ delete text.verbosity;
110
+ const out = { ...settings };
111
+ if (Object.keys(reasoning).length)
112
+ out.reasoning = reasoning;
113
+ else
114
+ delete out.reasoning;
115
+ if (Object.keys(text).length)
116
+ out.text = text;
117
+ else
118
+ delete out.text;
119
+ return out;
120
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The bundled `create-agent` skill: agent-authoring standards the ACTIVE model follows when it
3
+ * writes or refines an agent's instructions (assisted creation in the web Agents window and the
4
+ * TUI `/agents` manager). A user or project skill named `create-agent` (or `agent-creator`)
5
+ * replaces it, so teams can encode their own conventions.
6
+ */
7
+ /** Skill names that override the bundled guidance, in order of preference. */
8
+ export declare const AGENT_AUTHORING_SKILL_NAMES: readonly ["create-agent", "agent-creator"];
9
+ export declare const CREATE_AGENT_SKILL = "---\nname: create-agent\ndescription: Standards for writing the system prompt (instructions) of an Alisio agent.\n---\n# Writing agent instructions\n\nAn agent's instructions are its system prompt. They are read on every turn, so every line must\nearn its place. Write them in Markdown, in the second person (\"You ...\"), in English unless the\nuser asks otherwise.\n\n## Required sections\n\n1. **Role** \u2014 one or two sentences: who the agent is and who it serves.\n2. **Goal** \u2014 the outcome a successful turn produces, stated so it can be checked.\n3. **Scope** \u2014 what the agent handles and, explicitly, what it must decline or hand back.\n4. **How to work** \u2014 an ordered method for the typical task (investigate, act, verify, report).\n5. **Tool usage** \u2014 when to read, search, edit or run processes; prefer reading before editing;\n verify changes (tests, type checks) before claiming success; ask before destructive,\n irreversible or external actions (deleting data, deploying, spending money, contacting people).\n6. **Constraints** \u2014 hard rules: safety, privacy, secrets never echoed, repository conventions,\n performance or style limits. Phrase them as testable rules, not vague values.\n7. **Output format** \u2014 the exact shape of the final answer (headings, lists, tables, JSON keys,\n length). Match the agent's text format setting.\n8. **Examples** (optional) \u2014 one short input \u2192 output pair when the format or tone is unusual.\n\n## Quality bar\n\n- Be specific to the described job; remove generic filler (\"be helpful\", \"be accurate\").\n- Prefer short imperative bullets over paragraphs. Target 150\u2013600 words.\n- Never invent tools, files, APIs or data the agent does not have; tell it to say when it lacks\n information instead of guessing.\n- Keep the agent honest: report what was verified and what was not.\n- When refining an existing definition, keep what already works, apply the user's requested\n changes, and fill any missing required section.\n\n## Settings to suggest\n\n- Reasoning effort: `high` for analysis, debugging, security or multi-step refactors; `medium`\n for general engineering; `low` for formatting, summaries and support replies.\n- Reasoning summary: `auto` by default; `none` for short conversational agents; `detailed` when\n the user audits the reasoning.\n- Verbosity: `low` for terse operational agents, `medium` by default, `high` for reports.\n- Text format: `text` unless the agent must return machine-readable output (`json_object`,\n or `json_schema` when a strict schema is given).\n";
10
+ /** The skill body without the loader preamble and frontmatter (what is sent as guidance). */
11
+ export declare function skillBody(text: string): string;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The bundled `create-agent` skill: agent-authoring standards the ACTIVE model follows when it
3
+ * writes or refines an agent's instructions (assisted creation in the web Agents window and the
4
+ * TUI `/agents` manager). A user or project skill named `create-agent` (or `agent-creator`)
5
+ * replaces it, so teams can encode their own conventions.
6
+ */
7
+ /** Skill names that override the bundled guidance, in order of preference. */
8
+ export const AGENT_AUTHORING_SKILL_NAMES = ["create-agent", "agent-creator"];
9
+ export const CREATE_AGENT_SKILL = `---
10
+ name: create-agent
11
+ description: Standards for writing the system prompt (instructions) of an Alisio agent.
12
+ ---
13
+ # Writing agent instructions
14
+
15
+ An agent's instructions are its system prompt. They are read on every turn, so every line must
16
+ earn its place. Write them in Markdown, in the second person ("You ..."), in English unless the
17
+ user asks otherwise.
18
+
19
+ ## Required sections
20
+
21
+ 1. **Role** — one or two sentences: who the agent is and who it serves.
22
+ 2. **Goal** — the outcome a successful turn produces, stated so it can be checked.
23
+ 3. **Scope** — what the agent handles and, explicitly, what it must decline or hand back.
24
+ 4. **How to work** — an ordered method for the typical task (investigate, act, verify, report).
25
+ 5. **Tool usage** — when to read, search, edit or run processes; prefer reading before editing;
26
+ verify changes (tests, type checks) before claiming success; ask before destructive,
27
+ irreversible or external actions (deleting data, deploying, spending money, contacting people).
28
+ 6. **Constraints** — hard rules: safety, privacy, secrets never echoed, repository conventions,
29
+ performance or style limits. Phrase them as testable rules, not vague values.
30
+ 7. **Output format** — the exact shape of the final answer (headings, lists, tables, JSON keys,
31
+ length). Match the agent's text format setting.
32
+ 8. **Examples** (optional) — one short input → output pair when the format or tone is unusual.
33
+
34
+ ## Quality bar
35
+
36
+ - Be specific to the described job; remove generic filler ("be helpful", "be accurate").
37
+ - Prefer short imperative bullets over paragraphs. Target 150–600 words.
38
+ - Never invent tools, files, APIs or data the agent does not have; tell it to say when it lacks
39
+ information instead of guessing.
40
+ - Keep the agent honest: report what was verified and what was not.
41
+ - When refining an existing definition, keep what already works, apply the user's requested
42
+ changes, and fill any missing required section.
43
+
44
+ ## Settings to suggest
45
+
46
+ - Reasoning effort: \`high\` for analysis, debugging, security or multi-step refactors; \`medium\`
47
+ for general engineering; \`low\` for formatting, summaries and support replies.
48
+ - Reasoning summary: \`auto\` by default; \`none\` for short conversational agents; \`detailed\` when
49
+ the user audits the reasoning.
50
+ - Verbosity: \`low\` for terse operational agents, \`medium\` by default, \`high\` for reports.
51
+ - Text format: \`text\` unless the agent must return machine-readable output (\`json_object\`,
52
+ or \`json_schema\` when a strict schema is given).
53
+ `;
54
+ /** The skill body without the loader preamble and frontmatter (what is sent as guidance). */
55
+ export function skillBody(text) {
56
+ return text
57
+ .replace(/^Skill root:.*\r?\n(?:Use skill_resource.*\r?\n)?/, "")
58
+ .replace(/^---\r?\n[\s\S]*?\r?\n---[ \t]*\r?\n?/, "")
59
+ .trim();
60
+ }
@@ -0,0 +1,88 @@
1
+ import type { AgentDefinitionInfo, AgentDefinitionInput, AgentReasoningSummary, AgentScope, AgentTextFormatType, AgentVerbosity } from "@alisio/sdk";
2
+ import { Document } from "yaml";
3
+ export type { AgentDefinitionInfo, AgentDefinitionInput, AgentScope };
4
+ /** Same identifier rule as the subagents plugin (and Claude Code agent names). */
5
+ export declare const AGENT_ID_PATTERN: RegExp;
6
+ /** Built-in agent names a user file must not shadow (main `build`/`plan`, subagents). */
7
+ export declare const RESERVED_AGENT_IDS: Set<string>;
8
+ export declare const AGENT_LIMITS: {
9
+ readonly name: 80;
10
+ readonly description: 300;
11
+ readonly instructions: 24000;
12
+ readonly model: 300;
13
+ };
14
+ export declare const AGENT_REASONING_SUMMARIES: AgentReasoningSummary[];
15
+ export declare const AGENT_VERBOSITIES: AgentVerbosity[];
16
+ export declare const AGENT_TEXT_FORMATS: AgentTextFormatType[];
17
+ /** Frontmatter key of the Alisio-only settings (ignored by other harnesses). */
18
+ export declare const ALISIO_KEY = "alisio";
19
+ /** The directory of one scope. */
20
+ export declare function agentScopeDir(scope: AgentScope, roots: {
21
+ workspace?: string;
22
+ home: string;
23
+ }): string;
24
+ export interface AgentFieldError {
25
+ field: string;
26
+ message: string;
27
+ }
28
+ /**
29
+ * Validates and normalizes an untrusted definition body (web API, TUI, drafts). Unknown keys are
30
+ * dropped; strings are trimmed; empty optional settings are omitted.
31
+ */
32
+ export declare function validateAgentDefinitionInput(raw: unknown): {
33
+ ok: true;
34
+ value: AgentDefinitionInput;
35
+ } | {
36
+ ok: false;
37
+ errors: AgentFieldError[];
38
+ };
39
+ /** Lowercase ASCII slug of a display name (diacritics folded), possibly empty. */
40
+ export declare function slugify(name: string): string;
41
+ /** A fresh id for `name`: its slug, suffixed (`-2`, `-3`…) past reserved and `taken` ids. */
42
+ export declare function agentIdFromName(name: string, taken: Set<string>): string;
43
+ /** The description written when none is given: the first sentence of the instructions. */
44
+ export declare function defaultDescription(name: string, instructions: string): string;
45
+ /** Splits a Markdown agent file into its YAML document and body (no frontmatter: empty doc). */
46
+ export declare function parseAgentFile(text: string): {
47
+ doc: Document;
48
+ body: string;
49
+ } | undefined;
50
+ /** The definition a parsed file describes (`id`/`scope`/`path` come from its location). */
51
+ export declare function definitionFromFile(parsed: {
52
+ doc: Document;
53
+ body: string;
54
+ }, meta: {
55
+ id: string;
56
+ scope: AgentScope;
57
+ path: string;
58
+ mtimeMs: number;
59
+ birthtimeMs?: number;
60
+ }): AgentDefinitionInfo;
61
+ /**
62
+ * Serializes `input` into the file's YAML document (mutating it) and returns the file text.
63
+ * Keys Alisio does not own are left exactly as they were.
64
+ */
65
+ export declare function renderAgentFile(doc: Document, id: string, input: AgentDefinitionInput, times: {
66
+ createdAt: number;
67
+ updatedAt: number;
68
+ created: boolean;
69
+ }): string;
70
+ export declare class AgentNotFoundError extends Error {
71
+ constructor(scope: AgentScope, id: string);
72
+ }
73
+ /** Reads and writes the agent files of one scope directory. */
74
+ export declare class AgentScopeStore {
75
+ readonly scope: AgentScope;
76
+ readonly dir: string;
77
+ private readonly now;
78
+ constructor(scope: AgentScope, dir: string, now?: () => number);
79
+ private pathOf;
80
+ private read;
81
+ /** Every readable `<id>.md` of the scope (invalid names and unparseable files are skipped). */
82
+ list(): Promise<AgentDefinitionInfo[]>;
83
+ get(id: string): Promise<AgentDefinitionInfo | undefined>;
84
+ create(input: AgentDefinitionInput, extraTaken?: Iterable<string>): Promise<AgentDefinitionInfo>;
85
+ update(id: string, input: AgentDefinitionInput): Promise<AgentDefinitionInfo>;
86
+ delete(id: string): Promise<boolean>;
87
+ private write;
88
+ }