afyx-engineering-kit 0.1.0-alpha.6 → 0.1.0-alpha.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/.afyx-source-revision +1 -1
- package/afyx-context/src/budget.js +39 -153
- package/afyx-context/src/documentation.js +116 -0
- package/afyx-context/src/index.js +2 -0
- package/afyx-context/src/memory.js +122 -229
- package/afyx-context/src/usage.js +91 -0
- package/afyx-forge/src/cli.js +14 -1
- package/afyx-forge/src/index.js +3 -0
- package/afyx-forge/src/workflow-refiner.js +48 -15
- package/afyx-forge/src/workflow.js +226 -0
- package/afyx-graph/engine/release/RELEASE-MANIFEST.json +16 -6
- package/afyx-graph/engine/release/SHA256SUMS +4 -2
- package/afyx-graph/engine/release/afyx-graph-darwin-arm64.tar.gz +0 -0
- package/afyx-graph/engine/release/afyx-graph-darwin-x64.tar.gz +0 -0
- package/afyx-graph/engine/release/afyx-graph-linux-x64.tar.gz +0 -0
- package/afyx-graph/engine/release/afyx-graph-win32-x64.zip +0 -0
- package/bin/afyx-engineering-kit.mjs +14 -6
- package/install.ps1 +52 -6
- package/install.sh +21 -10
- package/package.json +3 -1
- package/scripts/afyx-capability-orchestrator.mjs +159 -41
- package/scripts/afyx-graph-artifact.mjs +1 -1
- package/scripts/afyx-graph-targets.mjs +8 -0
- package/scripts/afyx-host-adapters.mjs +52 -0
- package/scripts/afyx-host-bridge-lifecycle.mjs +4 -0
- package/scripts/afyx-host-bridge.mjs +25 -0
- package/scripts/afyx-install-backend.mjs +34 -13
- package/scripts/afyx-install-contract.mjs +5 -2
- package/scripts/afyx-install-progress.mjs +88 -0
- package/scripts/afyx-installer-environment.mjs +150 -0
- package/scripts/afyx-local-link-ownership.mjs +16 -0
- package/scripts/afyx-midnight-circuit.mjs +322 -79
- package/scripts/afyx-modular-integration.mjs +3 -0
- package/scripts/afyx-modular-runtime.mjs +3 -0
- package/scripts/afyx-native-execution.mjs +168 -0
- package/scripts/afyx-native-github.mjs +155 -0
- package/scripts/afyx-npm-installer.mjs +56 -28
- package/scripts/afyx-provider-inventory.mjs +6 -3
- package/scripts/afyx-security-auditor.mjs +61 -64
- package/scripts/afyx-skill-catalog.mjs +83 -0
- package/scripts/afyx-skill-engineering.mjs +2 -0
- package/scripts/afyx-universal-runtime.mjs +74 -12
- package/scripts/install-afyx-forge.ps1 +14 -10
- package/scripts/install-afyx-forge.sh +13 -10
- package/scripts/install-afyx-graph.sh +4 -4
- package/scripts/lib/AfyxInstallerProgress.psm1 +11 -0
- package/scripts/lib/AfyxSkillLifecycle.psm1 +42 -6
- package/scripts/lib/afyx-installer-progress.sh +30 -0
- package/scripts/link-global-dev.ps1 +10 -3
- package/scripts/link-global-dev.sh +10 -8
- package/scripts/prepare-g6-package.mjs +13 -28
- package/scripts/resolve-git-release-artifacts.mjs +5 -4
- package/scripts/stage-npm-release.mjs +3 -1
- package/scripts/validate-release-zip-graph.mjs +2 -2
- package/uninstall.ps1 +2 -0
- package/verify.ps1 +9 -2
- package/verify.sh +6 -4
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { evaluateVerifiedTaskCompletion } from './workflow-refiner.js';
|
|
3
|
+
|
|
4
|
+
export const FORGE_WORKFLOW_CONTRACT = 'afyx-forge-workflow/v1';
|
|
5
|
+
const ID = /^[a-z][a-z0-9-]{0,63}$/;
|
|
6
|
+
const hash = (value) => createHash('sha256').update(value).digest('hex');
|
|
7
|
+
const plain = (value) => value && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype;
|
|
8
|
+
let mutationTail = Promise.resolve();
|
|
9
|
+
async function serialMutation(action, signal) {
|
|
10
|
+
const previous = mutationTail;
|
|
11
|
+
let release;
|
|
12
|
+
const held = new Promise((resolve) => { release = resolve; });
|
|
13
|
+
mutationTail = previous.catch(() => {}).then(() => held);
|
|
14
|
+
try {
|
|
15
|
+
await previous.catch(() => {});
|
|
16
|
+
if (signal.aborted) throw new Error('WORKFLOW_ABORTED');
|
|
17
|
+
return await action();
|
|
18
|
+
} finally { release(); }
|
|
19
|
+
}
|
|
20
|
+
const profiles = Object.freeze([
|
|
21
|
+
['general', 'software-engineer', ['direct-source']], ['erp', 'erp-technical-specialist', ['odoo-engineering', 'afyx-graph']],
|
|
22
|
+
['security', 'cybersecurity-devsecops', ['afyx-security-auditor']], ['data', 'database-administrator', ['afyx-graph']],
|
|
23
|
+
['architecture', 'solutions-architect', ['afyx-graph']], ['platform', 'site-reliability-engineer', ['native-execution']],
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
/** Profile metadata references AFYX-owned Expert roles; it grants no tool permission. */
|
|
27
|
+
export function createForgeProfiles({ domain, availableCapabilities = [] } = {}) {
|
|
28
|
+
if (domain !== undefined && !profiles.some(([name]) => name === domain)) throw new Error('UNKNOWN_DOMAIN');
|
|
29
|
+
if (!Array.isArray(availableCapabilities) || availableCapabilities.some((item) => typeof item !== 'string')) throw new Error('INVALID_CAPABILITIES');
|
|
30
|
+
return profiles.filter(([name]) => domain === undefined || name === domain).map(([name, role, capabilities]) => ({
|
|
31
|
+
contract: 'afyx-forge-profile/v1', domain: name, role, owner: 'afyx-forge', knowledgeOwner: 'afyx-engineering-expert',
|
|
32
|
+
roleReference: `references/${role}.md`, capabilities: [...capabilities],
|
|
33
|
+
availableCapabilities: capabilities.filter((capability) => capability === 'direct-source' || availableCapabilities.includes(capability)),
|
|
34
|
+
authorization: 'TRUSTED_HOST_REQUIRED',
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
function bounded(value, fallback, max) {
|
|
38
|
+
const selected = value ?? fallback;
|
|
39
|
+
if (!Number.isSafeInteger(selected) || selected < 1 || selected > max) throw new Error('INVALID_BUDGET');
|
|
40
|
+
return selected;
|
|
41
|
+
}
|
|
42
|
+
function copyPlainData(value, stack = new Set(), depth = 0, budget = { items: 0 }) {
|
|
43
|
+
if (++budget.items > 8192 || depth > 16) throw new Error('PLAN_LIMIT');
|
|
44
|
+
if (value === null || typeof value === 'string' || typeof value === 'boolean') return value;
|
|
45
|
+
if (typeof value === 'number' && Number.isFinite(value)) return value;
|
|
46
|
+
if (!value || typeof value !== 'object' || (!Array.isArray(value) && !plain(value)) || stack.has(value)) throw new Error('PLAIN_PLAN_REQUIRED');
|
|
47
|
+
const descriptors = Object.getOwnPropertyDescriptors(value);
|
|
48
|
+
const keys = Reflect.ownKeys(descriptors);
|
|
49
|
+
if (keys.some((key) => typeof key !== 'string' || ['toJSON', '__proto__', 'constructor', 'prototype'].includes(key))) throw new Error('PLAIN_PLAN_REQUIRED');
|
|
50
|
+
stack.add(value);
|
|
51
|
+
let result;
|
|
52
|
+
if (Array.isArray(value)) {
|
|
53
|
+
const length = descriptors.length.value;
|
|
54
|
+
if (length > 1024 || keys.length !== length + 1) throw new Error('PLAIN_PLAN_REQUIRED');
|
|
55
|
+
result = []; Object.setPrototypeOf(result, null);
|
|
56
|
+
for (let index = 0; index < length; index++) {
|
|
57
|
+
const descriptor = descriptors[index];
|
|
58
|
+
if (!descriptor || !Object.hasOwn(descriptor, 'value') || !descriptor.enumerable) throw new Error('PLAIN_PLAN_REQUIRED');
|
|
59
|
+
result.push?.(); // Arrays have no inherited methods in the plain-data snapshot.
|
|
60
|
+
result[index] = copyPlainData(descriptor.value, stack, depth + 1, budget);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
result = Object.create(null);
|
|
64
|
+
for (const key of keys) {
|
|
65
|
+
const descriptor = descriptors[key];
|
|
66
|
+
if (!Object.hasOwn(descriptor, 'value') || !descriptor.enumerable) throw new Error('PLAIN_PLAN_REQUIRED');
|
|
67
|
+
result[key] = copyPlainData(descriptor.value, stack, depth + 1, budget);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
stack.delete(value);
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
function normalizePlan(plan) {
|
|
74
|
+
const serialized = JSON.stringify(copyPlainData(plan));
|
|
75
|
+
if (!serialized || Buffer.byteLength(serialized) > 65_536) throw new Error('PLAN_LIMIT');
|
|
76
|
+
const copy = JSON.parse(serialized);
|
|
77
|
+
if (!plain(copy) || copy.contract !== FORGE_WORKFLOW_CONTRACT || !ID.test(copy.id)
|
|
78
|
+
|| !Array.isArray(copy.steps) || !copy.steps.length || copy.steps.length > 64
|
|
79
|
+
|| Object.keys(copy).some((key) => !['contract', 'id', 'steps', 'acceptanceCriteria'].includes(key))) throw new Error('INVALID_PLAN');
|
|
80
|
+
const ids = new Set();
|
|
81
|
+
for (const step of copy.steps) {
|
|
82
|
+
if (!plain(step) || !ID.test(step.id) || ids.has(step.id) || !ID.test(step.capability)
|
|
83
|
+
|| Object.keys(step).some((key) => !['id', 'capability', 'dependsOn', 'input', 'effect'].includes(key))
|
|
84
|
+
|| !Array.isArray(step.dependsOn) || step.dependsOn.some((dep) => !ID.test(dep))
|
|
85
|
+
|| new Set(step.dependsOn).size !== step.dependsOn.length
|
|
86
|
+
|| (step.effect !== undefined && !['read', 'mutation'].includes(step.effect))) throw new Error('INVALID_STEP');
|
|
87
|
+
ids.add(step.id);
|
|
88
|
+
}
|
|
89
|
+
const reachable = new Set();
|
|
90
|
+
while (reachable.size < copy.steps.length) {
|
|
91
|
+
const ready = copy.steps.filter((step) => !reachable.has(step.id) && step.dependsOn.every((id) => reachable.has(id)));
|
|
92
|
+
if (!ready.length) throw new Error('MISSING_DEPENDENCY_OR_CYCLE');
|
|
93
|
+
for (const step of ready) reachable.add(step.id);
|
|
94
|
+
}
|
|
95
|
+
return { plan: copy, digest: hash(serialized) };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Forge owns scheduling; the trusted host supplies capability adapters and authorization. */
|
|
99
|
+
export async function executeForgeWorkflow(input, options = {}) {
|
|
100
|
+
const { plan, digest } = normalizePlan(input);
|
|
101
|
+
const { adapters = {}, authorize, checkpoint, verifyCheckpoint, saveCheckpoint, signal } = options;
|
|
102
|
+
const limits = { maxCalls: bounded(options.budget?.maxCalls, 64, 256),
|
|
103
|
+
maxElapsedMs: bounded(options.budget?.maxElapsedMs, 30_000, 300_000), maxParallel: bounded(options.budget?.maxParallel, 2, 2) };
|
|
104
|
+
const definitions = new Map();
|
|
105
|
+
for (const step of plan.steps) {
|
|
106
|
+
const descriptor = Object.hasOwn(adapters, step.capability) ? adapters[step.capability] : null;
|
|
107
|
+
if (!descriptor || typeof descriptor.execute !== 'function' || !['read', 'mutation'].includes(descriptor.effect)
|
|
108
|
+
|| (descriptor.privileged !== undefined && typeof descriptor.privileged !== 'boolean')
|
|
109
|
+
|| (step.effect !== undefined && step.effect !== descriptor.effect)) throw new Error('TRUSTED_ADAPTER_REQUIRED');
|
|
110
|
+
definitions.set(step.id, Object.freeze({ execute: descriptor.execute, effect: descriptor.effect, privileged: descriptor.privileged === true }));
|
|
111
|
+
}
|
|
112
|
+
const state = new Map(plan.steps.map((step) => [step.id, 'PENDING']));
|
|
113
|
+
const receipts = []; const completed = new Set();
|
|
114
|
+
if (checkpoint !== undefined) {
|
|
115
|
+
let approved = false;
|
|
116
|
+
try { approved = typeof verifyCheckpoint === 'function' && verifyCheckpoint(checkpoint, Object.freeze({ planDigest: digest })) === true; } catch { /* fail closed */ }
|
|
117
|
+
if (!approved || checkpoint.contract !== 'afyx-forge-checkpoint/v1' || checkpoint.planDigest !== digest
|
|
118
|
+
|| !Array.isArray(checkpoint.completed) || checkpoint.completed.some((id) => !state.has(id))
|
|
119
|
+
|| new Set(checkpoint.completed).size !== checkpoint.completed.length) throw new Error('UNVERIFIED_CHECKPOINT');
|
|
120
|
+
for (const id of checkpoint.completed) completed.add(id);
|
|
121
|
+
if (plan.steps.some((step) => completed.has(step.id) && step.dependsOn.some((id) => !completed.has(id)))) throw new Error('INVALID_CHECKPOINT_DEPENDENCIES');
|
|
122
|
+
for (const id of completed) state.set(id, 'COMPLETED');
|
|
123
|
+
}
|
|
124
|
+
const snapshot = () => Object.freeze({ contract: 'afyx-forge-checkpoint/v1', planDigest: digest,
|
|
125
|
+
completed: Object.freeze(plan.steps.filter((step) => completed.has(step.id)).map((step) => step.id)) });
|
|
126
|
+
const started = performance.now(); let calls = 0; let stopped = null;
|
|
127
|
+
const controller = new AbortController();
|
|
128
|
+
const abort = () => { stopped ??= 'CANCELLED'; controller.abort(); };
|
|
129
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
130
|
+
if (signal?.aborted) abort();
|
|
131
|
+
async function run(step) {
|
|
132
|
+
const adapter = definitions.get(step.id);
|
|
133
|
+
const proposal = Object.freeze({ workflowId: plan.id, planDigest: digest, stepId: step.id,
|
|
134
|
+
capability: step.capability, effect: adapter.effect, privileged: adapter.privileged });
|
|
135
|
+
if (adapter.effect === 'mutation' || adapter.privileged) {
|
|
136
|
+
try { if (typeof authorize !== 'function' || authorize(proposal) !== true) return { stepId: step.id, status: 'DENIED' }; }
|
|
137
|
+
catch { return { stepId: step.id, status: 'DENIED' }; }
|
|
138
|
+
}
|
|
139
|
+
if (controller.signal.aborted) return { stepId: step.id, status: 'CANCELLED' };
|
|
140
|
+
const remaining = limits.maxElapsedMs - (performance.now() - started);
|
|
141
|
+
if (remaining <= 0) return { stepId: step.id, status: 'TIMEOUT' };
|
|
142
|
+
let timer; let onStepAbort;
|
|
143
|
+
try {
|
|
144
|
+
const invoke = () => {
|
|
145
|
+
if (controller.signal.aborted) throw new Error('WORKFLOW_ABORTED');
|
|
146
|
+
let consumed = false;
|
|
147
|
+
const action = () => {
|
|
148
|
+
if (consumed) throw new Error('STEP_ALREADY_INVOKED');
|
|
149
|
+
consumed = true; calls++;
|
|
150
|
+
return adapter.execute(step.input ?? {}, { signal: controller.signal, proposal });
|
|
151
|
+
};
|
|
152
|
+
return adapter.effect === 'mutation' && typeof options.runExclusive === 'function'
|
|
153
|
+
? Promise.resolve(options.runExclusive(proposal, action, { signal: controller.signal })).then((result) => {
|
|
154
|
+
if (!consumed) throw new Error('HOST_LOCK_DID_NOT_EXECUTE');
|
|
155
|
+
return result;
|
|
156
|
+
}) : action();
|
|
157
|
+
};
|
|
158
|
+
const result = await Promise.race([
|
|
159
|
+
adapter.effect === 'mutation' ? serialMutation(invoke, controller.signal) : Promise.resolve().then(invoke),
|
|
160
|
+
new Promise((_, reject) => { timer = setTimeout(() => { controller.abort(); reject(new Error('WORKFLOW_TIMEOUT')); }, remaining); }),
|
|
161
|
+
new Promise((_, reject) => {
|
|
162
|
+
onStepAbort = () => reject(new Error('WORKFLOW_ABORTED'));
|
|
163
|
+
controller.signal.addEventListener('abort', onStepAbort, { once: true });
|
|
164
|
+
}),
|
|
165
|
+
]);
|
|
166
|
+
if (!result || !['SUCCESS', 'PASS', 'EXECUTED'].includes(result.status)) return { stepId: step.id, status: 'FAILED' };
|
|
167
|
+
const encoded = JSON.stringify(result);
|
|
168
|
+
if (!encoded || Buffer.byteLength(encoded) > 1_048_576) return { stepId: step.id, status: 'INVALID_RESULT' };
|
|
169
|
+
return { stepId: step.id, status: 'COMPLETED', resultDigest: hash(encoded) };
|
|
170
|
+
} catch { return { stepId: step.id, status: stopped ? 'CANCELLED' : controller.signal.aborted ? 'TIMEOUT' : 'FAILED' }; }
|
|
171
|
+
finally { clearTimeout(timer); if (onStepAbort) controller.signal.removeEventListener('abort', onStepAbort); }
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
while (completed.size < plan.steps.length && !stopped) {
|
|
175
|
+
if (controller.signal.aborted) { stopped = 'CANCELLED'; break; }
|
|
176
|
+
if (calls >= limits.maxCalls || performance.now() - started >= limits.maxElapsedMs) { stopped = 'BUDGET_EXHAUSTED'; break; }
|
|
177
|
+
const ready = plan.steps.filter((step) => state.get(step.id) === 'PENDING' && step.dependsOn.every((id) => completed.has(id)));
|
|
178
|
+
const batch = [];
|
|
179
|
+
for (const step of ready) {
|
|
180
|
+
const mutation = definitions.get(step.id).effect === 'mutation';
|
|
181
|
+
if (mutation && batch.length) break;
|
|
182
|
+
batch.push(step);
|
|
183
|
+
if (mutation || batch.length >= limits.maxParallel || batch.length >= limits.maxCalls - calls) break;
|
|
184
|
+
}
|
|
185
|
+
if (!batch.length) { stopped = 'DEPENDENCY_BLOCKED'; break; }
|
|
186
|
+
for (const step of batch) state.set(step.id, 'RUNNING');
|
|
187
|
+
const outcomes = await Promise.all(batch.map(async (step) => {
|
|
188
|
+
const outcome = await run(step);
|
|
189
|
+
if (outcome.status !== 'COMPLETED') { stopped ??= outcome.status; controller.abort(); }
|
|
190
|
+
return outcome;
|
|
191
|
+
}));
|
|
192
|
+
for (const outcome of outcomes) {
|
|
193
|
+
receipts.push(Object.freeze(outcome)); state.set(outcome.stepId, outcome.status);
|
|
194
|
+
if (outcome.status === 'COMPLETED') {
|
|
195
|
+
completed.add(outcome.stepId);
|
|
196
|
+
if (saveCheckpoint) {
|
|
197
|
+
let saveTimer; let onSaveAbort;
|
|
198
|
+
try {
|
|
199
|
+
const remaining = limits.maxElapsedMs - (performance.now() - started);
|
|
200
|
+
if (remaining <= 0) throw new Error('CHECKPOINT_TIMEOUT');
|
|
201
|
+
await Promise.race([saveCheckpoint(snapshot(), { signal: controller.signal }),
|
|
202
|
+
new Promise((_, reject) => { saveTimer = setTimeout(() => reject(new Error('CHECKPOINT_TIMEOUT')), remaining); }),
|
|
203
|
+
new Promise((_, reject) => {
|
|
204
|
+
onSaveAbort = () => reject(new Error('WORKFLOW_ABORTED'));
|
|
205
|
+
controller.signal.addEventListener('abort', onSaveAbort, { once: true });
|
|
206
|
+
if (controller.signal.aborted) onSaveAbort();
|
|
207
|
+
})]);
|
|
208
|
+
}
|
|
209
|
+
catch { stopped ??= 'CHECKPOINT_SAVE_FAILED_REVIEW_REQUIRED'; }
|
|
210
|
+
finally { clearTimeout(saveTimer); if (onSaveAbort) controller.signal.removeEventListener('abort', onSaveAbort); }
|
|
211
|
+
}
|
|
212
|
+
} else stopped ??= outcome.status;
|
|
213
|
+
}
|
|
214
|
+
if (stopped) controller.abort();
|
|
215
|
+
}
|
|
216
|
+
} finally { signal?.removeEventListener('abort', abort); }
|
|
217
|
+
const acceptance = plan.acceptanceCriteria === undefined ? null : evaluateVerifiedTaskCompletion(plan.acceptanceCriteria,
|
|
218
|
+
options.evidence ?? [], { sourceRevision: options.sourceRevision, verifyEvidence: options.verifyEvidence });
|
|
219
|
+
const successful = !stopped && completed.size === plan.steps.length;
|
|
220
|
+
return Object.freeze({ contract: FORGE_WORKFLOW_CONTRACT, workflowId: plan.id, planDigest: digest,
|
|
221
|
+
status: successful ? acceptance && !acceptance.isComplete ? 'UNVERIFIED' : 'SUCCESS' : 'STOPPED',
|
|
222
|
+
reason: stopped ?? (acceptance && !acceptance.isComplete ? 'ACCEPTANCE_UNVERIFIED' : 'COMPLETED'),
|
|
223
|
+
calls, durationMs: performance.now() - started, mutationIsolation: typeof options.runExclusive === 'function' ? 'TRUSTED_HOST_LOCK_CALLBACK' : 'PROCESS_LOCAL',
|
|
224
|
+
checkpoint: snapshot(), receipts: Object.freeze(receipts),
|
|
225
|
+
steps: Object.freeze(plan.steps.map((step) => Object.freeze({ id: step.id, status: state.get(step.id) }))), acceptance });
|
|
226
|
+
}
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schema":
|
|
2
|
+
"schema": 2,
|
|
3
3
|
"product": "Afyx Graph",
|
|
4
4
|
"product_version": "1.0.0",
|
|
5
5
|
"release_tag": "afyx-graph-v1.0.0",
|
|
6
|
-
"source_revision": "
|
|
6
|
+
"source_revision": "57cfcf2c7b7a48d1c5bbba03fe97af98b71ac5bd",
|
|
7
7
|
"integrity_claim": "sha256",
|
|
8
8
|
"publisher_authenticity": "requires-independent-attestation",
|
|
9
9
|
"artifacts": [
|
|
10
|
+
{
|
|
11
|
+
"file": "afyx-graph-win32-x64.zip",
|
|
12
|
+
"target": "win32-x64",
|
|
13
|
+
"sha256": "b5b298f0bc2ba91361a46c0a7a38bd23bacf2e640c3dac05188fc09cbd44e688"
|
|
14
|
+
},
|
|
10
15
|
{
|
|
11
16
|
"file": "afyx-graph-linux-x64.tar.gz",
|
|
12
17
|
"target": "linux-x64",
|
|
13
|
-
"sha256": "
|
|
18
|
+
"sha256": "533f85c5878d8720e46041696fb3b9752e626a7ffdf811b76e604f85d843aa57"
|
|
14
19
|
},
|
|
15
20
|
{
|
|
16
|
-
"file": "afyx-graph-
|
|
17
|
-
"target": "
|
|
18
|
-
"sha256": "
|
|
21
|
+
"file": "afyx-graph-darwin-arm64.tar.gz",
|
|
22
|
+
"target": "darwin-arm64",
|
|
23
|
+
"sha256": "41a2161a0925f202bbfc2136d3f7c6d8cf8138c7dcaffaa1a2c4b2afd750e1ed"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"file": "afyx-graph-darwin-x64.tar.gz",
|
|
27
|
+
"target": "darwin-x64",
|
|
28
|
+
"sha256": "a04fd24623fdc53e9f9ae136ce1d1be3e01a36e02886bd055a97d7999c876f64"
|
|
19
29
|
}
|
|
20
30
|
]
|
|
21
31
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
b5b298f0bc2ba91361a46c0a7a38bd23bacf2e640c3dac05188fc09cbd44e688 afyx-graph-win32-x64.zip
|
|
2
|
+
533f85c5878d8720e46041696fb3b9752e626a7ffdf811b76e604f85d843aa57 afyx-graph-linux-x64.tar.gz
|
|
3
|
+
41a2161a0925f202bbfc2136d3f7c6d8cf8138c7dcaffaa1a2c4b2afd750e1ed afyx-graph-darwin-arm64.tar.gz
|
|
4
|
+
a04fd24623fdc53e9f9ae136ce1d1be3e01a36e02886bd055a97d7999c876f64 afyx-graph-darwin-x64.tar.gz
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
buildSubprocessCall,
|
|
13
13
|
executeSubprocess,
|
|
14
14
|
} from '../scripts/afyx-npm-installer.mjs';
|
|
15
|
-
import { runMidnightCircuit, terminalMode } from '../scripts/afyx-midnight-circuit.mjs';
|
|
15
|
+
import { runMidnightCircuit, terminalMode, recordInstallerDiagnostic } from '../scripts/afyx-midnight-circuit.mjs';
|
|
16
16
|
|
|
17
17
|
function verifyNodeRuntime() {
|
|
18
18
|
const version = process.versions.node;
|
|
@@ -45,7 +45,7 @@ async function main() {
|
|
|
45
45
|
process.exit(1);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
let finish;
|
|
48
|
+
let finish, onOutput, startProgress;
|
|
49
49
|
if (parsed.command === 'install') {
|
|
50
50
|
const mode = terminalMode({ requested: parsed.options.ui || 'auto' });
|
|
51
51
|
const hasSelections = parsed.options.preset || parsed.options.provider || parsed.options.providerScope ||
|
|
@@ -53,20 +53,26 @@ async function main() {
|
|
|
53
53
|
if (parsed.options.ui === 'tui' && (hasSelections || parsed.options.nonInteractive || parsed.options.dryRun || parsed.options.validateOnly)) {
|
|
54
54
|
throw new Error('--ui tui runs the interactive installer; remove scripted selection/preview flags or use --ui plain.');
|
|
55
55
|
}
|
|
56
|
-
if (mode === 'tui' && !hasSelections &&
|
|
56
|
+
if ((mode === 'tui' || (process.stdin.isTTY && process.stdout.isTTY && !process.env.CI)) && !hasSelections &&
|
|
57
57
|
!parsed.options.nonInteractive && !parsed.options.dryRun && !parsed.options.validateOnly) {
|
|
58
|
-
const selection = await runMidnightCircuit({ options: parsed.options });
|
|
58
|
+
const selection = await runMidnightCircuit({ options: parsed.options, plain: mode === 'plain' });
|
|
59
59
|
if (!selection) { console.log('Installation canceled without changes.'); return; }
|
|
60
60
|
finish = selection.finish;
|
|
61
|
+
onOutput = selection.onOutput;
|
|
62
|
+
startProgress = selection.startProgress;
|
|
61
63
|
Object.assign(parsed.options, selection);
|
|
62
64
|
delete parsed.options.finish;
|
|
65
|
+
delete parsed.options.onOutput;
|
|
66
|
+
delete parsed.options.startProgress;
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
69
|
const callInfo = buildSubprocessCall(parsed.command, parsed.options);
|
|
70
|
+
if (finish) callInfo.env = { ...callInfo.env, AFYX_INSTALL_UI_OWNER: 'node', AFYX_INSTALL_PROGRESS: '1', NO_COLOR: '1', AFYX_PLAIN_OUTPUT: '1' };
|
|
66
71
|
if (parsed.options.ui === 'plain') callInfo.env = { ...callInfo.env, NO_COLOR: '1' };
|
|
67
72
|
|
|
68
73
|
try {
|
|
69
|
-
|
|
74
|
+
if (startProgress) startProgress();
|
|
75
|
+
const exitCode = await executeSubprocess(callInfo, { onOutput });
|
|
70
76
|
const finalCode = finish ? await finish(exitCode) : exitCode;
|
|
71
77
|
process.exit(finalCode);
|
|
72
78
|
} catch (err) {
|
|
@@ -77,6 +83,8 @@ async function main() {
|
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
main().catch((err) => {
|
|
80
|
-
|
|
86
|
+
const diagnostic = recordInstallerDiagnostic(err);
|
|
87
|
+
console.error(`Installer error: ${String(err.message || err).split('\n')[0]}\nDiagnostic log: ${diagnostic}`);
|
|
88
|
+
if (process.stdout.isTTY && !process.env.NO_COLOR && process.env.TERM !== 'dumb') process.stdout.write('\x1b[0m\x1b[?25h');
|
|
81
89
|
process.exit(1);
|
|
82
90
|
});
|
package/install.ps1
CHANGED
|
@@ -33,8 +33,25 @@ param(
|
|
|
33
33
|
|
|
34
34
|
Set-StrictMode -Version Latest
|
|
35
35
|
$ErrorActionPreference = 'Stop'
|
|
36
|
+
Import-Module (Join-Path $PSScriptRoot 'scripts\lib\AfyxTerminal.psm1') -Force
|
|
37
|
+
|
|
38
|
+
# Bare interactive entrypoints share the Node UX. Explicit native script options
|
|
39
|
+
# and noninteractive automation retain their existing backend contract.
|
|
40
|
+
if ($PSBoundParameters.Count -eq 0 -and -not $env:CI -and $env:AFYX_INSTALL_UI_OWNER -ne 'node' -and
|
|
41
|
+
(Test-AfyxInteractiveTerminal)) {
|
|
42
|
+
$interactiveNode = Get-Command node -ErrorAction SilentlyContinue
|
|
43
|
+
if ($interactiveNode) {
|
|
44
|
+
& $interactiveNode.Source (Join-Path $PSScriptRoot 'bin\afyx-engineering-kit.mjs') install
|
|
45
|
+
exit $LASTEXITCODE
|
|
46
|
+
}
|
|
47
|
+
}
|
|
36
48
|
|
|
37
49
|
$packageRoot = $PSScriptRoot
|
|
50
|
+
Import-Module (Join-Path $packageRoot 'scripts\lib\AfyxInstallerProgress.psm1') -Force
|
|
51
|
+
if ($env:AFYX_INSTALL_UI_OWNER -eq 'node') { [Console]::OutputEncoding = [Text.UTF8Encoding]::new($false) }
|
|
52
|
+
if ($ComponentAction.Count) {
|
|
53
|
+
$ComponentAction = @($ComponentAction | ForEach-Object { $_ -split ',' } | ForEach-Object { $_.Trim() } | Where-Object { $_ })
|
|
54
|
+
}
|
|
38
55
|
if (($PlanJson -or $ExpectedPlan) -and -not $Preset) { throw 'Structured planning requires an explicit preset.' }
|
|
39
56
|
if ($CustomComponent.Count) {
|
|
40
57
|
$CustomComponent = @($CustomComponent | ForEach-Object { $_ -split ',' } | ForEach-Object { $_.Trim() } | Where-Object { $_ })
|
|
@@ -66,7 +83,6 @@ if ($InstallUsageTracker -and $SkipUsageTracker) { throw '-InstallUsageTracker a
|
|
|
66
83
|
Import-Module (Join-Path $packageRoot 'scripts\lib\AfyxComponents.psm1') -Force
|
|
67
84
|
Import-Module (Join-Path $packageRoot 'scripts\lib\AfyxPlatform.psm1') -Force
|
|
68
85
|
Import-Module (Join-Path $packageRoot 'scripts\lib\AfyxSkillLifecycle.psm1') -Force -DisableNameChecking
|
|
69
|
-
Import-Module (Join-Path $packageRoot 'scripts\lib\AfyxTerminal.psm1') -Force
|
|
70
86
|
$terminal = New-AfyxTerminalContext
|
|
71
87
|
$providerRegistry = @(Get-AfyxProviderRegistry)
|
|
72
88
|
$providerIds = @($providerRegistry | ForEach-Object { [string]$_.provider })
|
|
@@ -414,6 +430,8 @@ function Read-InstallChoice([string]$Label) {
|
|
|
414
430
|
function Install-ManagedSkillSafely([string]$Component, [string]$Name, [string]$Source, [string]$Target, [bool]$ReplaceExisting, [string]$InstallRoot = $SkillsRoot, [bool]$AuthorizeRepair = $false) {
|
|
415
431
|
if ((Test-Path -LiteralPath $Target) -and -not $ReplaceExisting) { return 'skipped' }
|
|
416
432
|
if ($WhatIfPreference) { Write-Host "WhatIf: would stage and install $Name at $Target"; return 'planned' }
|
|
433
|
+
$progressOperation = "skill:$Component`:$([guid]::NewGuid().ToString('N'))"
|
|
434
|
+
Write-AfyxInstallerProgress -OperationId $progressOperation -ComponentId $Component -Phase install -State running -Message "Installing $Name"
|
|
417
435
|
Assert-AfyxSkillTarget -SkillsRoot $InstallRoot -Target $Target
|
|
418
436
|
$parent = Split-Path -Parent $Target
|
|
419
437
|
New-Item -ItemType Directory -Force -Path $parent | Out-Null
|
|
@@ -424,6 +442,10 @@ function Install-ManagedSkillSafely([string]$Component, [string]$Name, [string]$
|
|
|
424
442
|
$planRepair = $controlPlan -and @($controlPlan.Components | Where-Object { $_.Id -eq $Component -and $_.Repair -eq 'REPAIR' }).Count -eq 1
|
|
425
443
|
$authorized = $Force -or $componentActions.ContainsKey($Component) -or $planRepair -or $AuthorizeRepair
|
|
426
444
|
Install-AfyxSkillTransaction -SkillsRoot $InstallRoot -Component $Component -Name $Name -Stage $stage -Target $Target -Owner afyx -Version (Get-AfyxSkillVersion -Directory $Source) -AuthorizeUnproven:$authorized
|
|
445
|
+
Write-AfyxInstallerProgress -OperationId $progressOperation -ComponentId $Component -Phase install -State completed -Message "Installed $Name; final verification pending"
|
|
446
|
+
} catch {
|
|
447
|
+
Write-AfyxInstallerProgress -OperationId $progressOperation -ComponentId $Component -Phase install -State failed -Message "Installation failed: $Name; inspect diagnostic logs"
|
|
448
|
+
throw
|
|
427
449
|
} finally {
|
|
428
450
|
if (Test-Path -LiteralPath $stage) { Remove-Item -LiteralPath $stage -Recurse -Force -ErrorAction SilentlyContinue }
|
|
429
451
|
}
|
|
@@ -477,7 +499,10 @@ if ($PlanJson -or $ExpectedPlan) {
|
|
|
477
499
|
$item = @($controlPlan.Components | Where-Object { $_.Id -eq $id })[0]
|
|
478
500
|
$planRows += [ordered]@{
|
|
479
501
|
id = $id; name = [string]$component.name; type = [string]$component.type
|
|
480
|
-
currentState = [string]$state.State
|
|
502
|
+
currentState = [string]$state.State
|
|
503
|
+
# Match Resolve-ComponentAction: the Codex-only toolset is not a
|
|
504
|
+
# desired install when no Codex provider was selected or it is OFF.
|
|
505
|
+
desired = [bool]$item.Desired -and ($id -ne 'codex-usage-tracking' -or ('codex' -in $Provider -and -not $SkipUsageTracker))
|
|
481
506
|
backendAction = [string]$actionDecisions[$id]; target = [string]$state.Path
|
|
482
507
|
ownership = [string]$item.ActualOwnership; version = [string]$state.Version
|
|
483
508
|
availableVersion = Get-AvailableVersion $id
|
|
@@ -819,11 +844,30 @@ function Invoke-AfyxInstallStage {
|
|
|
819
844
|
[Parameter(Mandatory)][string]$Stage,
|
|
820
845
|
[string]$Description = ''
|
|
821
846
|
)
|
|
847
|
+
$progressComponent = switch ($Stage) {
|
|
848
|
+
'Afyx Graph' { 'afyx-graph' }
|
|
849
|
+
'Afyx Context Engine' { 'afyx-context' }
|
|
850
|
+
'Afyx Forge Core' { 'afyx-forge' }
|
|
851
|
+
'Usage Tracking' { 'codex-usage-tracking' }
|
|
852
|
+
default { '' }
|
|
853
|
+
}
|
|
854
|
+
$progressId = "runtime:$([guid]::NewGuid().ToString('N'))"
|
|
855
|
+
$progressPhase = if ($Description -match '^(update|repair|install)\b') { $Matches[1] } else { 'install' }
|
|
856
|
+
$reportProgress = { param([string]$state)
|
|
857
|
+
if ($env:AFYX_INSTALL_PROGRESS -eq '1') {
|
|
858
|
+
Write-AfyxInstallerProgress -OperationId $progressId -ComponentId $progressComponent -Phase $progressPhase -State $state -Message "$Stage - $Description"
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
& $reportProgress running
|
|
822
862
|
if (-not $wizardMode -or -not $terminal.Ansi) {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
863
|
+
try {
|
|
864
|
+
$global:LASTEXITCODE = 0
|
|
865
|
+
$output = & $Action 2>&1
|
|
866
|
+
$success = [bool]$? -and ($LASTEXITCODE -eq 0 -or $LASTEXITCODE -eq $null)
|
|
867
|
+
$output | Out-Host
|
|
868
|
+
& $reportProgress $(if ($success) { 'completed' } else { 'failed' })
|
|
869
|
+
return $success
|
|
870
|
+
} catch { & $reportProgress failed; throw }
|
|
827
871
|
}
|
|
828
872
|
$logRoot = Join-Path $AfyxInstallRoot 'logs'
|
|
829
873
|
New-Item -ItemType Directory -Path $logRoot -Force | Out-Null
|
|
@@ -848,10 +892,12 @@ function Invoke-AfyxInstallStage {
|
|
|
848
892
|
)
|
|
849
893
|
$tailSummary = if ($lastLogLines.Count) { $lastLogLines[-1] } else { '' }
|
|
850
894
|
$diagMsg = if ($failure) { $failure.Exception.Message } elseif ($tailSummary) { $tailSummary } else { "Process exited with code $LASTEXITCODE" }
|
|
895
|
+
& $reportProgress failed
|
|
851
896
|
Write-AfyxStatus -Status FAILED -Name $Stage -Detail "$diagMsg; log: $logFile" -Terminal $terminal
|
|
852
897
|
if ($failure) { throw $failure }
|
|
853
898
|
else { throw "$Stage failed: $diagMsg (log: $logFile)" }
|
|
854
899
|
} else {
|
|
900
|
+
& $reportProgress completed
|
|
855
901
|
Write-AfyxStatus -Status HEALTHY -Name $Stage -Detail "completed successfully" -Terminal $terminal
|
|
856
902
|
}
|
|
857
903
|
return $success
|
package/install.sh
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
4
|
PACKAGE_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
|
+
if [[ $# -eq 0 && -t 0 && -t 1 && -z "${CI:-}" && "${AFYX_INSTALL_UI_OWNER:-}" != node ]] && command -v node >/dev/null 2>&1; then
|
|
6
|
+
exec node "$PACKAGE_ROOT/bin/afyx-engineering-kit.mjs" install
|
|
7
|
+
fi
|
|
5
8
|
BUNDLED_EFFICIENT="$PACKAGE_ROOT/skills/efficient-coding"
|
|
9
|
+
source "$PACKAGE_ROOT/scripts/lib/afyx-installer-progress.sh"
|
|
6
10
|
BUNDLED_ODOO="$PACKAGE_ROOT/skills/odoo-engineering"
|
|
7
11
|
BUNDLED_EXPERT="$PACKAGE_ROOT/skills/afyx-engineering-expert"
|
|
8
12
|
skills_root="${CODEX_SKILLS_ROOT:-$HOME/.agents/skills}"
|
|
@@ -17,6 +21,7 @@ update_installed=false
|
|
|
17
21
|
component_actions=()
|
|
18
22
|
component_action_count=0
|
|
19
23
|
preset=
|
|
24
|
+
implicit_preset=false
|
|
20
25
|
custom_component_list=
|
|
21
26
|
offline=false
|
|
22
27
|
no_build_fallback=false
|
|
@@ -176,6 +181,7 @@ if [[ -t 0 && -z "${CI:-}" ]] && ! "$dry_run"; then interactive=true; fi
|
|
|
176
181
|
if [[ -z "$preset" && "$component_action_count" -eq 0 && "$interactive" == false &&
|
|
177
182
|
"$validate_only" == false && "$update_installed" == false && "$force" == false ]]; then
|
|
178
183
|
preset=recommended
|
|
184
|
+
implicit_preset=true
|
|
179
185
|
fi
|
|
180
186
|
|
|
181
187
|
available_version() {
|
|
@@ -219,6 +225,9 @@ component_action() {
|
|
|
219
225
|
fi
|
|
220
226
|
available="$(available_version "$id")"
|
|
221
227
|
if action="$(explicit_action "$id")"; then :
|
|
228
|
+
elif "$implicit_preset" && [[ "$state" == DRIFTED && "$(afyx_component_field "$id" type)" == skill ]]; then
|
|
229
|
+
# A default selection does not authorize discarding local skill edits.
|
|
230
|
+
action=skip
|
|
222
231
|
elif [[ -n "$preset" ]]; then
|
|
223
232
|
afyx_control_classify "$id" "$state" "$preset" "$custom_component_list" "$provider_list"
|
|
224
233
|
if [[ "$AFYX_DESIRED" != true || "$AFYX_DRIFT" == NOT_APPLICABLE ]]; then action=skip
|
|
@@ -522,7 +531,7 @@ expert_action="$(component_action afyx-engineering-expert 'Afyx Engineering Expe
|
|
|
522
531
|
for additional_root in ${additional_skill_roots[@]+"${additional_skill_roots[@]}"}; do
|
|
523
532
|
for skill_spec in "efficient-coding|$efficient_action" "odoo-engineering|$odoo_action" "afyx-engineering-expert|$expert_action"; do
|
|
524
533
|
skill_id="${skill_spec%%|*}"; skill_action="${skill_spec#*|}"
|
|
525
|
-
if [[ -n "$preset" ]] && afyx_component_desired "$skill_id" "$preset" "$custom_component_list" "$provider_list"; then skill_action=install; fi
|
|
534
|
+
if ! "$implicit_preset" && [[ -n "$preset" ]] && afyx_component_desired "$skill_id" "$preset" "$custom_component_list" "$provider_list"; then skill_action=install; fi
|
|
526
535
|
[[ "$skill_action" != skip && "$skill_action" != adopt ]] || continue
|
|
527
536
|
target="$additional_root/$skill_id"
|
|
528
537
|
afyx_classify_skill "$target" "$skill_id" afyx
|
|
@@ -537,17 +546,17 @@ efficient_result=skipped
|
|
|
537
546
|
odoo_result=skipped
|
|
538
547
|
expert_result=skipped
|
|
539
548
|
if [[ "$efficient_action" == adopt ]]; then efficient_result="$(adopt_legacy_skill efficient-coding 'Efficient Coding' "$efficient_target")"
|
|
540
|
-
elif [[ "$efficient_action" != skip ]]; then efficient_result="$(safe_skill_install efficient-coding 'Efficient Coding' "$BUNDLED_EFFICIENT" "$efficient_target" "$([[ "$efficient_action" == install ]] && printf false || printf true)")"; fi
|
|
549
|
+
elif [[ "$efficient_action" != skip ]]; then efficient_result="$(afyx_run_install_operation efficient-coding install "Installing efficient-coding" safe_skill_install efficient-coding 'Efficient Coding' "$BUNDLED_EFFICIENT" "$efficient_target" "$([[ "$efficient_action" == install ]] && printf false || printf true)")"; fi
|
|
541
550
|
if [[ "$odoo_action" == adopt ]]; then odoo_result="$(adopt_legacy_skill odoo-engineering 'Odoo Engineering' "$odoo_target")"
|
|
542
|
-
elif [[ "$odoo_action" != skip ]]; then odoo_result="$(safe_skill_install odoo-engineering 'Odoo Engineering' "$BUNDLED_ODOO" "$odoo_target" "$([[ "$odoo_action" == install ]] && printf false || printf true)")"; fi
|
|
551
|
+
elif [[ "$odoo_action" != skip ]]; then odoo_result="$(afyx_run_install_operation odoo-engineering install "Installing odoo-engineering" safe_skill_install odoo-engineering 'Odoo Engineering' "$BUNDLED_ODOO" "$odoo_target" "$([[ "$odoo_action" == install ]] && printf false || printf true)")"; fi
|
|
543
552
|
if [[ "$expert_action" == adopt ]]; then
|
|
544
553
|
printf 'Afyx Engineering Expert has no trusted legacy provenance and cannot be adopted.\n' >&2
|
|
545
554
|
exit 1
|
|
546
|
-
elif [[ "$expert_action" != skip ]]; then expert_result="$(safe_skill_install afyx-engineering-expert 'Afyx Engineering Expert' "$BUNDLED_EXPERT" "$expert_target" "$([[ "$expert_action" == install ]] && printf false || printf true)")"; fi
|
|
555
|
+
elif [[ "$expert_action" != skip ]]; then expert_result="$(afyx_run_install_operation afyx-engineering-expert install "Installing afyx-engineering-expert" safe_skill_install afyx-engineering-expert 'Afyx Engineering Expert' "$BUNDLED_EXPERT" "$expert_target" "$([[ "$expert_action" == install ]] && printf false || printf true)")"; fi
|
|
547
556
|
|
|
548
557
|
replicate_provider_skill() {
|
|
549
558
|
local id="$1" label="$2" source="$3" action="$4" root target replace result
|
|
550
|
-
if [[ -n "$preset" ]] && afyx_component_desired "$id" "$preset" "$custom_component_list" "$provider_list"; then action=install; fi
|
|
559
|
+
if ! "$implicit_preset" && [[ -n "$preset" ]] && afyx_component_desired "$id" "$preset" "$custom_component_list" "$provider_list"; then action=install; fi
|
|
551
560
|
[[ "$action" != skip && "$action" != adopt ]] || return 0
|
|
552
561
|
for root in ${additional_skill_roots[@]+"${additional_skill_roots[@]}"}; do
|
|
553
562
|
target="$root/$id"
|
|
@@ -558,10 +567,12 @@ replicate_provider_skill() {
|
|
|
558
567
|
if [[ "$(afyx_skill_version "$target")" == "$(afyx_skill_version "$source")" ]]; then printf '%s [%s]: skipped\n' "$label" "$root"; continue; fi
|
|
559
568
|
replace=true
|
|
560
569
|
;;
|
|
561
|
-
AFYX_OWNED_MODIFIED)
|
|
570
|
+
AFYX_OWNED_MODIFIED)
|
|
571
|
+
if "$implicit_preset"; then printf '%s [%s]: modified content preserved; explicit repair required\n' "$label" "$root"; continue; fi
|
|
572
|
+
replace=true ;;
|
|
562
573
|
*) printf 'Refusing to replace %s at provider skill root %s because ownership is %s.\n' "$label" "$root" "$AFYX_OWNERSHIP_STATE" >&2; exit 1 ;;
|
|
563
574
|
esac
|
|
564
|
-
result="$(safe_skill_install "$id" "$label" "$source" "$target" "$replace")"
|
|
575
|
+
result="$(afyx_run_install_operation "$id" install "Installing $label for provider" safe_skill_install "$id" "$label" "$source" "$target" "$replace")"
|
|
565
576
|
printf '%s [%s]: %s\n' "$label" "$root" "$result"
|
|
566
577
|
done
|
|
567
578
|
}
|
|
@@ -580,7 +591,7 @@ if [[ "$graph_action" != skip ]]; then
|
|
|
580
591
|
"$allow_dirty_source" && graph_args+=(--allow-dirty-source)
|
|
581
592
|
if "$skip_graph_mcp" || "$skip_provider_configuration" || [[ ",$provider_list," != *,codex,* ]]; then graph_args+=(--skip-mcp); else graph_args+=(--configure-mcp); fi
|
|
582
593
|
"$dry_run" && graph_args+=(--validate-only)
|
|
583
|
-
bash "$PACKAGE_ROOT/scripts/install-afyx-graph.sh" "${graph_args[@]}"
|
|
594
|
+
afyx_run_install_operation afyx-graph "$graph_action" 'Preparing Afyx Graph runtime' bash "$PACKAGE_ROOT/scripts/install-afyx-graph.sh" "${graph_args[@]}"
|
|
584
595
|
graph_result="$graph_action"
|
|
585
596
|
fi
|
|
586
597
|
|
|
@@ -618,7 +629,7 @@ if [[ "$context_action" != skip ]]; then
|
|
|
618
629
|
[[ "$context_action" == update ]] && context_args+=(--update)
|
|
619
630
|
[[ "$context_action" == repair ]] && context_args+=(--repair)
|
|
620
631
|
"$dry_run" && context_args+=(--validate-only)
|
|
621
|
-
bash "$PACKAGE_ROOT/scripts/install-afyx-context.sh" "${context_args[@]}"
|
|
632
|
+
afyx_run_install_operation afyx-context "$context_action" 'Preparing Afyx Context runtime' bash "$PACKAGE_ROOT/scripts/install-afyx-context.sh" "${context_args[@]}"
|
|
622
633
|
context_result="$context_action"
|
|
623
634
|
fi
|
|
624
635
|
|
|
@@ -661,7 +672,7 @@ if [[ "$forge_action" != skip ]]; then
|
|
|
661
672
|
[[ "$forge_action" == update ]] && forge_args+=(--update)
|
|
662
673
|
[[ "$forge_action" == repair ]] && forge_args+=(--repair)
|
|
663
674
|
"$dry_run" && forge_args+=(--validate-only)
|
|
664
|
-
bash "$PACKAGE_ROOT/scripts/install-afyx-forge.sh" "${forge_args[@]}"
|
|
675
|
+
afyx_run_install_operation afyx-forge "$forge_action" 'Preparing Afyx Forge runtime' bash "$PACKAGE_ROOT/scripts/install-afyx-forge.sh" "${forge_args[@]}"
|
|
665
676
|
forge_result="$forge_action"
|
|
666
677
|
fi
|
|
667
678
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "afyx-engineering-kit",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.8",
|
|
4
4
|
"description": "Universal cross-platform CLI installer and lifecycle manager for AFYX Engineering Kit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./bin/afyx-engineering-kit.mjs",
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"afyx-graph/afyx-graph.json",
|
|
33
33
|
"afyx-graph/engine/release/afyx-graph-win32-x64.zip",
|
|
34
34
|
"afyx-graph/engine/release/afyx-graph-linux-x64.tar.gz",
|
|
35
|
+
"afyx-graph/engine/release/afyx-graph-darwin-arm64.tar.gz",
|
|
36
|
+
"afyx-graph/engine/release/afyx-graph-darwin-x64.tar.gz",
|
|
35
37
|
"afyx-graph/engine/release/SHA256SUMS",
|
|
36
38
|
"afyx-graph/engine/release/RELEASE-MANIFEST.json",
|
|
37
39
|
"afyx-graph/engine/scripts/distribution-product.json",
|