@agentplaneorg/core 0.1.5 → 0.1.7
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/dist/config/config.d.ts +0 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +35 -6
- package/dist/git/base-branch.d.ts +11 -0
- package/dist/git/base-branch.d.ts.map +1 -1
- package/dist/git/base-branch.js +52 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
- package/schemas/config.schema.json +277 -0
package/dist/config/config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,WAAW,CAAC;AAClD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,CAAC,CAAC;IAClB,aAAa,EAAE,YAAY,CAAC;IAC5B,oBAAoB,EAAE,kBAAkB,CAAC;IACzC,yBAAyB,EAAE,OAAO,CAAC;IACnC,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,WAAW,CAAC;AAClD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,CAAC,CAAC;IAClB,aAAa,EAAE,YAAY,CAAC;IAC5B,oBAAoB,EAAE,kBAAkB,CAAC;IACzC,yBAAyB,EAAE,OAAO,CAAC;IACnC,MAAM,CAAC,EAAE;QACP,SAAS,EAAE;YACT,YAAY,EAAE,OAAO,CAAC;YACtB,eAAe,EAAE,OAAO,CAAC;YACzB,cAAc,EAAE,OAAO,CAAC;SACzB,CAAC;KACH,CAAC;IACF,OAAO,CAAC,EAAE;QACR,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;KAC7C,CAAC;IACF,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,SAAS,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC1D,KAAK,EAAE;QACL,wBAAwB,EAAE,MAAM,CAAC;QACjC,MAAM,EAAE;YAAE,aAAa,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;QACpC,GAAG,EAAE;YAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;YAAC,iBAAiB,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;QACzD,QAAQ,EAAE;YACR,KAAK,EAAE;gBAAE,MAAM,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAA;aAAE,CAAC;YAC7C,OAAO,EAAE;gBAAE,MAAM,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAA;aAAE,CAAC;YAC/C,QAAQ,EAAE;gBAAE,MAAM,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAA;aAAE,CAAC;SACjD,CAAC;KACH,CAAC;IACF,MAAM,EAAE;QAAE,cAAc,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACrC,aAAa,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,gCAAgC,EAAE,OAAO,CAAC;CAC3C,CAAC;AAEF,wBAAgB,aAAa,IAAI,gBAAgB,CAEhD;AAkED,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAa7D;AAID,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B,CAAC;AAQF,wBAAsB,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CA8B7E;AAkBD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,IAAI,CAgBN;AAED,wBAAsB,UAAU,CAC9B,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAS3B"}
|
package/dist/config/config.js
CHANGED
|
@@ -10,7 +10,7 @@ export function defaultConfig() {
|
|
|
10
10
|
function isRecord(value) {
|
|
11
11
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
12
12
|
}
|
|
13
|
-
const CONFIG_SCHEMA_URL = new URL("
|
|
13
|
+
const CONFIG_SCHEMA_URL = new URL("../../schemas/config.schema.json", import.meta.url);
|
|
14
14
|
const CONFIG_SCHEMA = JSON.parse(readFileSync(fileURLToPath(CONFIG_SCHEMA_URL), "utf8"));
|
|
15
15
|
const Ajv = AjvModule.default ??
|
|
16
16
|
AjvModule;
|
|
@@ -29,8 +29,28 @@ function formatSchemaErrors(errors) {
|
|
|
29
29
|
return "config schema validation failed";
|
|
30
30
|
return AJV.errorsText(errors, { dataVar: "config" });
|
|
31
31
|
}
|
|
32
|
+
const DEPRECATED_CONFIG_KEYS = ["base_branch"];
|
|
33
|
+
function stripDeprecatedConfigKeys(raw) {
|
|
34
|
+
const sanitized = { ...raw };
|
|
35
|
+
const removed = [];
|
|
36
|
+
for (const key of DEPRECATED_CONFIG_KEYS) {
|
|
37
|
+
if (key in sanitized) {
|
|
38
|
+
delete sanitized[key];
|
|
39
|
+
removed.push(key);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return { sanitized, removed };
|
|
43
|
+
}
|
|
44
|
+
function warnDeprecatedConfigKeys(keys) {
|
|
45
|
+
for (const key of keys) {
|
|
46
|
+
console.warn(`config key "${key}" is deprecated and ignored`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
32
49
|
export function validateConfig(raw) {
|
|
33
|
-
|
|
50
|
+
let candidate = raw && typeof raw === "object" ? structuredClone(raw) : raw;
|
|
51
|
+
if (isRecord(candidate)) {
|
|
52
|
+
candidate = stripDeprecatedConfigKeys(candidate).sanitized;
|
|
53
|
+
}
|
|
34
54
|
if (!validateSchema(candidate)) {
|
|
35
55
|
throw new Error(formatSchemaErrors(validateSchema.errors));
|
|
36
56
|
}
|
|
@@ -52,12 +72,18 @@ export async function loadConfig(agentplaneDir) {
|
|
|
52
72
|
try {
|
|
53
73
|
const rawText = await readFile(filePath, "utf8");
|
|
54
74
|
const parsed = JSON.parse(rawText);
|
|
55
|
-
const
|
|
75
|
+
const rawRecord = isRecord(parsed) ? parsed : null;
|
|
76
|
+
const sanitized = rawRecord
|
|
77
|
+
? stripDeprecatedConfigKeys(rawRecord)
|
|
78
|
+
: { sanitized: parsed, removed: [] };
|
|
79
|
+
if (sanitized.removed.length > 0)
|
|
80
|
+
warnDeprecatedConfigKeys(sanitized.removed);
|
|
81
|
+
const validated = validateConfig(sanitized.sanitized);
|
|
56
82
|
return {
|
|
57
83
|
path: filePath,
|
|
58
84
|
exists: true,
|
|
59
85
|
config: validated,
|
|
60
|
-
raw: parsed,
|
|
86
|
+
raw: (sanitized.sanitized ?? parsed),
|
|
61
87
|
};
|
|
62
88
|
}
|
|
63
89
|
catch (err) {
|
|
@@ -115,10 +141,13 @@ export function setByDottedKey(obj, dottedKey, value) {
|
|
|
115
141
|
current[last] = parseScalar(value);
|
|
116
142
|
}
|
|
117
143
|
export async function saveConfig(agentplaneDir, raw) {
|
|
118
|
-
const
|
|
144
|
+
const sanitized = stripDeprecatedConfigKeys(raw);
|
|
145
|
+
if (sanitized.removed.length > 0)
|
|
146
|
+
warnDeprecatedConfigKeys(sanitized.removed);
|
|
147
|
+
const validated = validateConfig(sanitized.sanitized);
|
|
119
148
|
await mkdir(agentplaneDir, { recursive: true });
|
|
120
149
|
const filePath = path.join(agentplaneDir, "config.json");
|
|
121
|
-
const text = `${JSON.stringify(
|
|
150
|
+
const text = `${JSON.stringify(sanitized.sanitized, null, 2)}\n`;
|
|
122
151
|
await writeFile(filePath, text, "utf8");
|
|
123
152
|
return validated;
|
|
124
153
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WorkflowMode } from "../config/config.js";
|
|
1
2
|
export declare function getPinnedBaseBranch(opts: {
|
|
2
3
|
cwd: string;
|
|
3
4
|
rootOverride?: string | null;
|
|
@@ -11,4 +12,14 @@ export declare function setPinnedBaseBranch(opts: {
|
|
|
11
12
|
rootOverride?: string | null;
|
|
12
13
|
value: string;
|
|
13
14
|
}): Promise<string>;
|
|
15
|
+
export declare function clearPinnedBaseBranch(opts: {
|
|
16
|
+
cwd: string;
|
|
17
|
+
rootOverride?: string | null;
|
|
18
|
+
}): Promise<boolean>;
|
|
19
|
+
export declare function resolveBaseBranch(opts: {
|
|
20
|
+
cwd: string;
|
|
21
|
+
rootOverride?: string | null;
|
|
22
|
+
cliBaseOpt?: string | null;
|
|
23
|
+
mode: WorkflowMode;
|
|
24
|
+
}): Promise<string | null>;
|
|
14
25
|
//# sourceMappingURL=base-branch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-branch.d.ts","sourceRoot":"","sources":["../../src/git/base-branch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-branch.d.ts","sourceRoot":"","sources":["../../src/git/base-branch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAiDxD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGzB;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAGlB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAMlB;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAG,OAAO,CAAC,OAAO,CAAC,CAGnB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,YAAY,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBzB"}
|
package/dist/git/base-branch.js
CHANGED
|
@@ -20,6 +20,35 @@ async function gitConfigGet(cwd, key) {
|
|
|
20
20
|
async function gitConfigSet(cwd, key, value) {
|
|
21
21
|
await execFileAsync("git", ["config", "--local", key, value], { cwd });
|
|
22
22
|
}
|
|
23
|
+
async function gitConfigUnset(cwd, key) {
|
|
24
|
+
try {
|
|
25
|
+
await execFileAsync("git", ["config", "--local", "--unset", key], { cwd });
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
const code = err?.code;
|
|
30
|
+
if (code === 1 || code === 5)
|
|
31
|
+
return false;
|
|
32
|
+
throw err;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function gitCurrentBranch(cwd) {
|
|
36
|
+
try {
|
|
37
|
+
const { stdout } = await execFileAsync("git", ["symbolic-ref", "--short", "HEAD"], { cwd });
|
|
38
|
+
const trimmed = stdout.trim();
|
|
39
|
+
if (trimmed)
|
|
40
|
+
return trimmed;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// fall through
|
|
44
|
+
}
|
|
45
|
+
const { stdout } = await execFileAsync("git", ["rev-parse", "--abbrev-ref", "HEAD"], { cwd });
|
|
46
|
+
const trimmed = stdout.trim();
|
|
47
|
+
if (!trimmed || trimmed === "HEAD") {
|
|
48
|
+
throw new Error("Failed to resolve current branch");
|
|
49
|
+
}
|
|
50
|
+
return trimmed;
|
|
51
|
+
}
|
|
23
52
|
export async function getPinnedBaseBranch(opts) {
|
|
24
53
|
const resolved = await resolveProject({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null });
|
|
25
54
|
return await gitConfigGet(resolved.gitRoot, GIT_CONFIG_BASE_BRANCH_KEY);
|
|
@@ -36,3 +65,26 @@ export async function setPinnedBaseBranch(opts) {
|
|
|
36
65
|
await gitConfigSet(resolved.gitRoot, GIT_CONFIG_BASE_BRANCH_KEY, trimmed);
|
|
37
66
|
return trimmed;
|
|
38
67
|
}
|
|
68
|
+
export async function clearPinnedBaseBranch(opts) {
|
|
69
|
+
const resolved = await resolveProject({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null });
|
|
70
|
+
return await gitConfigUnset(resolved.gitRoot, GIT_CONFIG_BASE_BRANCH_KEY);
|
|
71
|
+
}
|
|
72
|
+
export async function resolveBaseBranch(opts) {
|
|
73
|
+
const explicit = (opts.cliBaseOpt ?? "").trim();
|
|
74
|
+
if (explicit.length > 0)
|
|
75
|
+
return explicit;
|
|
76
|
+
const pinned = await getPinnedBaseBranch({
|
|
77
|
+
cwd: opts.cwd,
|
|
78
|
+
rootOverride: opts.rootOverride ?? null,
|
|
79
|
+
});
|
|
80
|
+
if (pinned)
|
|
81
|
+
return pinned;
|
|
82
|
+
if (opts.mode === "branch_pr") {
|
|
83
|
+
const resolved = await resolveProject({
|
|
84
|
+
cwd: opts.cwd,
|
|
85
|
+
rootOverride: opts.rootOverride ?? null,
|
|
86
|
+
});
|
|
87
|
+
return await gitCurrentBranch(resolved.gitRoot);
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { generateTaskId, timestampIdPrefix, TASK_ID_ALPHABET } from "./tasks/tas
|
|
|
8
8
|
export { createTask, getTasksDir, listTasks, readTask, setTaskDocSection, taskReadmePath, validateTaskDocMetadata, type TaskFrontmatter, type TaskPriority, type TaskRecord, type TaskStatus, } from "./tasks/task-store.js";
|
|
9
9
|
export { buildTasksExportSnapshot, canonicalTasksPayload, canonicalizeJson, computeTasksChecksum, writeTasksExport, type TasksExportMeta, type TasksExportSnapshot, type TasksExportTask, } from "./tasks/tasks-export.js";
|
|
10
10
|
export { lintTasksFile, lintTasksSnapshot, readTasksExport, type TasksLintResult, } from "./tasks/tasks-lint.js";
|
|
11
|
-
export { getBaseBranch, getPinnedBaseBranch, setPinnedBaseBranch } from "./git/base-branch.js";
|
|
11
|
+
export { clearPinnedBaseBranch, getBaseBranch, getPinnedBaseBranch, resolveBaseBranch, setPinnedBaseBranch, } from "./git/base-branch.js";
|
|
12
12
|
export { extractTaskSuffix, isGenericSubject, validateCommitSubject, type CommitPolicyResult, } from "./commit/commit-policy.js";
|
|
13
13
|
export { getStagedFiles, getUnstagedFiles } from "./git/git-utils.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC,OAAO,EACL,WAAW,EACX,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEzF,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC,OAAO,EACL,WAAW,EACX,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEzF,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,kBAAkB,GACxB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,6 @@ export { generateTaskId, timestampIdPrefix, TASK_ID_ALPHABET } from "./tasks/tas
|
|
|
8
8
|
export { createTask, getTasksDir, listTasks, readTask, setTaskDocSection, taskReadmePath, validateTaskDocMetadata, } from "./tasks/task-store.js";
|
|
9
9
|
export { buildTasksExportSnapshot, canonicalTasksPayload, canonicalizeJson, computeTasksChecksum, writeTasksExport, } from "./tasks/tasks-export.js";
|
|
10
10
|
export { lintTasksFile, lintTasksSnapshot, readTasksExport, } from "./tasks/tasks-lint.js";
|
|
11
|
-
export { getBaseBranch, getPinnedBaseBranch, setPinnedBaseBranch } from "./git/base-branch.js";
|
|
11
|
+
export { clearPinnedBaseBranch, getBaseBranch, getPinnedBaseBranch, resolveBaseBranch, setPinnedBaseBranch, } from "./git/base-branch.js";
|
|
12
12
|
export { extractTaskSuffix, isGenericSubject, validateCommitSubject, } from "./commit/commit-policy.js";
|
|
13
13
|
export { getStagedFiles, getUnstagedFiles } from "./git/git-utils.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentplaneorg/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Core utilities and models for the Agent Plane CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentplane",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"types": "./dist/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
|
+
"schemas",
|
|
33
34
|
"README.md",
|
|
34
35
|
"LICENSE"
|
|
35
36
|
],
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://agentplane.dev/schemas/config.schema.json",
|
|
4
|
+
"title": "agentplane config.json (v1)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"required": ["schema_version", "workflow_mode", "paths", "tasks", "commit", "tasks_backend"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": { "type": "integer", "const": 1, "default": 1 },
|
|
10
|
+
"workflow_mode": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"enum": ["direct", "branch_pr"],
|
|
13
|
+
"default": "direct"
|
|
14
|
+
},
|
|
15
|
+
"status_commit_policy": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["off", "warn", "confirm"],
|
|
18
|
+
"default": "warn"
|
|
19
|
+
},
|
|
20
|
+
"finish_auto_status_commit": { "type": "boolean", "default": true },
|
|
21
|
+
"agents": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": true,
|
|
24
|
+
"required": ["approvals"],
|
|
25
|
+
"default": {
|
|
26
|
+
"approvals": { "require_plan": true, "require_network": true, "require_verify": true }
|
|
27
|
+
},
|
|
28
|
+
"properties": {
|
|
29
|
+
"approvals": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"additionalProperties": true,
|
|
32
|
+
"required": ["require_plan", "require_network", "require_verify"],
|
|
33
|
+
"default": { "require_plan": true, "require_network": true, "require_verify": true },
|
|
34
|
+
"properties": {
|
|
35
|
+
"require_plan": { "type": "boolean", "default": true },
|
|
36
|
+
"require_network": { "type": "boolean", "default": true },
|
|
37
|
+
"require_verify": { "type": "boolean", "default": true }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"recipes": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"additionalProperties": true,
|
|
45
|
+
"required": ["storage_default"],
|
|
46
|
+
"default": { "storage_default": "link" },
|
|
47
|
+
"properties": {
|
|
48
|
+
"storage_default": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"enum": ["link", "copy", "global"],
|
|
51
|
+
"default": "link"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"paths": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": true,
|
|
58
|
+
"required": ["agents_dir", "tasks_path", "workflow_dir", "worktrees_dir"],
|
|
59
|
+
"default": {
|
|
60
|
+
"agents_dir": ".agentplane/agents",
|
|
61
|
+
"tasks_path": ".agentplane/tasks.json",
|
|
62
|
+
"workflow_dir": ".agentplane/tasks",
|
|
63
|
+
"worktrees_dir": ".agentplane/worktrees"
|
|
64
|
+
},
|
|
65
|
+
"properties": {
|
|
66
|
+
"agents_dir": { "type": "string", "minLength": 1, "default": ".agentplane/agents" },
|
|
67
|
+
"tasks_path": { "type": "string", "minLength": 1, "default": ".agentplane/tasks.json" },
|
|
68
|
+
"workflow_dir": { "type": "string", "minLength": 1, "default": ".agentplane/tasks" },
|
|
69
|
+
"worktrees_dir": { "type": "string", "minLength": 1, "default": ".agentplane/worktrees" }
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"branch": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"additionalProperties": true,
|
|
75
|
+
"required": ["task_prefix"],
|
|
76
|
+
"default": { "task_prefix": "task" },
|
|
77
|
+
"properties": {
|
|
78
|
+
"task_prefix": { "type": "string", "minLength": 1, "default": "task" }
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"framework": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"additionalProperties": true,
|
|
84
|
+
"required": ["source", "last_update"],
|
|
85
|
+
"default": {
|
|
86
|
+
"source": "https://github.com/basilisk-labs/agent-plane",
|
|
87
|
+
"last_update": null
|
|
88
|
+
},
|
|
89
|
+
"properties": {
|
|
90
|
+
"source": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"minLength": 1,
|
|
93
|
+
"default": "https://github.com/basilisk-labs/agent-plane"
|
|
94
|
+
},
|
|
95
|
+
"last_update": {
|
|
96
|
+
"type": ["string", "null"],
|
|
97
|
+
"format": "date-time",
|
|
98
|
+
"default": null
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"tasks": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": true,
|
|
105
|
+
"required": ["id_suffix_length_default", "verify", "doc", "comments"],
|
|
106
|
+
"default": {
|
|
107
|
+
"id_suffix_length_default": 6,
|
|
108
|
+
"verify": { "required_tags": ["code", "backend", "frontend"] },
|
|
109
|
+
"doc": {
|
|
110
|
+
"sections": [
|
|
111
|
+
"Summary",
|
|
112
|
+
"Context",
|
|
113
|
+
"Scope",
|
|
114
|
+
"Risks",
|
|
115
|
+
"Verify Steps",
|
|
116
|
+
"Verification",
|
|
117
|
+
"Rollback Plan",
|
|
118
|
+
"Notes"
|
|
119
|
+
],
|
|
120
|
+
"required_sections": [
|
|
121
|
+
"Summary",
|
|
122
|
+
"Scope",
|
|
123
|
+
"Risks",
|
|
124
|
+
"Verify Steps",
|
|
125
|
+
"Verification",
|
|
126
|
+
"Rollback Plan"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"comments": {
|
|
130
|
+
"start": { "prefix": "Start:", "min_chars": 40 },
|
|
131
|
+
"blocked": { "prefix": "Blocked:", "min_chars": 40 },
|
|
132
|
+
"verified": { "prefix": "Verified:", "min_chars": 60 }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"properties": {
|
|
136
|
+
"id_suffix_length_default": {
|
|
137
|
+
"type": "integer",
|
|
138
|
+
"minimum": 3,
|
|
139
|
+
"maximum": 16,
|
|
140
|
+
"default": 6
|
|
141
|
+
},
|
|
142
|
+
"verify": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"additionalProperties": true,
|
|
145
|
+
"required": ["required_tags"],
|
|
146
|
+
"default": { "required_tags": ["code", "backend", "frontend"] },
|
|
147
|
+
"properties": {
|
|
148
|
+
"required_tags": {
|
|
149
|
+
"type": "array",
|
|
150
|
+
"items": { "type": "string", "minLength": 1 },
|
|
151
|
+
"uniqueItems": true,
|
|
152
|
+
"default": ["code", "backend", "frontend"]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"doc": {
|
|
157
|
+
"type": "object",
|
|
158
|
+
"additionalProperties": true,
|
|
159
|
+
"required": ["sections", "required_sections"],
|
|
160
|
+
"default": {
|
|
161
|
+
"sections": [
|
|
162
|
+
"Summary",
|
|
163
|
+
"Context",
|
|
164
|
+
"Scope",
|
|
165
|
+
"Risks",
|
|
166
|
+
"Verify Steps",
|
|
167
|
+
"Verification",
|
|
168
|
+
"Rollback Plan",
|
|
169
|
+
"Notes"
|
|
170
|
+
],
|
|
171
|
+
"required_sections": [
|
|
172
|
+
"Summary",
|
|
173
|
+
"Scope",
|
|
174
|
+
"Risks",
|
|
175
|
+
"Verify Steps",
|
|
176
|
+
"Verification",
|
|
177
|
+
"Rollback Plan"
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"properties": {
|
|
181
|
+
"sections": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": { "type": "string", "minLength": 1 },
|
|
184
|
+
"default": [
|
|
185
|
+
"Summary",
|
|
186
|
+
"Context",
|
|
187
|
+
"Scope",
|
|
188
|
+
"Risks",
|
|
189
|
+
"Verify Steps",
|
|
190
|
+
"Verification",
|
|
191
|
+
"Rollback Plan",
|
|
192
|
+
"Notes"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"required_sections": {
|
|
196
|
+
"type": "array",
|
|
197
|
+
"items": { "type": "string", "minLength": 1 },
|
|
198
|
+
"default": [
|
|
199
|
+
"Summary",
|
|
200
|
+
"Scope",
|
|
201
|
+
"Risks",
|
|
202
|
+
"Verify Steps",
|
|
203
|
+
"Verification",
|
|
204
|
+
"Rollback Plan"
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"comments": {
|
|
210
|
+
"type": "object",
|
|
211
|
+
"additionalProperties": true,
|
|
212
|
+
"required": ["start", "blocked", "verified"],
|
|
213
|
+
"default": {
|
|
214
|
+
"start": { "prefix": "Start:", "min_chars": 40 },
|
|
215
|
+
"blocked": { "prefix": "Blocked:", "min_chars": 40 },
|
|
216
|
+
"verified": { "prefix": "Verified:", "min_chars": 60 }
|
|
217
|
+
},
|
|
218
|
+
"properties": {
|
|
219
|
+
"start": {
|
|
220
|
+
"$ref": "#/$defs/comment_policy",
|
|
221
|
+
"default": { "prefix": "Start:", "min_chars": 40 }
|
|
222
|
+
},
|
|
223
|
+
"blocked": {
|
|
224
|
+
"$ref": "#/$defs/comment_policy",
|
|
225
|
+
"default": { "prefix": "Blocked:", "min_chars": 40 }
|
|
226
|
+
},
|
|
227
|
+
"verified": {
|
|
228
|
+
"$ref": "#/$defs/comment_policy",
|
|
229
|
+
"default": { "prefix": "Verified:", "min_chars": 60 }
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"commit": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"additionalProperties": true,
|
|
238
|
+
"required": ["generic_tokens"],
|
|
239
|
+
"default": {
|
|
240
|
+
"generic_tokens": ["start", "status", "mark", "done", "wip", "update", "tasks", "task"]
|
|
241
|
+
},
|
|
242
|
+
"properties": {
|
|
243
|
+
"generic_tokens": {
|
|
244
|
+
"type": "array",
|
|
245
|
+
"items": { "type": "string", "minLength": 1 },
|
|
246
|
+
"uniqueItems": true,
|
|
247
|
+
"default": ["start", "status", "mark", "done", "wip", "update", "tasks", "task"]
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"tasks_backend": {
|
|
252
|
+
"type": "object",
|
|
253
|
+
"additionalProperties": true,
|
|
254
|
+
"required": ["config_path"],
|
|
255
|
+
"default": { "config_path": ".agentplane/backends/local/backend.json" },
|
|
256
|
+
"properties": {
|
|
257
|
+
"config_path": {
|
|
258
|
+
"type": "string",
|
|
259
|
+
"minLength": 1,
|
|
260
|
+
"default": ".agentplane/backends/local/backend.json"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"closure_commit_requires_approval": { "type": "boolean", "default": false }
|
|
265
|
+
},
|
|
266
|
+
"$defs": {
|
|
267
|
+
"comment_policy": {
|
|
268
|
+
"type": "object",
|
|
269
|
+
"additionalProperties": true,
|
|
270
|
+
"required": ["prefix", "min_chars"],
|
|
271
|
+
"properties": {
|
|
272
|
+
"prefix": { "type": "string", "minLength": 1 },
|
|
273
|
+
"min_chars": { "type": "integer", "minimum": 0 }
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|