@fitlab-ai/agent-infra 0.9.6 → 0.9.8
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/bin/internal-cli.js +10 -0
- package/dist/lib/agent-clients/adapters/claude-code.js +3 -3
- package/dist/lib/agent-clients/adapters/codex-lifecycle/app-server.js +47 -5
- package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +162 -0
- package/dist/lib/agent-clients/adapters/codex-lifecycle/capability-store.js +245 -0
- package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +398 -0
- package/dist/lib/agent-clients/adapters/codex-lifecycle/store.js +23 -6
- package/dist/lib/decide.js +68 -14
- package/dist/lib/defaults.json +10 -2
- package/dist/lib/git/workflow.js +30 -3
- package/dist/lib/init.js +1 -1
- package/dist/lib/internal/codex-lifecycle.js +69 -1
- package/dist/lib/internal/codex-sandbox-controller.js +106 -0
- package/dist/lib/internal/release-workflow.js +1 -3
- package/dist/lib/internal/task-activity.js +57 -7
- package/dist/lib/internal/task-event.js +57 -4
- package/dist/lib/internal/task-ledger.js +59 -5
- package/dist/lib/internal/task-lifecycle.js +59 -8
- package/dist/lib/internal/task-orchestration.js +48 -8
- package/dist/lib/internal/task-override.js +131 -0
- package/dist/lib/internal/task-review.js +64 -6
- package/dist/lib/internal/task-verify.js +65 -3
- package/dist/lib/internal/task-warning.js +57 -4
- package/dist/lib/platform/context.js +6 -4
- package/dist/lib/platform/github-client.js +55 -2
- package/dist/lib/platform/pr-summary.js +5 -3
- package/dist/lib/process-data/checkpoint.js +319 -0
- package/dist/lib/process-data/index.js +128 -60
- package/dist/lib/process-data/materialize.js +84 -0
- package/dist/lib/process-data/normalize.js +34 -1
- package/dist/lib/process-data/reconcile.js +55 -1
- package/dist/lib/process-data/sources.js +422 -1
- package/dist/lib/process-data/store.js +341 -11
- package/dist/lib/runtime/agent-runtime.js +56 -0
- package/dist/lib/sandbox/commands/create.js +394 -264
- package/dist/lib/sandbox/commands/rm.js +64 -15
- package/dist/lib/sandbox/commands/start.js +4 -3
- package/dist/lib/sandbox/control/container-identity.js +64 -0
- package/dist/lib/sandbox/control/executor.js +23 -9
- package/dist/lib/sandbox/control/lifecycle.js +590 -61
- package/dist/lib/sandbox/control/protocol.js +7 -0
- package/dist/lib/sandbox/control/server.js +202 -26
- package/dist/lib/sandbox/control/state.js +51 -25
- package/dist/lib/sandbox/control/timing.js +8 -0
- package/dist/lib/sandbox/engine.js +14 -7
- package/dist/lib/sandbox/mounts.js +7 -0
- package/dist/lib/sandbox/recovery.js +135 -50
- package/dist/lib/sandbox/workspace-view.js +59 -20
- package/dist/lib/server/daemon.js +1 -1
- package/dist/lib/server/process-control.js +11 -1
- package/dist/lib/server/process-state.js +107 -20
- package/dist/lib/task/activity-intent.js +4 -1
- package/dist/lib/task/artifact-lifecycle.js +82 -11
- package/dist/lib/task/artifact-receipts.js +128 -0
- package/dist/lib/task/codex-orchestration.js +81 -6
- package/dist/lib/task/commands/validate.js +1 -1
- package/dist/lib/task/create.js +10 -2
- package/dist/lib/task/decision-intents.js +4 -2
- package/dist/lib/task/delegation-receipts.js +120 -17
- package/dist/lib/task/events.js +148 -7
- package/dist/lib/task/guard-override.js +31 -0
- package/dist/lib/task/human-override.js +1240 -0
- package/dist/lib/task/ledger-intents.js +6 -3
- package/dist/lib/task/ledger.js +13 -1
- package/dist/lib/task/lifecycle.js +69 -14
- package/dist/lib/task/orchestration.js +293 -18
- package/dist/lib/task/review-finalization.js +3 -2
- package/dist/lib/task/sections.js +5 -1
- package/dist/lib/task/task-execution-lock.js +5 -4
- package/dist/lib/task/verification-engine.js +80 -22
- package/dist/lib/task/verification.js +13 -1
- package/dist/lib/task/workflow-warning-intents.js +4 -2
- package/dist/lib/task/write.js +2 -1
- package/dist/lifecycle-build-manifest.json +6 -0
- package/lib/agent-clients/adapters/claude-code.ts +3 -3
- package/lib/agent-clients/adapters/codex-lifecycle/app-server.ts +62 -4
- package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +227 -0
- package/lib/agent-clients/adapters/codex-lifecycle/capability-store.ts +322 -0
- package/lib/agent-clients/adapters/codex-lifecycle/manifest-files.json +26 -0
- package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +480 -0
- package/lib/agent-clients/adapters/codex-lifecycle/store.ts +35 -5
- package/lib/decide.ts +59 -14
- package/lib/defaults.json +10 -2
- package/lib/git/workflow.ts +25 -2
- package/lib/init.ts +1 -1
- package/lib/internal/codex-lifecycle.ts +68 -1
- package/lib/internal/codex-sandbox-controller.ts +109 -0
- package/lib/internal/release-workflow.ts +1 -3
- package/lib/internal/task-activity.ts +46 -6
- package/lib/internal/task-event.ts +53 -4
- package/lib/internal/task-ledger.ts +48 -4
- package/lib/internal/task-lifecycle.ts +56 -12
- package/lib/internal/task-orchestration.ts +43 -8
- package/lib/internal/task-override.ts +138 -0
- package/lib/internal/task-review.ts +51 -6
- package/lib/internal/task-verify.ts +52 -3
- package/lib/internal/task-warning.ts +44 -3
- package/lib/platform/context.ts +8 -5
- package/lib/platform/github-client.ts +61 -3
- package/lib/platform/pr-summary.ts +10 -3
- package/lib/process-data/checkpoint.ts +335 -0
- package/lib/process-data/index.ts +112 -60
- package/lib/process-data/materialize.ts +83 -0
- package/lib/process-data/normalize.ts +29 -1
- package/lib/process-data/reconcile.ts +64 -2
- package/lib/process-data/sources.ts +449 -2
- package/lib/process-data/store.ts +304 -11
- package/lib/process-data/types.ts +124 -2
- package/lib/runtime/agent-runtime.ts +76 -0
- package/lib/sandbox/commands/create.ts +139 -6
- package/lib/sandbox/commands/rm.ts +64 -14
- package/lib/sandbox/commands/start.ts +4 -3
- package/lib/sandbox/config.ts +2 -1
- package/lib/sandbox/control/container-identity.ts +93 -0
- package/lib/sandbox/control/executor.ts +24 -12
- package/lib/sandbox/control/lifecycle.ts +685 -67
- package/lib/sandbox/control/protocol.ts +35 -6
- package/lib/sandbox/control/server.ts +184 -24
- package/lib/sandbox/control/state.ts +67 -33
- package/lib/sandbox/control/timing.ts +12 -0
- package/lib/sandbox/engine.ts +20 -9
- package/lib/sandbox/mounts.ts +8 -0
- package/lib/sandbox/recovery.ts +159 -49
- package/lib/sandbox/workspace-view.ts +73 -22
- package/lib/server/daemon.ts +1 -1
- package/lib/server/process-control.ts +13 -3
- package/lib/server/process-state.ts +129 -27
- package/lib/task/activity-intent.ts +4 -2
- package/lib/task/artifact-lifecycle.ts +73 -10
- package/lib/task/artifact-receipts.ts +161 -0
- package/lib/task/codex-orchestration.ts +91 -5
- package/lib/task/commands/validate.ts +1 -1
- package/lib/task/create.ts +11 -2
- package/lib/task/decision-intents.ts +4 -2
- package/lib/task/delegation-receipts.ts +205 -25
- package/lib/task/events.ts +132 -6
- package/lib/task/guard-override.ts +50 -0
- package/lib/task/human-override.ts +1503 -0
- package/lib/task/ledger-intents.ts +6 -3
- package/lib/task/ledger.ts +16 -1
- package/lib/task/lifecycle.ts +71 -14
- package/lib/task/orchestration.ts +443 -22
- package/lib/task/review-finalization.ts +6 -2
- package/lib/task/sections.ts +6 -2
- package/lib/task/task-execution-lock.ts +11 -9
- package/lib/task/verification-engine.ts +93 -32
- package/lib/task/verification.ts +15 -1
- package/lib/task/workflow-warning-intents.ts +4 -2
- package/lib/task/write.ts +4 -1
- package/package.json +1 -1
- package/templates/.agents/README.en.md +7 -0
- package/templates/.agents/README.zh-CN.md +5 -0
- package/templates/.agents/hooks/lifecycle-delegation.js +33 -4
- package/templates/.agents/rules/lifecycle-orchestration.en.md +10 -3
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +10 -3
- package/templates/.agents/rules/pr-checks-commands.github.en.md +1 -1
- package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +1 -1
- package/templates/.agents/rules/review-handshake.en.md +3 -1
- package/templates/.agents/rules/review-handshake.zh-CN.md +3 -1
- package/templates/.agents/skills/code-task/reference/dual-mode.en.md +3 -1
- package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +3 -1
- package/templates/.agents/skills/complete-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +4 -0
- package/templates/.agents/skills/run-manual-validation/SKILL.en.md +6 -6
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +6 -6
- package/templates/.agents/skills/run-manual-validation/config/verify.en.json +14 -3
- package/templates/.agents/skills/run-manual-validation/config/verify.zh-CN.json +14 -3
- package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +67 -0
- package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +67 -0
- package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +25 -0
- package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +25 -0
- package/templates/.agents/skills/run-task/SKILL.en.md +9 -7
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +9 -7
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +5 -1
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +5 -1
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +75 -3
- package/templates/.agents/workspace/README.en.md +0 -26
- package/templates/.agents/workspace/README.zh-CN.md +0 -26
|
@@ -82,7 +82,6 @@ const DEFAULTS = {
|
|
|
82
82
|
".agents/skills/",
|
|
83
83
|
".agents/templates/",
|
|
84
84
|
".agents/workflows/",
|
|
85
|
-
".agents/workspace/README.md",
|
|
86
85
|
".git-hooks/check-large-files.cjs",
|
|
87
86
|
".git-hooks/check-version-format.sh",
|
|
88
87
|
".github/scripts/",
|
|
@@ -110,7 +109,16 @@ const DEFAULTS = {
|
|
|
110
109
|
".git-hooks/pre-commit",
|
|
111
110
|
".gitignore"
|
|
112
111
|
],
|
|
113
|
-
"ejected": []
|
|
112
|
+
"ejected": [],
|
|
113
|
+
"retiredManaged": [
|
|
114
|
+
{
|
|
115
|
+
"path": ".agents/workspace/README.md",
|
|
116
|
+
"templateHashes": [
|
|
117
|
+
"sha256:967b27ca4008154c5abf99a1df728242f80ed3ace9bd98eb2828bc1c76af826c",
|
|
118
|
+
"sha256:15aa21942cf2a1396d27834f1d3d723b61a46f8d14600b706f39f3bebc21aea3"
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
]
|
|
114
122
|
}
|
|
115
123
|
};
|
|
116
124
|
|
|
@@ -1224,6 +1232,26 @@ function entryVariantRels(entry, allSet, platform) {
|
|
|
1224
1232
|
return rels;
|
|
1225
1233
|
}
|
|
1226
1234
|
|
|
1235
|
+
function ensureRuntimeWorkspace(projectRoot) {
|
|
1236
|
+
const directories = [
|
|
1237
|
+
path.join(projectRoot, '.agents'),
|
|
1238
|
+
path.join(projectRoot, '.agents', 'workspace'),
|
|
1239
|
+
...['active', 'blocked', 'completed', 'archive'].map((state) =>
|
|
1240
|
+
path.join(projectRoot, '.agents', 'workspace', state)
|
|
1241
|
+
)
|
|
1242
|
+
];
|
|
1243
|
+
for (const directory of directories) {
|
|
1244
|
+
if (fs.existsSync(directory)) {
|
|
1245
|
+
const stat = fs.lstatSync(directory);
|
|
1246
|
+
if (!stat.isDirectory() || stat.isSymbolicLink()) {
|
|
1247
|
+
throw new Error(`Runtime workspace path must be a real directory: ${directory}`);
|
|
1248
|
+
}
|
|
1249
|
+
continue;
|
|
1250
|
+
}
|
|
1251
|
+
fs.mkdirSync(directory, { mode: 0o700 });
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1227
1255
|
function syncTemplates(projectRoot, templateRootOverride) {
|
|
1228
1256
|
const configDir = path.join(projectRoot, '.agents');
|
|
1229
1257
|
const cfgPath = path.join(configDir, '.airc.json');
|
|
@@ -1234,6 +1262,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1234
1262
|
|
|
1235
1263
|
const originalConfigText = fs.readFileSync(cfgPath, 'utf8');
|
|
1236
1264
|
const cfg = JSON.parse(originalConfigText);
|
|
1265
|
+
ensureRuntimeWorkspace(projectRoot);
|
|
1237
1266
|
const configPathRel = norm(path.relative(projectRoot, cfgPath));
|
|
1238
1267
|
let templateRoot = templateRootOverride;
|
|
1239
1268
|
if (!templateRoot) {
|
|
@@ -1271,6 +1300,16 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1271
1300
|
merged: [...(cfg.files.merged || [])],
|
|
1272
1301
|
ejected: [...(cfg.files.ejected || [])]
|
|
1273
1302
|
};
|
|
1303
|
+
const retiredManaged = new Map((DEFAULTS.files.retiredManaged || []).map((retired) => {
|
|
1304
|
+
const descriptor = typeof retired === 'string' ? { path: retired } : retired;
|
|
1305
|
+
return [norm(descriptor.path), new Set(
|
|
1306
|
+
(descriptor.templateHashes || []).map(trustedBaseline).filter(Boolean)
|
|
1307
|
+
)];
|
|
1308
|
+
}));
|
|
1309
|
+
const planningRegistry = {
|
|
1310
|
+
...currentRegistry,
|
|
1311
|
+
managed: currentRegistry.managed.filter((entry) => !retiredManaged.has(norm(entry)))
|
|
1312
|
+
};
|
|
1274
1313
|
const sharedDefaults = {
|
|
1275
1314
|
managed: (DEFAULTS.files.managed || []).filter(
|
|
1276
1315
|
(entry) => !isPathOwnedByOtherPlatform(entry, platformType)
|
|
@@ -1280,7 +1319,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1280
1319
|
),
|
|
1281
1320
|
ejected: [...(DEFAULTS.files.ejected || [])]
|
|
1282
1321
|
};
|
|
1283
|
-
const assetPlan = planProjectRegistry(
|
|
1322
|
+
const assetPlan = planProjectRegistry(planningRegistry, sharedDefaults, enabledTUIs);
|
|
1284
1323
|
const managed = [...assetPlan.registry.managed];
|
|
1285
1324
|
const merged = [...assetPlan.registry.merged];
|
|
1286
1325
|
const ejected = [...assetPlan.registry.ejected];
|
|
@@ -1295,6 +1334,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1295
1334
|
for (const target of Object.keys(managedBaselines)) {
|
|
1296
1335
|
if (
|
|
1297
1336
|
!guardedManaged.has(norm(target))
|
|
1337
|
+
&& !retiredManaged.has(norm(target))
|
|
1298
1338
|
&& !allClientManaged.some((entry) => assetMatches(entry, target))
|
|
1299
1339
|
) {
|
|
1300
1340
|
delete managedBaselines[target];
|
|
@@ -1369,6 +1409,38 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1369
1409
|
)
|
|
1370
1410
|
);
|
|
1371
1411
|
|
|
1412
|
+
for (const [entry, historicalTemplateHashes] of retiredManaged) {
|
|
1413
|
+
const target = path.join(projectRoot, entry);
|
|
1414
|
+
const owned = currentRegistry.managed.some((candidate) => norm(candidate) === entry);
|
|
1415
|
+
if (!fs.existsSync(target)) continue;
|
|
1416
|
+
const stat = fs.lstatSync(target);
|
|
1417
|
+
const baseline = trustedBaseline(managedBaselines[entry]);
|
|
1418
|
+
const localHash = stat.isFile() && !stat.isSymbolicLink()
|
|
1419
|
+
? sha256(fs.readFileSync(target))
|
|
1420
|
+
: null;
|
|
1421
|
+
const safeToRemove = owned
|
|
1422
|
+
&& localHash !== null
|
|
1423
|
+
&& (localHash === baseline || historicalTemplateHashes.has(localHash));
|
|
1424
|
+
if (safeToRemove) {
|
|
1425
|
+
fs.unlinkSync(target);
|
|
1426
|
+
report.managed.removed.push(entry);
|
|
1427
|
+
if (Object.prototype.hasOwnProperty.call(managedBaselines, entry)) {
|
|
1428
|
+
delete managedBaselines[entry];
|
|
1429
|
+
baselinesChanged = true;
|
|
1430
|
+
}
|
|
1431
|
+
} else {
|
|
1432
|
+
report.managed.protected.push({
|
|
1433
|
+
target: entry,
|
|
1434
|
+
reason: owned && localHash !== null && baseline !== null
|
|
1435
|
+
? 'user-modified'
|
|
1436
|
+
: (owned && localHash === null ? 'invalid-type' : 'unknown-origin'),
|
|
1437
|
+
baseline,
|
|
1438
|
+
local: localHash,
|
|
1439
|
+
template: null
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1372
1444
|
const templateSources = Array.isArray(cfg.templates?.sources) ? cfg.templates.sources : [];
|
|
1373
1445
|
report.templateSources.configured = templateSources.length;
|
|
1374
1446
|
const { mergedRels, sourceMap } = mergeTemplateSources(templateRoot, templateSources, report);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# AI Workspace
|
|
2
|
-
|
|
3
|
-
This directory is the runtime workspace for multi-AI collaboration. All contents are **git-ignored** except for this README and `.gitkeep` files.
|
|
4
|
-
|
|
5
|
-
## Directory Structure
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
.agents/workspace/
|
|
9
|
-
active/ # Currently active tasks and handoff documents
|
|
10
|
-
blocked/ # Tasks that are blocked and waiting for resolution
|
|
11
|
-
completed/ # Completed tasks (kept for reference)
|
|
12
|
-
logs/ # Collaboration logs and session records
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
- **active/**: Place task files here when work begins. Move them to `completed/` or `blocked/` as appropriate.
|
|
18
|
-
- **blocked/**: Move tasks here when they cannot proceed. Document the blocker in the task file.
|
|
19
|
-
- **completed/**: Move tasks here when they are done. These serve as a historical record.
|
|
20
|
-
- **logs/**: Store session logs, AI conversation exports, or collaboration notes.
|
|
21
|
-
|
|
22
|
-
## Important
|
|
23
|
-
|
|
24
|
-
- Contents of this directory are **not version-controlled** (git-ignored).
|
|
25
|
-
- Do not store anything here that needs to be shared via git.
|
|
26
|
-
- Templates and workflow definitions belong in `.agents/`, not here.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# AI 工作区
|
|
2
|
-
|
|
3
|
-
本目录是多 AI 协作的运行时工作区。除本 README 和 `.gitkeep` 文件外,所有内容均被 **git ignore**。
|
|
4
|
-
|
|
5
|
-
## 目录结构
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
.agents/workspace/
|
|
9
|
-
active/ # 当前活跃的任务和交接文档
|
|
10
|
-
blocked/ # 被阻塞的任务,等待解决
|
|
11
|
-
completed/ # 已完成的任务(保留供参考)
|
|
12
|
-
logs/ # 协作日志和会话记录
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## 使用方法
|
|
16
|
-
|
|
17
|
-
- **active/**:工作开始时将任务文件放在这里。根据情况将其移至 `completed/` 或 `blocked/`。
|
|
18
|
-
- **blocked/**:当任务无法继续时将其移至此处。在任务文件中记录阻塞原因。
|
|
19
|
-
- **completed/**:任务完成后将其移至此处。这些作为历史记录保留。
|
|
20
|
-
- **logs/**:存储会话日志、AI 对话导出或协作笔记。
|
|
21
|
-
|
|
22
|
-
## 重要事项
|
|
23
|
-
|
|
24
|
-
- 本目录的内容**不受版本控制**(已被 git ignore)。
|
|
25
|
-
- 不要在这里存储需要通过 git 共享的内容。
|
|
26
|
-
- 模板和工作流定义属于 `.agents/` 目录,而非此处。
|