@aipper/aiws 0.0.29 → 0.0.31
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/bin/aiws.js +2 -2
- package/dist/aiws-package.d.ts +4 -0
- package/dist/aiws-package.js +11 -0
- package/dist/aiws-package.js.map +1 -0
- package/dist/aiws-paths.d.ts +48 -0
- package/dist/aiws-paths.js +129 -0
- package/dist/aiws-paths.js.map +1 -0
- package/dist/backup.d.ts +27 -0
- package/dist/backup.js +125 -0
- package/dist/backup.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +773 -0
- package/dist/cli.js.map +1 -0
- package/dist/codex-prompts.d.ts +17 -0
- package/dist/codex-prompts.js +49 -0
- package/dist/codex-prompts.js.map +1 -0
- package/dist/codex-skills.d.ts +17 -0
- package/dist/codex-skills.js +75 -0
- package/dist/codex-skills.js.map +1 -0
- package/dist/commands/change-advice.d.ts +25 -0
- package/dist/commands/change-advice.js +197 -0
- package/dist/commands/change-advice.js.map +1 -0
- package/dist/commands/change-evidence-command.d.ts +29 -0
- package/dist/commands/change-evidence-command.js +213 -0
- package/dist/commands/change-evidence-command.js.map +1 -0
- package/dist/commands/change-evidence-entry.d.ts +16 -0
- package/dist/commands/change-evidence-entry.js +35 -0
- package/dist/commands/change-evidence-entry.js.map +1 -0
- package/dist/commands/change-evidence.d.ts +108 -0
- package/dist/commands/change-evidence.js +341 -0
- package/dist/commands/change-evidence.js.map +1 -0
- package/dist/commands/change-finish.d.ts +71 -0
- package/dist/commands/change-finish.js +387 -0
- package/dist/commands/change-finish.js.map +1 -0
- package/dist/commands/change-git-status.d.ts +22 -0
- package/dist/commands/change-git-status.js +50 -0
- package/dist/commands/change-git-status.js.map +1 -0
- package/dist/commands/change-lifecycle-entry.d.ts +29 -0
- package/{src → dist}/commands/change-lifecycle-entry.js +21 -28
- package/dist/commands/change-lifecycle-entry.js.map +1 -0
- package/dist/commands/change-lifecycle.d.ts +56 -0
- package/dist/commands/change-lifecycle.js +211 -0
- package/dist/commands/change-lifecycle.js.map +1 -0
- package/dist/commands/change-metrics-command.d.ts +12 -0
- package/dist/commands/change-metrics-command.js +110 -0
- package/dist/commands/change-metrics-command.js.map +1 -0
- package/dist/commands/change-next-command.d.ts +18 -0
- package/dist/commands/change-next-command.js +138 -0
- package/dist/commands/change-next-command.js.map +1 -0
- package/dist/commands/change-review-gates.d.ts +107 -0
- package/dist/commands/change-review-gates.js +329 -0
- package/dist/commands/change-review-gates.js.map +1 -0
- package/dist/commands/change-scope-gate.d.ts +21 -0
- package/dist/commands/change-scope-gate.js +32 -0
- package/dist/commands/change-scope-gate.js.map +1 -0
- package/dist/commands/change-start.d.ts +30 -0
- package/dist/commands/change-start.js +91 -0
- package/dist/commands/change-start.js.map +1 -0
- package/dist/commands/change-state-command.d.ts +3 -0
- package/dist/commands/change-state-command.js +32 -0
- package/dist/commands/change-state-command.js.map +1 -0
- package/dist/commands/change-status-command.d.ts +13 -0
- package/dist/commands/change-status-command.js +126 -0
- package/dist/commands/change-status-command.js.map +1 -0
- package/dist/commands/change-status-context.d.ts +58 -0
- package/dist/commands/change-status-context.js +166 -0
- package/dist/commands/change-status-context.js.map +1 -0
- package/dist/commands/change-task-stats.d.ts +24 -0
- package/dist/commands/change-task-stats.js +66 -0
- package/dist/commands/change-task-stats.js.map +1 -0
- package/dist/commands/change-validate-entry.d.ts +17 -0
- package/dist/commands/change-validate-entry.js +44 -0
- package/dist/commands/change-validate-entry.js.map +1 -0
- package/dist/commands/change-validate.d.ts +32 -0
- package/dist/commands/change-validate.js +128 -0
- package/dist/commands/change-validate.js.map +1 -0
- package/dist/commands/change.d.ts +322 -0
- package/dist/commands/change.js +1731 -0
- package/dist/commands/change.js.map +1 -0
- package/dist/commands/codex-install-prompts.d.ts +4 -0
- package/dist/commands/codex-install-prompts.js +68 -0
- package/dist/commands/codex-install-prompts.js.map +1 -0
- package/dist/commands/codex-install-skills.d.ts +4 -0
- package/dist/commands/codex-install-skills.js +74 -0
- package/dist/commands/codex-install-skills.js.map +1 -0
- package/dist/commands/codex-status-prompts.d.ts +4 -0
- package/dist/commands/codex-status-prompts.js +44 -0
- package/dist/commands/codex-status-prompts.js.map +1 -0
- package/dist/commands/codex-status-skills.d.ts +4 -0
- package/dist/commands/codex-status-skills.js +54 -0
- package/dist/commands/codex-status-skills.js.map +1 -0
- package/dist/commands/codex-uninstall-prompts.d.ts +4 -0
- package/dist/commands/codex-uninstall-prompts.js +51 -0
- package/dist/commands/codex-uninstall-prompts.js.map +1 -0
- package/dist/commands/codex-uninstall-skills.d.ts +4 -0
- package/dist/commands/codex-uninstall-skills.js +59 -0
- package/dist/commands/codex-uninstall-skills.js.map +1 -0
- package/dist/commands/dashboard.d.ts +222 -0
- package/dist/commands/dashboard.js +193 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/hooks-install.d.ts +4 -0
- package/dist/commands/hooks-install.js +90 -0
- package/dist/commands/hooks-install.js.map +1 -0
- package/dist/commands/hooks-status.d.ts +4 -0
- package/dist/commands/hooks-status.js +89 -0
- package/dist/commands/hooks-status.js.map +1 -0
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.js +100 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/opencode-auto.d.ts +11 -0
- package/dist/commands/opencode-auto.js +158 -0
- package/dist/commands/opencode-auto.js.map +1 -0
- package/dist/commands/opencode-status.d.ts +4 -0
- package/dist/commands/opencode-status.js +75 -0
- package/dist/commands/opencode-status.js.map +1 -0
- package/dist/commands/opencode-supervise.d.ts +24 -0
- package/dist/commands/opencode-supervise.js +188 -0
- package/dist/commands/opencode-supervise.js.map +1 -0
- package/dist/commands/rollback.d.ts +4 -0
- package/dist/commands/rollback.js +12 -0
- package/dist/commands/rollback.js.map +1 -0
- package/dist/commands/update.d.ts +4 -0
- package/dist/commands/update.js +212 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/validate.d.ts +4 -0
- package/dist/commands/validate.js +222 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/ws-commit.d.ts +5 -0
- package/dist/commands/ws-commit.js +39 -0
- package/dist/commands/ws-commit.js.map +1 -0
- package/dist/commands/ws-deliver.d.ts +5 -0
- package/dist/commands/ws-deliver.js +59 -0
- package/dist/commands/ws-deliver.js.map +1 -0
- package/dist/commands/ws-finish.d.ts +5 -0
- package/dist/commands/ws-finish.js +142 -0
- package/dist/commands/ws-finish.js.map +1 -0
- package/dist/commands/ws-handoff.d.ts +5 -0
- package/dist/commands/ws-handoff.js +35 -0
- package/dist/commands/ws-handoff.js.map +1 -0
- package/dist/commands/ws-migrate.d.ts +5 -0
- package/dist/commands/ws-migrate.js +41 -0
- package/dist/commands/ws-migrate.js.map +1 -0
- package/dist/commands/ws-plan-verify.d.ts +5 -0
- package/dist/commands/ws-plan-verify.js +38 -0
- package/dist/commands/ws-plan-verify.js.map +1 -0
- package/dist/commands/ws-pull.d.ts +5 -0
- package/dist/commands/ws-pull.js +26 -0
- package/dist/commands/ws-pull.js.map +1 -0
- package/dist/commands/ws-push.d.ts +5 -0
- package/dist/commands/ws-push.js +68 -0
- package/dist/commands/ws-push.js.map +1 -0
- package/dist/commands/ws-submodule-setup.d.ts +5 -0
- package/dist/commands/ws-submodule-setup.js +55 -0
- package/dist/commands/ws-submodule-setup.js.map +1 -0
- package/dist/commands/ws-verify-before-complete.d.ts +5 -0
- package/dist/commands/ws-verify-before-complete.js +35 -0
- package/dist/commands/ws-verify-before-complete.js.map +1 -0
- package/dist/dashboard/app.d.ts +1 -0
- package/dist/dashboard/app.js +370 -0
- package/dist/dashboard/app.js.map +1 -0
- package/dist/delegation/cli.d.ts +6 -0
- package/dist/delegation/cli.js +14 -0
- package/dist/delegation/cli.js.map +1 -0
- package/dist/delegation/index.d.ts +35 -0
- package/dist/delegation/index.js +118 -0
- package/dist/delegation/index.js.map +1 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -0
- package/dist/exec.d.ts +9 -0
- package/dist/exec.js +22 -0
- package/dist/exec.js.map +1 -0
- package/dist/fs.d.ts +9 -0
- package/dist/fs.js +62 -0
- package/dist/fs.js.map +1 -0
- package/dist/governance.d.ts +10 -0
- package/dist/governance.js +135 -0
- package/dist/governance.js.map +1 -0
- package/dist/hash.d.ts +3 -0
- package/dist/hash.js +13 -0
- package/dist/hash.js.map +1 -0
- package/dist/hooks/deploy-claude.d.ts +13 -0
- package/dist/hooks/deploy-claude.js +67 -0
- package/dist/hooks/deploy-claude.js.map +1 -0
- package/dist/journal.d.ts +22 -0
- package/dist/journal.js +112 -0
- package/dist/journal.js.map +1 -0
- package/dist/json-schema-lite.d.ts +22 -0
- package/dist/json-schema-lite.js +148 -0
- package/dist/json-schema-lite.js.map +1 -0
- package/dist/managed-blocks.d.ts +24 -0
- package/dist/managed-blocks.js +84 -0
- package/dist/managed-blocks.js.map +1 -0
- package/dist/manifest.d.ts +24 -0
- package/dist/manifest.js +145 -0
- package/dist/manifest.js.map +1 -0
- package/dist/opencode-env.d.ts +62 -0
- package/dist/opencode-env.js +178 -0
- package/dist/opencode-env.js.map +1 -0
- package/dist/path-utils.d.ts +2 -0
- package/dist/path-utils.js +8 -0
- package/dist/path-utils.js.map +1 -0
- package/dist/spec.d.ts +17 -0
- package/dist/spec.js +174 -0
- package/dist/spec.js.map +1 -0
- package/dist/template.d.ts +20 -0
- package/dist/template.js +123 -0
- package/dist/template.js.map +1 -0
- package/dist/workspace.d.ts +4 -0
- package/dist/workspace.js +19 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +11 -3
- package/src/aiws-package.js +0 -15
- package/src/backup.js +0 -149
- package/src/cli.js +0 -760
- package/src/codex-prompts.js +0 -74
- package/src/codex-skills.js +0 -111
- package/src/commands/change-advice.js +0 -181
- package/src/commands/change-evidence-command.js +0 -242
- package/src/commands/change-evidence-entry.js +0 -40
- package/src/commands/change-evidence.js +0 -340
- package/src/commands/change-finish.js +0 -413
- package/src/commands/change-git-status.js +0 -53
- package/src/commands/change-lifecycle.js +0 -236
- package/src/commands/change-metrics-command.js +0 -110
- package/src/commands/change-next-command.js +0 -133
- package/src/commands/change-review-gates.js +0 -331
- package/src/commands/change-scope-gate.js +0 -34
- package/src/commands/change-start.js +0 -85
- package/src/commands/change-state-command.js +0 -40
- package/src/commands/change-status-command.js +0 -125
- package/src/commands/change-status-context.js +0 -173
- package/src/commands/change-task-stats.js +0 -64
- package/src/commands/change-validate-entry.js +0 -45
- package/src/commands/change-validate.js +0 -127
- package/src/commands/change.js +0 -1829
- package/src/commands/codex-install-prompts.js +0 -68
- package/src/commands/codex-install-skills.js +0 -74
- package/src/commands/codex-status-prompts.js +0 -55
- package/src/commands/codex-status-skills.js +0 -63
- package/src/commands/codex-uninstall-prompts.js +0 -55
- package/src/commands/codex-uninstall-skills.js +0 -62
- package/src/commands/dashboard.js +0 -205
- package/src/commands/hooks-install.js +0 -92
- package/src/commands/hooks-status.js +0 -95
- package/src/commands/init.js +0 -101
- package/src/commands/opencode-auto.js +0 -167
- package/src/commands/opencode-status.js +0 -103
- package/src/commands/opencode-supervise.js +0 -200
- package/src/commands/rollback.js +0 -13
- package/src/commands/update.js +0 -145
- package/src/commands/validate.js +0 -228
- package/src/commands/ws-commit.js +0 -44
- package/src/commands/ws-deliver.js +0 -67
- package/src/commands/ws-finish.js +0 -83
- package/src/commands/ws-handoff.js +0 -40
- package/src/commands/ws-migrate.js +0 -41
- package/src/commands/ws-plan-verify.js +0 -44
- package/src/commands/ws-pull.js +0 -30
- package/src/commands/ws-push.js +0 -71
- package/src/commands/ws-submodule-setup.js +0 -65
- package/src/commands/ws-verify-before-complete.js +0 -39
- package/src/dashboard/app.js +0 -371
- package/src/errors.js +0 -15
- package/src/exec.js +0 -34
- package/src/fs.js +0 -91
- package/src/governance.js +0 -159
- package/src/hash.js +0 -25
- package/src/json-schema-lite.js +0 -164
- package/src/managed-blocks.js +0 -131
- package/src/manifest.js +0 -177
- package/src/opencode-env.js +0 -208
- package/src/path-utils.js +0 -20
- package/src/spec.js +0 -195
- package/src/template.js +0 -187
- package/src/workspace.js +0 -23
- /package/{src → dist}/dashboard/index.html +0 -0
- /package/{src → dist}/dashboard/style.css +0 -0
package/src/aiws-package.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { readText } from "./fs.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @returns {Promise<{ rootDir: string, version: string }>}
|
|
7
|
-
*/
|
|
8
|
-
export async function loadAiwsPackage() {
|
|
9
|
-
const here = fileURLToPath(import.meta.url);
|
|
10
|
-
const rootDir = path.resolve(path.dirname(here), "..");
|
|
11
|
-
const pkg = JSON.parse(await readText(path.join(rootDir, "package.json")));
|
|
12
|
-
const version = String(pkg.version || "").trim() || "0.0.0";
|
|
13
|
-
return { rootDir, version };
|
|
14
|
-
}
|
|
15
|
-
|
package/src/backup.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { ensureDir, pathExists } from "./fs.js";
|
|
4
|
-
import { joinRel, normalizeRel } from "./path-utils.js";
|
|
5
|
-
import { UserError } from "./errors.js";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @param {Date} d
|
|
9
|
-
*/
|
|
10
|
-
export function formatBackupTimestamp(d) {
|
|
11
|
-
return d.toISOString().replace(/\.\d{3}Z$/, "Z").replaceAll(":", "-");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export class BackupSession {
|
|
15
|
-
/**
|
|
16
|
-
* @param {{ workspaceRoot: string, operation: "init" | "update" }} options
|
|
17
|
-
*/
|
|
18
|
-
constructor(options) {
|
|
19
|
-
this.workspaceRoot = options.workspaceRoot;
|
|
20
|
-
this.operation = options.operation;
|
|
21
|
-
this.timestamp = formatBackupTimestamp(new Date());
|
|
22
|
-
this.backupRoot = path.join(this.workspaceRoot, ".aiws", "backups", this.timestamp);
|
|
23
|
-
/** @type {Map<string, { existed: boolean, mode: number | null }>} */
|
|
24
|
-
this.files = new Map();
|
|
25
|
-
this._prepared = false;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async _prepare() {
|
|
29
|
-
if (this._prepared) return;
|
|
30
|
-
await ensureDir(this.backupRoot);
|
|
31
|
-
this._prepared = true;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Record a file before modification.
|
|
36
|
-
*
|
|
37
|
-
* For update: record both existing and missing files (for rollback deletions).
|
|
38
|
-
* For init: typically record only existing files that will be modified.
|
|
39
|
-
*
|
|
40
|
-
* @param {string} relPosix
|
|
41
|
-
* @param {{ recordMissing?: boolean }=} options
|
|
42
|
-
*/
|
|
43
|
-
async recordFile(relPosix, options) {
|
|
44
|
-
const rel = normalizeRel(relPosix);
|
|
45
|
-
if (this.files.has(rel)) return;
|
|
46
|
-
|
|
47
|
-
const abs = joinRel(this.workspaceRoot, rel);
|
|
48
|
-
const exists = await pathExists(abs);
|
|
49
|
-
if (!exists) {
|
|
50
|
-
if (options?.recordMissing) {
|
|
51
|
-
this.files.set(rel, { existed: false, mode: null });
|
|
52
|
-
}
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const st = await fs.stat(abs);
|
|
57
|
-
if (!st.isFile()) {
|
|
58
|
-
if (options?.recordMissing) this.files.set(rel, { existed: false, mode: null });
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
await this._prepare();
|
|
63
|
-
const dest = joinRel(this.backupRoot, rel);
|
|
64
|
-
await ensureDir(path.dirname(dest));
|
|
65
|
-
await fs.copyFile(abs, dest);
|
|
66
|
-
try {
|
|
67
|
-
await fs.chmod(dest, st.mode & 0o777);
|
|
68
|
-
} catch {
|
|
69
|
-
// ignore chmod errors
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
this.files.set(rel, { existed: true, mode: st.mode & 0o777 });
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @param {{ extra?: any }=} options
|
|
77
|
-
*/
|
|
78
|
-
async finalize(options) {
|
|
79
|
-
if (!this._prepared && this.files.size === 0) return null;
|
|
80
|
-
await this._prepare();
|
|
81
|
-
const meta = {
|
|
82
|
-
operation: this.operation,
|
|
83
|
-
timestamp: this.timestamp,
|
|
84
|
-
created_at: new Date().toISOString(),
|
|
85
|
-
files: Array.from(this.files.entries()).map(([p, v]) => ({ path: p, existed: v.existed, mode: v.mode })),
|
|
86
|
-
extra: options?.extra ?? null,
|
|
87
|
-
};
|
|
88
|
-
await fs.writeFile(path.join(this.backupRoot, "backup.json"), JSON.stringify(meta, null, 2) + "\n", "utf8");
|
|
89
|
-
return this.backupRoot;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @param {string} workspaceRoot
|
|
95
|
-
* @param {string} stamp
|
|
96
|
-
* @returns {Promise<string>} backup root dir
|
|
97
|
-
*/
|
|
98
|
-
export async function resolveBackupRoot(workspaceRoot, stamp) {
|
|
99
|
-
const backupsRoot = path.join(workspaceRoot, ".aiws", "backups");
|
|
100
|
-
if (stamp === "latest") {
|
|
101
|
-
if (!(await pathExists(backupsRoot))) throw new UserError("No backups found.");
|
|
102
|
-
const entries = await fs.readdir(backupsRoot, { withFileTypes: true });
|
|
103
|
-
const dirs = entries.filter((e) => e.isDirectory()).map((e) => e.name).sort();
|
|
104
|
-
const latest = dirs[dirs.length - 1];
|
|
105
|
-
if (!latest) throw new UserError("No backups found.");
|
|
106
|
-
return path.join(backupsRoot, latest);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const target = path.join(backupsRoot, stamp);
|
|
110
|
-
if (!(await pathExists(target))) {
|
|
111
|
-
throw new UserError(`Backup not found: ${stamp}`, { details: `Missing: ${target}` });
|
|
112
|
-
}
|
|
113
|
-
return target;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @param {string} workspaceRoot
|
|
118
|
-
* @param {string} backupRoot
|
|
119
|
-
*/
|
|
120
|
-
export async function rollbackFromBackup(workspaceRoot, backupRoot) {
|
|
121
|
-
const metaPath = path.join(backupRoot, "backup.json");
|
|
122
|
-
if (!(await pathExists(metaPath))) {
|
|
123
|
-
throw new UserError("backup.json not found; cannot rollback safely.", { details: `Missing: ${metaPath}` });
|
|
124
|
-
}
|
|
125
|
-
const meta = JSON.parse(await fs.readFile(metaPath, "utf8"));
|
|
126
|
-
const files = Array.isArray(meta.files) ? meta.files : [];
|
|
127
|
-
for (const f of files) {
|
|
128
|
-
const rel = normalizeRel(String(f.path || ""));
|
|
129
|
-
if (!rel) continue;
|
|
130
|
-
const dest = joinRel(workspaceRoot, rel);
|
|
131
|
-
if (f.existed) {
|
|
132
|
-
const src = joinRel(backupRoot, rel);
|
|
133
|
-
await ensureDir(path.dirname(dest));
|
|
134
|
-
await fs.copyFile(src, dest);
|
|
135
|
-
if (typeof f.mode === "number") {
|
|
136
|
-
try {
|
|
137
|
-
await fs.chmod(dest, f.mode);
|
|
138
|
-
} catch {
|
|
139
|
-
// ignore chmod errors
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
} else {
|
|
143
|
-
if (await pathExists(dest)) {
|
|
144
|
-
await fs.rm(dest, { force: true });
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|