agent-work-loop 0.0.0 → 0.6.23

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 (54) hide show
  1. package/README.md +272 -12
  2. package/dist/brief-Z3JKXEUP.js +181 -0
  3. package/dist/changelog-R7BNBF2C.js +62 -0
  4. package/dist/chunk-46HZN6UB.js +446 -0
  5. package/dist/chunk-4OCSYHYB.js +274 -0
  6. package/dist/chunk-6E7XEQOH.js +27 -0
  7. package/dist/chunk-7SYRDDTX.js +516 -0
  8. package/dist/chunk-BUWGQVHT.js +1243 -0
  9. package/dist/chunk-C7BR2DCS.js +96 -0
  10. package/dist/chunk-D5OINC3G.js +52 -0
  11. package/dist/chunk-DP4O5ME2.js +307 -0
  12. package/dist/chunk-F5LHXBH7.js +209 -0
  13. package/dist/chunk-G5LAJ5TV.js +453 -0
  14. package/dist/chunk-I77CXOEX.js +693 -0
  15. package/dist/chunk-IMB46O6S.js +286 -0
  16. package/dist/chunk-IXMAFR4Y.js +771 -0
  17. package/dist/chunk-QE2CLNBG.js +347 -0
  18. package/dist/chunk-UOPWVM2H.js +727 -0
  19. package/dist/chunk-YTAHVR4P.js +166 -0
  20. package/dist/chunk-ZE6HXOYG.js +904 -0
  21. package/dist/cli.js +374 -13
  22. package/dist/commit-APXIVOSD.js +411 -0
  23. package/dist/config-TFMW7O4T.js +34 -0
  24. package/dist/doctor-SSKNLPGH.js +29 -0
  25. package/dist/evolve-QPD7TWGO.js +38 -0
  26. package/dist/feedback-KAXNFMUY.js +125 -0
  27. package/dist/gotchas-MCA5Y76R.js +43 -0
  28. package/dist/hold-recheck-WN5EG7HD.js +133 -0
  29. package/dist/init-UDM5AXKI.js +79 -0
  30. package/dist/lane-DAZISODH.js +41 -0
  31. package/dist/loop-summary-XAI6KOGB.js +361 -0
  32. package/dist/metrics-WLRZZRTK.js +25 -0
  33. package/dist/record-UKDIUJ5T.js +68 -0
  34. package/dist/review-ZTHDJ47V.js +118 -0
  35. package/dist/rules-R2UZPIVW.js +33 -0
  36. package/dist/state-XM7NZ2HA.js +37 -0
  37. package/dist/status-L6U5KO6T.js +40 -0
  38. package/dist/uninstall-5DFEOFL5.js +545 -0
  39. package/dist/update-AYTBYAHI.js +61 -0
  40. package/dist/verify-L7ARTK42.js +37 -0
  41. package/dist/version-check-LKGU2DNF.js +14 -0
  42. package/dist/work-KEPTGZ6H.js +50 -0
  43. package/engine/skills/claude/awl-loop/SKILL.md +292 -0
  44. package/engine/skills/claude/awl-loop/reference.md +131 -0
  45. package/engine/skills/claude/awl-pipeline/SKILL.md +89 -0
  46. package/engine/skills/claude/awl-pipeline-exec/SKILL.md +200 -0
  47. package/engine/skills/claude/awl-pipeline-plan/SKILL.md +71 -0
  48. package/engine/skills/claude/awl-pipeline-review/SKILL.md +149 -0
  49. package/engine/skills/codex/AGENTS.awl.md +117 -0
  50. package/engine/templates/block-publish.mjs +9 -0
  51. package/engine/templates/pre-push.sample +7 -0
  52. package/engine/templates/related-cmd-examples.md +37 -0
  53. package/engine/version.json +2 -2
  54. package/package.json +10 -4
@@ -0,0 +1,166 @@
1
+ import {
2
+ npmVersionCachePath
3
+ } from "./chunk-7SYRDDTX.js";
4
+
5
+ // package.json
6
+ var name = "agent-work-loop";
7
+ var version = "0.6.23";
8
+
9
+ // src/core/npm-registry.ts
10
+ import fs from "fs";
11
+ import path from "path";
12
+ var REGISTRY_URL = "https://registry.npmjs.org";
13
+ var FETCH_TIMEOUT_MS = 2e3;
14
+ var DEFAULT_TTL_MS = 24 * 60 * 60 * 1e3;
15
+ async function fetchLatestVersion(packageName, fetchImpl = fetch) {
16
+ const controller = new AbortController();
17
+ const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
18
+ try {
19
+ const res = await fetchImpl(`${REGISTRY_URL}/${packageName}/latest`, {
20
+ signal: controller.signal
21
+ });
22
+ if (!res.ok) {
23
+ return null;
24
+ }
25
+ const body = await res.json();
26
+ if (body && typeof body === "object") {
27
+ const v = body.version;
28
+ if (typeof v === "string") {
29
+ return v;
30
+ }
31
+ }
32
+ return null;
33
+ } catch {
34
+ return null;
35
+ } finally {
36
+ clearTimeout(timer);
37
+ }
38
+ }
39
+ function readCache() {
40
+ try {
41
+ const raw = JSON.parse(fs.readFileSync(npmVersionCachePath(), "utf8"));
42
+ if (raw && typeof raw === "object") {
43
+ const checkedAt = raw.checkedAt;
44
+ const latestVersion = raw.latestVersion;
45
+ if (typeof checkedAt === "string" && (typeof latestVersion === "string" || latestVersion === null)) {
46
+ return { checkedAt, latestVersion };
47
+ }
48
+ }
49
+ } catch {
50
+ }
51
+ return null;
52
+ }
53
+ function writeCache(cache) {
54
+ const p = npmVersionCachePath();
55
+ const tmp = `${p}.${process.pid}.tmp`;
56
+ try {
57
+ fs.mkdirSync(path.dirname(p), { recursive: true });
58
+ fs.writeFileSync(tmp, JSON.stringify(cache));
59
+ fs.renameSync(tmp, p);
60
+ } catch {
61
+ try {
62
+ fs.unlinkSync(tmp);
63
+ } catch {
64
+ }
65
+ }
66
+ }
67
+ async function getLatestVersionCached(packageName, opts = {}) {
68
+ const now = opts.now ?? (() => Date.now());
69
+ const ttlMs = opts.ttlMs ?? DEFAULT_TTL_MS;
70
+ const cached = readCache();
71
+ if (cached && now() - new Date(cached.checkedAt).getTime() < ttlMs) {
72
+ return cached.latestVersion;
73
+ }
74
+ const latestVersion = await fetchLatestVersion(packageName, opts.fetchImpl ?? fetch);
75
+ writeCache({ checkedAt: new Date(now()).toISOString(), latestVersion });
76
+ return latestVersion;
77
+ }
78
+ function readCachedLatestVersion() {
79
+ return readCache()?.latestVersion ?? null;
80
+ }
81
+
82
+ // src/core/versions.ts
83
+ var UPDATE_HINT = "npm i -g agent-work-loop@latest \uB85C \uAC31\uC2E0\uD558\uC138\uC694.";
84
+ function parseSemver(version2) {
85
+ const m = /^(\d+)\.(\d+)\.(\d+)/.exec(version2);
86
+ if (!m) {
87
+ return null;
88
+ }
89
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
90
+ }
91
+ function isNewerSemver(a, b) {
92
+ if (a[0] !== b[0]) return a[0] > b[0];
93
+ if (a[1] !== b[1]) return a[1] > b[1];
94
+ if (a[2] !== b[2]) return a[2] > b[2];
95
+ return false;
96
+ }
97
+ function computeUpdateAvailable(current, npmLatestVersion) {
98
+ if (npmLatestVersion === null) {
99
+ return void 0;
100
+ }
101
+ const latestParsed = parseSemver(npmLatestVersion);
102
+ const currentParsed = parseSemver(current);
103
+ if (latestParsed === null || currentParsed === null) {
104
+ return void 0;
105
+ }
106
+ if (!isNewerSemver(latestParsed, currentParsed)) {
107
+ return void 0;
108
+ }
109
+ return { current, latest: npmLatestVersion, hint: UPDATE_HINT };
110
+ }
111
+ var SKILL_LABELS = {
112
+ claude: "Claude",
113
+ codex: "Codex"
114
+ };
115
+ function checkVersions(inputs) {
116
+ const mismatches = [];
117
+ if (inputs.engineSourceVersion !== null && inputs.engineSourceVersion !== inputs.packageVersion) {
118
+ mismatches.push({
119
+ kind: "build",
120
+ a: inputs.packageVersion,
121
+ b: inputs.engineSourceVersion,
122
+ hint: "package.json \uACFC engine/version.json \uBC84\uC804\uC774 \uB2E4\uB985\uB2C8\uB2E4 \u2014 \uC124\uCE58\uAC00 \uC190\uC0C1\uB410\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC7AC\uC124\uCE58\uD558\uC138\uC694."
123
+ });
124
+ }
125
+ if (inputs.installedEngineVersion !== null && inputs.installedEngineVersion !== inputs.packageVersion) {
126
+ mismatches.push({
127
+ kind: "binary-vs-engine",
128
+ a: inputs.packageVersion,
129
+ b: inputs.installedEngineVersion,
130
+ hint: "\uC124\uCE58\uB41C \uC5D4\uC9C4(~/.awl/engine)\uC774 \uC2E4\uD589 \uBC14\uC774\uB108\uB9AC\uC640 \uB2E4\uB985\uB2C8\uB2E4. awl update \uB85C \uC5D4\uC9C4\uC744 \uAC31\uC2E0\uD558\uC138\uC694."
131
+ });
132
+ }
133
+ if (inputs.projectEngineVersion !== null && inputs.installedEngineVersion !== null && inputs.projectEngineVersion !== inputs.installedEngineVersion) {
134
+ mismatches.push({
135
+ kind: "project-vs-engine",
136
+ a: inputs.projectEngineVersion,
137
+ b: inputs.installedEngineVersion,
138
+ hint: `\uC774 \uD504\uB85C\uC81D\uD2B8\uB294 ${inputs.projectEngineVersion} \uAE30\uC900\uC73C\uB85C \uC124\uC815\uB410\uC73C\uB098 \uC5D4\uC9C4\uC740 ${inputs.installedEngineVersion}\uC785\uB2C8\uB2E4. awl init --yes \uB85C \uD504\uB85C\uC81D\uD2B8\xB7\uC2A4\uD0AC \uBC84\uC804\uC744 \uC5D4\uC9C4\uC5D0 \uB9DE\uCDB0 \uB3D9\uAE30\uD654\uD558\uC138\uC694.`
139
+ });
140
+ }
141
+ for (const skill of ["claude", "codex"]) {
142
+ const skillVersion = inputs.installedSkillVersions[skill];
143
+ if (skillVersion !== null && inputs.installedEngineVersion !== null && skillVersion !== inputs.installedEngineVersion) {
144
+ mismatches.push({
145
+ kind: `${skill}-skill-vs-engine`,
146
+ a: skillVersion,
147
+ b: inputs.installedEngineVersion,
148
+ hint: `\uC124\uCE58\uB41C ${SKILL_LABELS[skill]} \uC2A4\uD0AC\uC774 ${skillVersion} \uAE30\uC900\uC785\uB2C8\uB2E4. \uC5D4\uC9C4\uC740 ${inputs.installedEngineVersion}\uC785\uB2C8\uB2E4. awl init --yes \uB85C \uC2A4\uD0AC\uC744 \uC7AC\uC124\uCE58\xB7\uB3D9\uAE30\uD654\uD558\uC138\uC694.`
149
+ });
150
+ }
151
+ }
152
+ return {
153
+ ok: mismatches.length === 0,
154
+ mismatches,
155
+ updateAvailable: computeUpdateAvailable(inputs.packageVersion, inputs.npmLatestVersion)
156
+ };
157
+ }
158
+
159
+ export {
160
+ name,
161
+ version,
162
+ getLatestVersionCached,
163
+ readCachedLatestVersion,
164
+ computeUpdateAvailable,
165
+ checkVersions
166
+ };