@anhlp/alp 0.0.1-beta.3 → 0.0.1-beta.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/README.md +14 -410
- package/bin/alp.js +5 -0
- package/lib/launcher.js +136 -0
- package/package.json +19 -104
- package/dist/THIRD-PARTY-NOTICES.txt +0 -626
- package/dist/acp.js +0 -19903
- package/dist/alpd.js +0 -42558
- package/docs/modular-monorepo.md +0 -210
- package/packages/cli/README.md +0 -7
- package/packages/cli/dist/THIRD-PARTY-NOTICES.txt +0 -626
- package/packages/cli/dist/acp/agent.d.ts +0 -37
- package/packages/cli/dist/acp/agent.js +0 -489
- package/packages/cli/dist/acp/main.d.ts +0 -4
- package/packages/cli/dist/acp/main.js +0 -23
- package/packages/cli/dist/acp.js +0 -19903
- package/packages/cli/dist/alpd.js +0 -42558
- package/packages/cli/dist/backup.d.ts +0 -4
- package/packages/cli/dist/backup.js +0 -146
- package/packages/cli/dist/build-manifest.json +0 -142
- package/packages/cli/dist/cli.d.ts +0 -2
- package/packages/cli/dist/cli.js +0 -28
- package/packages/cli/dist/daemon.d.ts +0 -35
- package/packages/cli/dist/daemon.js +0 -126
- package/packages/cli/dist/index.d.ts +0 -1
- package/packages/cli/dist/index.js +0 -5
- package/packages/cli/dist/interfaces.d.ts +0 -16
- package/packages/cli/dist/interfaces.js +0 -96
- package/packages/cli/dist/library.d.ts +0 -140
- package/packages/cli/dist/library.js +0 -319
- package/packages/cli/dist/paths.d.ts +0 -3
- package/packages/cli/dist/paths.js +0 -18
- package/packages/cli/dist/projects.d.ts +0 -9
- package/packages/cli/dist/projects.js +0 -159
- package/packages/cli/dist/sessions.d.ts +0 -41
- package/packages/cli/dist/sessions.js +0 -447
- package/packages/cli/dist/tasks.d.ts +0 -29
- package/packages/cli/dist/tasks.js +0 -345
- package/packages/cli/dist/usage.d.ts +0 -3
- package/packages/cli/dist/usage.js +0 -72
- package/packages/client/README.md +0 -24
- package/packages/client/dist/acp-probe.d.ts +0 -44
- package/packages/client/dist/acp-probe.js +0 -37
- package/packages/client/dist/antigravity-probe.d.ts +0 -34
- package/packages/client/dist/antigravity-probe.js +0 -95
- package/packages/client/dist/command.d.ts +0 -5
- package/packages/client/dist/command.js +0 -33
- package/packages/client/dist/doctor.d.ts +0 -13
- package/packages/client/dist/doctor.js +0 -587
- package/packages/client/dist/index.d.ts +0 -116
- package/packages/client/dist/index.js +0 -500
- package/packages/client/dist/ipc.d.ts +0 -42
- package/packages/client/dist/ipc.js +0 -69
- package/packages/client/dist/library-test.d.ts +0 -94
- package/packages/client/dist/library-test.js +0 -37
- package/packages/client/dist/mcp-probe.d.ts +0 -24
- package/packages/client/dist/mcp-probe.js +0 -147
- package/packages/client/dist/portable.d.ts +0 -18
- package/packages/client/dist/portable.js +0 -27
- package/packages/client/dist/prompt.d.ts +0 -32
- package/packages/client/dist/prompt.js +0 -59
- package/packages/client/dist/render.d.ts +0 -6
- package/packages/client/dist/render.js +0 -120
- package/packages/client/dist/rpc/client.d.ts +0 -82
- package/packages/client/dist/rpc/client.js +0 -292
- package/packages/client/dist/rpc/errors.d.ts +0 -42
- package/packages/client/dist/rpc/errors.js +0 -34
- package/packages/client/dist/rpc/framing.d.ts +0 -21
- package/packages/client/dist/rpc/framing.js +0 -57
- package/packages/client/dist/rpc/handshake.d.ts +0 -19
- package/packages/client/dist/rpc/handshake.js +0 -8
- package/packages/client/dist/rpc/reconnect.d.ts +0 -97
- package/packages/client/dist/rpc/reconnect.js +0 -227
- package/packages/client/dist/rpc/timers.d.ts +0 -11
- package/packages/client/dist/rpc/timers.js +0 -11
- package/packages/client/dist/service.d.ts +0 -50
- package/packages/client/dist/service.js +0 -143
- package/packages/client/dist/setup.d.ts +0 -2
- package/packages/client/dist/setup.js +0 -146
- package/packages/client/dist/supervise.d.ts +0 -12
- package/packages/client/dist/supervise.js +0 -87
- package/packages/client/dist/websocket.d.ts +0 -51
- package/packages/client/dist/websocket.js +0 -190
- package/packages/core/README.md +0 -7
- package/packages/core/dist/adapter.d.ts +0 -20
- package/packages/core/dist/adapter.js +0 -30
- package/packages/core/dist/atomic.d.ts +0 -2
- package/packages/core/dist/atomic.js +0 -28
- package/packages/core/dist/backup.d.ts +0 -27
- package/packages/core/dist/backup.js +0 -582
- package/packages/core/dist/beads.d.ts +0 -65
- package/packages/core/dist/beads.js +0 -213
- package/packages/core/dist/delegation.d.ts +0 -2
- package/packages/core/dist/delegation.js +0 -32
- package/packages/core/dist/errors.d.ts +0 -4
- package/packages/core/dist/errors.js +0 -11
- package/packages/core/dist/formulas.d.ts +0 -25
- package/packages/core/dist/formulas.js +0 -201
- package/packages/core/dist/hook-run.d.ts +0 -44
- package/packages/core/dist/hook-run.js +0 -60
- package/packages/core/dist/hooks.d.ts +0 -35
- package/packages/core/dist/hooks.js +0 -30
- package/packages/core/dist/index.d.ts +0 -30
- package/packages/core/dist/index.js +0 -63
- package/packages/core/dist/init.d.ts +0 -30
- package/packages/core/dist/init.js +0 -89
- package/packages/core/dist/library-edit.d.ts +0 -93
- package/packages/core/dist/library-edit.js +0 -368
- package/packages/core/dist/library.d.ts +0 -28
- package/packages/core/dist/library.js +0 -108
- package/packages/core/dist/log.d.ts +0 -37
- package/packages/core/dist/log.js +0 -156
- package/packages/core/dist/migrations.d.ts +0 -9
- package/packages/core/dist/migrations.js +0 -95
- package/packages/core/dist/models.d.ts +0 -11
- package/packages/core/dist/models.js +0 -44
- package/packages/core/dist/permissions.d.ts +0 -14
- package/packages/core/dist/permissions.js +0 -229
- package/packages/core/dist/profiles.d.ts +0 -27
- package/packages/core/dist/profiles.js +0 -122
- package/packages/core/dist/promptsafe.d.ts +0 -1
- package/packages/core/dist/promptsafe.js +0 -13
- package/packages/core/dist/providers.d.ts +0 -90
- package/packages/core/dist/providers.js +0 -101
- package/packages/core/dist/resolver.d.ts +0 -41
- package/packages/core/dist/resolver.js +0 -240
- package/packages/core/dist/safe-path.d.ts +0 -2
- package/packages/core/dist/safe-path.js +0 -24
- package/packages/core/dist/shell.d.ts +0 -16
- package/packages/core/dist/shell.js +0 -22
- package/packages/core/dist/state-schema.d.ts +0 -9
- package/packages/core/dist/state-schema.js +0 -54
- package/packages/core/dist/task-rows.d.ts +0 -47
- package/packages/core/dist/task-rows.js +0 -45
- package/packages/core/dist/tasks.d.ts +0 -128
- package/packages/core/dist/tasks.js +0 -835
- package/packages/core/dist/teams.d.ts +0 -80
- package/packages/core/dist/teams.js +0 -159
- package/packages/core/dist/template-path.d.ts +0 -2
- package/packages/core/dist/template-path.js +0 -10
- package/packages/core/dist/trust.d.ts +0 -8
- package/packages/core/dist/trust.js +0 -47
- package/packages/core/dist/types.d.ts +0 -51
- package/packages/core/dist/upgrade.d.ts +0 -10
- package/packages/core/dist/upgrade.js +0 -200
- package/packages/core/dist/user-settings.d.ts +0 -6
- package/packages/core/dist/user-settings.js +0 -72
- package/packages/core/dist/validation.d.ts +0 -17
- package/packages/core/dist/validation.js +0 -295
- package/packages/core/dist/verify.d.ts +0 -15
- package/packages/core/dist/verify.js +0 -123
- package/packages/core/dist/workflow.d.ts +0 -45
- package/packages/core/dist/workflow.js +0 -33
- package/templates/ALP.md +0 -52
- package/templates/agents/lead/AGENT.md +0 -90
- package/templates/agents/main/AGENT.md +0 -150
- package/templates/agents/oracle/AGENT.md +0 -44
- package/templates/agents/peer/AGENT.md +0 -55
- package/templates/agents/reviewer/AGENT.md +0 -80
- package/templates/agents/supervisor/AGENT.md +0 -72
- package/templates/providers/antigravity.json +0 -6
- package/templates/providers/opencode.json +0 -7
- package/templates/role-skills.json +0 -8
- package/templates/skills/bug-loop/SKILL.md +0 -44
- package/templates/skills/bug-loop/references/test-proof.md +0 -25
- package/templates/skills/goal-griller/SKILL.md +0 -49
- package/templates/skills/prompt-leverage/SKILL.md +0 -37
- package/templates/skills/prompt-leverage/references/brief-template.md +0 -27
- package/templates/skills/sequence-execution-plan/SKILL.md +0 -42
- package/templates/skills/sequence-execution-plan/references/plan-template.md +0 -22
- package/templates/skills/smart-commits/SKILL.md +0 -40
- package/templates/skills/xia/SKILL.md +0 -42
- package/templates/teams/cafe/HOUSE_RULES.md +0 -1
- package/templates/teams/cafe/team.json +0 -15
- package/templates/teams/pho/HOUSE_RULES.md +0 -1
- package/templates/teams/pho/team.json +0 -14
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export * as adapter from "./adapter.js";
|
|
2
|
-
export * as atomic from "./atomic.js";
|
|
3
|
-
export * as backup from "./backup.js";
|
|
4
|
-
export * as beads from "./beads.js";
|
|
5
|
-
export * as delegation from "./delegation.js";
|
|
6
|
-
export * as errors from "./errors.js";
|
|
7
|
-
export * as formulas from "./formulas.js";
|
|
8
|
-
export * as hook_run from "./hook-run.js";
|
|
9
|
-
export * as hooks from "./hooks.js";
|
|
10
|
-
export * as init from "./init.js";
|
|
11
|
-
export * as library_edit from "./library-edit.js";
|
|
12
|
-
export * as library from "./library.js";
|
|
13
|
-
export * as log from "./log.js";
|
|
14
|
-
export * as migrations from "./migrations.js";
|
|
15
|
-
export * as models from "./models.js";
|
|
16
|
-
export * as permissions from "./permissions.js";
|
|
17
|
-
export * as profiles from "./profiles.js";
|
|
18
|
-
export * as promptsafe from "./promptsafe.js";
|
|
19
|
-
export * as providers from "./providers.js";
|
|
20
|
-
export * as resolver from "./resolver.js";
|
|
21
|
-
export * as state_schema from "./state-schema.js";
|
|
22
|
-
export * as task_rows from "./task-rows.js";
|
|
23
|
-
export * as tasks from "./tasks.js";
|
|
24
|
-
export * as teams from "./teams.js";
|
|
25
|
-
export * as trust from "./trust.js";
|
|
26
|
-
export * as upgrade from "./upgrade.js";
|
|
27
|
-
export * as user_settings from "./user-settings.js";
|
|
28
|
-
export * as validation from "./validation.js";
|
|
29
|
-
export * as verify from "./verify.js";
|
|
30
|
-
export * as workflow from "./workflow.js";
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// packages/core/src/index.js
|
|
2
|
-
import * as adapter from "./adapter.js";
|
|
3
|
-
import * as atomic from "./atomic.js";
|
|
4
|
-
import * as backup from "./backup.js";
|
|
5
|
-
import * as beads from "./beads.js";
|
|
6
|
-
import * as delegation from "./delegation.js";
|
|
7
|
-
import * as errors from "./errors.js";
|
|
8
|
-
import * as formulas from "./formulas.js";
|
|
9
|
-
import * as hook_run from "./hook-run.js";
|
|
10
|
-
import * as hooks from "./hooks.js";
|
|
11
|
-
import * as init from "./init.js";
|
|
12
|
-
import * as library_edit from "./library-edit.js";
|
|
13
|
-
import * as library from "./library.js";
|
|
14
|
-
import * as log from "./log.js";
|
|
15
|
-
import * as migrations from "./migrations.js";
|
|
16
|
-
import * as models from "./models.js";
|
|
17
|
-
import * as permissions from "./permissions.js";
|
|
18
|
-
import * as profiles from "./profiles.js";
|
|
19
|
-
import * as promptsafe from "./promptsafe.js";
|
|
20
|
-
import * as providers from "./providers.js";
|
|
21
|
-
import * as resolver from "./resolver.js";
|
|
22
|
-
import * as state_schema from "./state-schema.js";
|
|
23
|
-
import * as task_rows from "./task-rows.js";
|
|
24
|
-
import * as tasks from "./tasks.js";
|
|
25
|
-
import * as teams from "./teams.js";
|
|
26
|
-
import * as trust from "./trust.js";
|
|
27
|
-
import * as upgrade from "./upgrade.js";
|
|
28
|
-
import * as user_settings from "./user-settings.js";
|
|
29
|
-
import * as validation from "./validation.js";
|
|
30
|
-
import * as verify from "./verify.js";
|
|
31
|
-
import * as workflow from "./workflow.js";
|
|
32
|
-
export {
|
|
33
|
-
adapter,
|
|
34
|
-
atomic,
|
|
35
|
-
backup,
|
|
36
|
-
beads,
|
|
37
|
-
delegation,
|
|
38
|
-
errors,
|
|
39
|
-
formulas,
|
|
40
|
-
hook_run,
|
|
41
|
-
hooks,
|
|
42
|
-
init,
|
|
43
|
-
library,
|
|
44
|
-
library_edit,
|
|
45
|
-
log,
|
|
46
|
-
migrations,
|
|
47
|
-
models,
|
|
48
|
-
permissions,
|
|
49
|
-
profiles,
|
|
50
|
-
promptsafe,
|
|
51
|
-
providers,
|
|
52
|
-
resolver,
|
|
53
|
-
state_schema,
|
|
54
|
-
task_rows,
|
|
55
|
-
tasks,
|
|
56
|
-
teams,
|
|
57
|
-
trust,
|
|
58
|
-
upgrade,
|
|
59
|
-
user_settings,
|
|
60
|
-
validation,
|
|
61
|
-
verify,
|
|
62
|
-
workflow
|
|
63
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fill missing scaffold files without replacing existing user content: ALP.md and
|
|
3
|
-
* .alp/settings.json. Agents, skills, MCP servers and hooks come from ALP's built-ins
|
|
4
|
-
* and the user's library (ALPD §41); a project adds its own under .alp/ only to
|
|
5
|
-
* override them.
|
|
6
|
-
* @param {string} projectRoot
|
|
7
|
-
* @param {{ templateRoot?: URL, templates?: Record<string, string>, library?: string, syncProfiles?: boolean, onlyManagedProfiles?: boolean, teamIds?: string[] }} [options]
|
|
8
|
-
*/
|
|
9
|
-
export function initProject(projectRoot: string, { templateRoot, templates, library, syncProfiles, onlyManagedProfiles, teamIds }?: {
|
|
10
|
-
templateRoot?: URL;
|
|
11
|
-
templates?: Record<string, string>;
|
|
12
|
-
library?: string;
|
|
13
|
-
syncProfiles?: boolean;
|
|
14
|
-
onlyManagedProfiles?: boolean;
|
|
15
|
-
teamIds?: string[];
|
|
16
|
-
}): Promise<{
|
|
17
|
-
updated?: string[] | undefined;
|
|
18
|
-
created: string[];
|
|
19
|
-
preserved: string[];
|
|
20
|
-
}>;
|
|
21
|
-
/** Refresh an existing project's settings only; a template Save must not scaffold unrelated folders.
|
|
22
|
-
* @param {string} projectRoot
|
|
23
|
-
* @param {{ library?: string, templates?: Record<string, string>, teamIds?: string[], replaceModels?: boolean }} [options]
|
|
24
|
-
*/
|
|
25
|
-
export function syncProjectSettings(projectRoot: string, { library, templates, teamIds, replaceModels }?: {
|
|
26
|
-
library?: string;
|
|
27
|
-
templates?: Record<string, string>;
|
|
28
|
-
teamIds?: string[];
|
|
29
|
-
replaceModels?: boolean;
|
|
30
|
-
}): Promise<boolean>;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// packages/core/src/init.js
|
|
2
|
-
import { shippedTemplateRoot } from "./template-path.js";
|
|
3
|
-
import { mkdir, writeFile, lstat, readFile, rename, rm } from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { randomUUID } from "node:crypto";
|
|
6
|
-
import { projectProfiles, profileDefaults, syncTemplateProfiles } from "./profiles.js";
|
|
7
|
-
import { validateSettings } from "./validation.js";
|
|
8
|
-
import { INIT_TEAM } from "./workflow.js";
|
|
9
|
-
async function initProject(projectRoot, { templateRoot, templates, library, syncProfiles = true, onlyManagedProfiles = false, teamIds } = {}) {
|
|
10
|
-
const root = path.resolve(projectRoot);
|
|
11
|
-
const sourceRoot = () => templateRoot ?? shippedTemplateRoot();
|
|
12
|
-
const template = (name) => templates ? Promise.resolve(templates[name]) : readFile(new URL(name, sourceRoot()), "utf8");
|
|
13
|
-
const scaffold = path.join(root, ".alp");
|
|
14
|
-
const existing = await lstat(scaffold).catch((error) => {
|
|
15
|
-
if (error.code !== "ENOENT") throw error;
|
|
16
|
-
});
|
|
17
|
-
if (existing && !existing.isDirectory()) throw new Error(`Expected a directory: ${scaffold}`);
|
|
18
|
-
const team = await projectProfiles({ root, templates, library, teamIds });
|
|
19
|
-
const files = {
|
|
20
|
-
"ALP.md": await template("ALP.md"),
|
|
21
|
-
".alp/settings.json": JSON.stringify({ defaultAgent: "main", workflow: { mode: INIT_TEAM }, team, templateDefaults: profileDefaults(team) }, null, 2) + "\n"
|
|
22
|
-
};
|
|
23
|
-
const directories = [".alp"];
|
|
24
|
-
const created = [];
|
|
25
|
-
const preserved = [];
|
|
26
|
-
const updated = [];
|
|
27
|
-
await mkdir(root, { recursive: true });
|
|
28
|
-
for (const directory of directories) {
|
|
29
|
-
const target = path.join(root, directory);
|
|
30
|
-
try {
|
|
31
|
-
await mkdir(target);
|
|
32
|
-
} catch (error) {
|
|
33
|
-
if (error.code !== "EEXIST") throw error;
|
|
34
|
-
if (!(await lstat(target)).isDirectory()) throw new Error(`Expected a directory: ${target}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
for (const [name, content] of Object.entries(files)) {
|
|
38
|
-
const target = path.join(root, name);
|
|
39
|
-
try {
|
|
40
|
-
await writeFile(target, content, { flag: "wx" });
|
|
41
|
-
created.push(name);
|
|
42
|
-
} catch (error) {
|
|
43
|
-
if (error.code !== "EEXIST") throw error;
|
|
44
|
-
if (!(await lstat(target)).isFile()) throw new Error(`Expected a regular file: ${target}`);
|
|
45
|
-
preserved.push(name);
|
|
46
|
-
if (name === ".alp/settings.json" && syncProfiles) {
|
|
47
|
-
const before = await readFile(target, "utf8");
|
|
48
|
-
const settings = JSON.parse(before);
|
|
49
|
-
validateSettings(settings, target);
|
|
50
|
-
const next = !onlyManagedProfiles || settings.team || settings.profile || settings.templateDefaults ? await syncTemplateProfiles(settings, { root, library, templates, teamIds }) : settings;
|
|
51
|
-
validateSettings(next, target);
|
|
52
|
-
if (JSON.stringify(next) !== JSON.stringify(settings)) {
|
|
53
|
-
if (await readFile(target, "utf8") !== before) throw new Error(`File changed during initialization: ${target}`);
|
|
54
|
-
await writeFile(target, JSON.stringify(next, null, 2) + "\n");
|
|
55
|
-
updated.push(name);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return { created, preserved, ...updated.length ? { updated } : {} };
|
|
61
|
-
}
|
|
62
|
-
async function syncProjectSettings(projectRoot, { library, templates, teamIds, replaceModels = false } = {}) {
|
|
63
|
-
const root = path.resolve(projectRoot);
|
|
64
|
-
const file = path.join(root, ".alp/settings.json");
|
|
65
|
-
const info = await lstat(file).catch((error) => {
|
|
66
|
-
if (error.code !== "ENOENT") throw error;
|
|
67
|
-
});
|
|
68
|
-
if (!info) return false;
|
|
69
|
-
if (!info.isFile()) throw new Error(`Expected a regular file: ${file}`);
|
|
70
|
-
const before = await readFile(file, "utf8");
|
|
71
|
-
const settings = JSON.parse(before);
|
|
72
|
-
validateSettings(settings, file);
|
|
73
|
-
const next = await syncTemplateProfiles(settings, { root, library, templates, teamIds, replaceModels });
|
|
74
|
-
validateSettings(next, file);
|
|
75
|
-
if (JSON.stringify(settings) === JSON.stringify(next)) return false;
|
|
76
|
-
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
77
|
-
try {
|
|
78
|
-
await writeFile(temporary, JSON.stringify(next, null, 2) + "\n", { flag: "wx", mode: info.mode });
|
|
79
|
-
if (await readFile(file, "utf8") !== before) throw new Error(`Settings changed while saving the template: ${file}`);
|
|
80
|
-
await rename(temporary, file);
|
|
81
|
-
} finally {
|
|
82
|
-
await rm(temporary, { force: true });
|
|
83
|
-
}
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
export {
|
|
87
|
-
initProject,
|
|
88
|
-
syncProjectSettings
|
|
89
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/** Strict payload contract for opt-in project-data writes. Instructions carry prompt authority;
|
|
2
|
-
* executable configuration and references to it have no place in this policy. */
|
|
3
|
-
export function assertProjectDataContent(kind: any, content: any): void;
|
|
4
|
-
/**
|
|
5
|
-
* One entry: the version that applies (the project's, else the library's, else the
|
|
6
|
-
* built-in), or one scope's version with `scope`. `revision` goes back with a save.
|
|
7
|
-
* @param {'agents' | 'skills' | 'mcp' | 'hooks' | 'teams' | 'providers'} kind
|
|
8
|
-
* @param {string} name
|
|
9
|
-
* @param {{ root?: string, library?: string, templates?: Record<string, string>, scope?: 'library' | 'project' }} [options]
|
|
10
|
-
* @returns {Promise<{ kind: 'agents' | 'skills' | 'mcp' | 'hooks' | 'teams' | 'providers', name: string, source: 'builtin' | 'library' | 'project', overrides?: 'builtin' | 'library' | 'project', content: Record<string, unknown>, revision: string | null, usedBy: string[] }>}
|
|
11
|
-
*/
|
|
12
|
-
export function getEntry(kind: "agents" | "skills" | "mcp" | "hooks" | "teams" | "providers", name: string, { root, library, templates, scope }?: {
|
|
13
|
-
root?: string;
|
|
14
|
-
library?: string;
|
|
15
|
-
templates?: Record<string, string>;
|
|
16
|
-
scope?: "library" | "project";
|
|
17
|
-
}): Promise<{
|
|
18
|
-
kind: "agents" | "skills" | "mcp" | "hooks" | "teams" | "providers";
|
|
19
|
-
name: string;
|
|
20
|
-
source: "builtin" | "library" | "project";
|
|
21
|
-
overrides?: "builtin" | "library" | "project";
|
|
22
|
-
content: Record<string, unknown>;
|
|
23
|
-
revision: string | null;
|
|
24
|
-
usedBy: string[];
|
|
25
|
-
}>;
|
|
26
|
-
/** The skills the library gives `agent`, as role-skills.json lists them. */
|
|
27
|
-
export function givenSkills(library: any, agent: any): Promise<string[]>;
|
|
28
|
-
/**
|
|
29
|
-
* Sets the skills the library gives an agent (role-skills.json), so a built-in agent's
|
|
30
|
-
* skills change without copying its instructions. Every skill must be in the library.
|
|
31
|
-
* @returns {Promise<{ skills: string[] }>}
|
|
32
|
-
*/
|
|
33
|
-
export function setGivenSkills(agent: any, skills: any, { library }?: {}): Promise<{
|
|
34
|
-
skills: string[];
|
|
35
|
-
}>;
|
|
36
|
-
/** Every entry of a kind with its source and users, as `alp <kind>` lists them. */
|
|
37
|
-
export function listEntries(kind: any, { root, library, templates }?: {}): Promise<{
|
|
38
|
-
name: string;
|
|
39
|
-
source: "builtin" | "library" | "project";
|
|
40
|
-
path?: string;
|
|
41
|
-
overrides?: "builtin" | "library";
|
|
42
|
-
description?: string;
|
|
43
|
-
usedBy?: string[];
|
|
44
|
-
}[] | {
|
|
45
|
-
usedBy: any[];
|
|
46
|
-
path?: string | undefined;
|
|
47
|
-
overrides?: "library" | "builtin" | undefined;
|
|
48
|
-
name: string;
|
|
49
|
-
source: "library" | "project" | "builtin";
|
|
50
|
-
}[]>;
|
|
51
|
-
/** Who refers to an entry: agents naming it, teams with it as a member, settings and role-skills.json. */
|
|
52
|
-
export function usersOf(kind: any, name: any, { root, library, templates }?: {}): Promise<any[]>;
|
|
53
|
-
/**
|
|
54
|
-
* Creates or replaces an entry in a scope. `revision` is what getEntry returned for
|
|
55
|
-
* that scope (null to create); a different current revision refuses the save.
|
|
56
|
-
* @returns {Promise<{ revision: string | null }>}
|
|
57
|
-
*/
|
|
58
|
-
export function saveEntry(kind: any, name: any, content: any, { scope, root, library, templates, revision, policy }?: {}): Promise<{
|
|
59
|
-
revision: string | null;
|
|
60
|
-
}>;
|
|
61
|
-
/**
|
|
62
|
-
* Removes an entry from a scope. When nothing else of that name is left below it, an
|
|
63
|
-
* entry others refer to stays, and the error lists them.
|
|
64
|
-
* @returns {Promise<{ removed: boolean, now?: 'builtin' | 'library' }>}
|
|
65
|
-
*/
|
|
66
|
-
export function deleteEntry(kind: any, name: any, { scope, root, library, templates, revision, policy }?: {}): Promise<{
|
|
67
|
-
removed: boolean;
|
|
68
|
-
now?: "builtin" | "library";
|
|
69
|
-
}>;
|
|
70
|
-
/** Copies the entry that applies under `from` to a new entry `to` in a scope; built-ins are copied this way. */
|
|
71
|
-
export function duplicateEntry(kind: any, from: any, to: any, { scope, root, library, templates, policy }?: {}): Promise<{
|
|
72
|
-
revision: string | null;
|
|
73
|
-
}>;
|
|
74
|
-
/** Renames an entry within a scope; refused while others refer to it by its old name. */
|
|
75
|
-
export function renameEntry(kind: any, from: any, to: any, { scope, root, library, templates, policy }?: {}): Promise<{
|
|
76
|
-
revision: string | null;
|
|
77
|
-
}>;
|
|
78
|
-
/**
|
|
79
|
-
* Editing the library (ALPD §43): agents, skills, MCP servers, hooks and teams, in the
|
|
80
|
-
* user's library (ALP_HOME) or as a project's override (.alp/). Built-ins are never
|
|
81
|
-
* written; duplicate one, or save an entry of its name, to change it. Every save is
|
|
82
|
-
* checked first and written file by file through a temporary file and a rename; a
|
|
83
|
-
* revision taken when the entry was read refuses a save over someone else's change.
|
|
84
|
-
*
|
|
85
|
-
* An entry's content, by kind:
|
|
86
|
-
* agents { instructions, config? } AGENT.md and agent.json
|
|
87
|
-
* skills { body } SKILL.md
|
|
88
|
-
* mcp { server } mcp/<name>.json
|
|
89
|
-
* hooks { hook } hooks/<name>.json
|
|
90
|
-
* teams { team, houseRules? } team.json and HOUSE_RULES.md
|
|
91
|
-
* providers { provider } providers/<name>.json, in the library only (ALPD §46)
|
|
92
|
-
*/
|
|
93
|
-
export const EDIT_KINDS: string[];
|