@aiwg/cli 2026.11.7 → 2026.11.9
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/README.md +1 -1
- package/agentic/code/addons/aiwg-hooks/hooks/aiwg-prompt-discovery.cjs +3 -2
- package/agentic/code/providers/capability-matrix.yaml +4 -4
- package/agentic/code/providers/model-capabilities.v1.json +169 -46
- package/agentic/code/providers/model-catalog.v1.json +17 -15
- package/bin/aiwg.mjs +3 -1
- package/dist/src/agents/agent-packager.js +3 -3
- package/dist/src/artifacts/cli.js +6 -2
- package/dist/src/artifacts/fortemi-core-sync.js +2 -0
- package/dist/src/artifacts/index-query-help.js +27 -0
- package/dist/src/artifacts/query-engine-installation.js +17 -4
- package/dist/src/artifacts/query-engine-name-intent.js +56 -0
- package/dist/src/artifacts/query-engine-scoring.js +14 -8
- package/dist/src/artifacts/query-engine-show-card.js +3 -3
- package/dist/src/cli/agent-spawn.js +4 -4
- package/dist/src/cli/handlers/best-practices-audit.js +1 -1
- package/dist/src/cli/handlers/bundle-deployment-mode.js +26 -13
- package/dist/src/cli/handlers/bundle-reconciliation.js +2 -2
- package/dist/src/cli/handlers/init.js +1 -1
- package/dist/src/cli/handlers/issues.js +5 -0
- package/dist/src/cli/handlers/marketplace-plugin-search.js +6 -5
- package/dist/src/cli/handlers/marketplace.js +1 -1
- package/dist/src/cli/handlers/models-muse-wrapper.js +32 -0
- package/dist/src/cli/handlers/models.js +5 -4
- package/dist/src/cli/handlers/refresh-artifact-freshness.js +51 -0
- package/dist/src/cli/handlers/refresh-bundles.js +3 -0
- package/dist/src/cli/handlers/refresh-managed-deployment.js +19 -7
- package/dist/src/cli/handlers/refresh-user-hooks.js +102 -0
- package/dist/src/cli/handlers/refresh.js +9 -3
- package/dist/src/cli/handlers/repo-access.js +15 -2
- package/dist/src/cli/handlers/sdlc-accelerate.js +1 -1
- package/dist/src/cli/handlers/steward.js +1 -1
- package/dist/src/cli/handlers/subcommands-bundles.js +1 -1
- package/dist/src/cli/handlers/subcommands-discovery.js +5 -0
- package/dist/src/cli/handlers/subcommands-list.js +1 -1
- package/dist/src/cli/handlers/subcommands-plugins.js +1 -1
- package/dist/src/cli/handlers/subcommands-storage.js +11 -0
- package/dist/src/cli/handlers/team.js +1 -1
- package/dist/src/cli/handlers/use-additive-bundles.js +9 -2
- package/dist/src/cli/handlers/use-bundle-counts.js +1 -1
- package/dist/src/cli/handlers/use-copy-selection.js +42 -0
- package/dist/src/cli/handlers/use.js +33 -38
- package/dist/src/cli/handlers/workspace-context.js +4 -0
- package/dist/src/cli/help-generator.js +1 -1
- package/dist/src/cli/new-project-options.js +46 -0
- package/dist/src/cli/router.js +15 -4
- package/dist/src/cli/scope-resolver.js +6 -6
- package/dist/src/cli/services/deployment-probe-scope.js +11 -0
- package/dist/src/cli/services/deployment-staleness.js +83 -0
- package/dist/src/cli/services/deployment-verification.js +20 -11
- package/dist/src/config/aiwg-config.js +1 -1
- package/dist/src/config/authorization-cli.js +36 -1
- package/dist/src/config/config-normalization.js +3 -1
- package/dist/src/config/worker-guidance-warning.js +8 -0
- package/dist/src/data/community.yaml +3 -3
- package/dist/src/extensions/commands/definitions.js +2 -2
- package/dist/src/extensions/manifest.js +27 -1
- package/dist/src/extensions/user-hook-diagnostics.js +18 -1
- package/dist/src/extensions/verified-hook-command.js +9 -0
- package/dist/src/features/catalog.js +2 -2
- package/dist/src/issues/cli.js +10 -2
- package/dist/src/marketplace/cache.js +31 -0
- package/dist/src/marketplace/plugin-search.js +39 -20
- package/dist/src/marketplace/public-search.js +122 -0
- package/dist/src/marketplace/registry.js +2 -0
- package/dist/src/marketplace/search-contract.js +19 -0
- package/dist/src/marketplace/sources/public-search.js +81 -0
- package/dist/src/mcp/cli.mjs +8 -7
- package/dist/src/mcp/credentials.mjs +1 -1
- package/dist/src/mcp/registry.js +6 -2
- package/dist/src/mcp/tool-filters.mjs +1 -1
- package/dist/src/memory/provider-memory-adapter.js +1 -1
- package/dist/src/models/catalog-policy.js +2 -1
- package/dist/src/models/config-loader.js +2 -1
- package/dist/src/models/cursor-models.js +92 -0
- package/dist/src/models/cursor-worker-version.d.mts +2 -0
- package/dist/src/models/cursor-worker-version.mjs +27 -0
- package/dist/src/models/model-capabilities.v1.json +169 -46
- package/dist/src/models/model-catalog.v1.json +17 -15
- package/dist/src/models/model-discovery.js +7 -6
- package/dist/src/models/policy-resources.js +1 -1
- package/dist/src/models/provider-policy.js +1 -1
- package/dist/src/models/worker-direct-readiness.js +8 -5
- package/dist/src/models/worker-health-readiness.js +4 -0
- package/dist/src/models/worker-installation.d.mts +5 -2
- package/dist/src/models/worker-installation.mjs +20 -12
- package/dist/src/models/worker-invocation-policy.js +22 -2
- package/dist/src/models/worker-plan.js +3 -1
- package/dist/src/models/worker-wiring-diagnostics.js +25 -0
- package/dist/src/models/wrapper-deployment.js +1 -1
- package/dist/src/models/wrapper-enforcement.js +6 -2
- package/dist/src/plugin/skill-command-frontmatter.js +1 -1
- package/dist/src/plugin/skill-command-translator.js +1 -1
- package/dist/src/policy/repo-access-workspace-spec.js +63 -0
- package/dist/src/policy/repo-access.js +22 -0
- package/dist/src/providers/capability-matrix.yaml +4 -4
- package/dist/src/providers/deployment-ownership.mjs +1 -1
- package/dist/src/providers/deployment-preservation.mjs +10 -5
- package/dist/src/providers/deployment-removal.js +1 -1
- package/dist/src/providers/devin-compat.d.mts +4 -0
- package/dist/src/providers/devin-compat.mjs +29 -0
- package/dist/src/providers/grok-build-acp.js +39 -9
- package/dist/src/providers/grok-build-paths.js +8 -7
- package/dist/src/providers/provider-context-contracts.js +7 -3
- package/dist/src/providers/provider-definition-schema.js +1 -1
- package/dist/src/providers/provider-definitions.js +1 -1
- package/dist/src/providers/provider-definitions.mjs +3 -3
- package/dist/src/providers/provider-inventory.js +13 -1
- package/dist/src/providers/provider-seeds-1.js +1 -1
- package/dist/src/providers/provider-seeds-3.js +10 -9
- package/dist/src/providers/transformation-receipt-integration.js +1 -1
- package/dist/src/sessions/adapters/windsurf.js +7 -7
- package/dist/src/sessions/grok-build-cli-output.js +1 -1
- package/dist/src/sessions/grok-build-cli.js +7 -1
- package/dist/src/skills/bundle-import-cli.js +61 -0
- package/dist/src/skills/bundle-import-plan.js +108 -0
- package/dist/src/skills/bundle-import.js +192 -0
- package/dist/src/skills/cli.js +5 -0
- package/dist/src/skills/deployment-policy.js +1 -1
- package/dist/src/skills/importer.js +4 -4
- package/dist/src/smiths/agentsmith/demo.js +1 -1
- package/dist/src/smiths/agentsmith/examples.js +6 -6
- package/dist/src/smiths/commandsmith/generator.js +1 -1
- package/dist/src/smiths/context-pipeline/allowlist.js +1 -1
- package/dist/src/smiths/context-pipeline/muse-bridge.js +7 -4
- package/dist/src/smiths/context-pipeline/parallelism-section.js +2 -2
- package/dist/src/smiths/context-pipeline/workspace-audit.js +37 -6
- package/dist/src/smiths/context-pipeline/workspace-bootstrap.js +3 -1
- package/dist/src/smiths/context-pipeline/workspace-doctor.js +16 -4
- package/dist/src/smiths/context-pipeline/workspace-document.js +4 -2
- package/dist/src/smiths/hook-bridge/codex-trust.js +56 -7
- package/dist/src/smiths/hook-bridge/cursor-translator.js +89 -0
- package/dist/src/smiths/hook-bridge/index.js +4 -1
- package/dist/src/smiths/skillsmith/collision-detector.js +1 -1
- package/dist/src/smiths/skillsmith/namespace-adapter.js +1 -1
- package/dist/src/smiths/skillsmith/platform-resolver.js +2 -2
- package/dist/src/writing/campaign-report.js +4 -3
- package/dist/src/writing/contextual-diagnostics.js +29 -3
- package/dist/src/writing/current-patterns.catalogue.json +4 -4
- package/dist/src/writing/current-patterns.js +3 -2
- package/dist/src/writing/structural-judgment.catalogue.json +17 -0
- package/dist/src/writing/structural-judgment.js +33 -0
- package/dist/src/writing/structural-patterns.js +78 -6
- package/dist/src/writing/validation-campaign.js +3 -0
- package/dist/src/writing/validation-engine.js +7 -4
- package/package.json +4 -2
- package/schemas/models/model-config-compatibility.v1.schema.json +1 -1
- package/tools/agents/deploy-agents.mjs +12 -10
- package/tools/agents/deploy-options.mjs +1 -0
- package/tools/agents/providers/base-behaviors.mjs +1 -1
- package/tools/agents/providers/base-contract.mjs +1 -1
- package/tools/agents/providers/base-kernel-skills.mjs +1 -1
- package/tools/agents/providers/base-models-platforms.mjs +9 -7
- package/tools/agents/providers/base-rule-index.mjs +1 -1
- package/tools/agents/providers/codex.mjs +1 -0
- package/tools/agents/providers/cursor-prompt-discovery.mjs +13 -0
- package/tools/agents/providers/cursor.mjs +2 -0
- package/tools/agents/providers/devin.mjs +3 -0
- package/tools/agents/providers/grok-build.mjs +14 -19
- package/tools/agents/providers/hook-capabilities.mjs +1 -1
- package/tools/agents/providers/model-wrapper.mjs +1 -1
- package/tools/agents/providers/openclaw-context.mjs +6 -0
- package/tools/agents/providers/openclaw.mjs +14 -12
- package/tools/agents/providers/rule-delivery-surface.mjs +15 -11
- package/tools/agents/providers/rule-deployment-prepare.mjs +9 -8
- package/tools/agents/providers/rule-presentation.mjs +1 -1
- package/tools/agents/providers/rule-projection.mjs +5 -5
- package/tools/agents/providers/rule-startup.mjs +4 -2
- package/tools/agents/providers/skill-copy-prune.mjs +5 -1
- package/tools/agents/providers/windsurf.mjs +26 -26
- package/tools/agents/use-rule-selection.mjs +1 -1
- package/tools/cli/workspace-deployment-health.mjs +38 -0
- package/tools/cli/workspace-status.mjs +5 -2
- package/tools/daemon/provider-watcher.mjs +3 -3
- package/tools/plugin/package-plugins.mjs +16 -2
- package/tools/ralph-external/lib/deepseek-harness-adapter.mjs +36 -22
- package/tools/ralph-external/lib/factory-adapter.mjs +13 -28
- package/tools/ralph-external/lib/factory-stream-final.mjs +31 -0
- package/tools/skills/deploy-skills-codex.mjs +2 -1
- package/vscode-extension/schemas/aiwg.config.v1.json +15 -1
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
* performs no live-qualification recording and requires no evidence files.
|
|
58
58
|
*/
|
|
59
59
|
import { tmpdir } from 'node:os';
|
|
60
|
+
import { cursorWorkerVersionWarning } from './cursor-worker-version.mjs';
|
|
60
61
|
import { advisoryStatus, allConfiguredCliIds, checkDispatchEligibility, describeConfigContext, isCliRequired, memberLabels, memberReferences, resolveDirectBinding, SMOKE_NOTE, } from './worker-direct-readiness-policy.js';
|
|
61
62
|
import { isAbsolute, resolve as resolvePath } from 'node:path';
|
|
62
63
|
import { boundedVersionProbe, normalizeWorkerVersionBanner, workerVersionProbeDefaults, workerVersionProbeEnvironment, workerVersionRangeMismatch, } from './worker-installation.mjs';
|
|
@@ -133,7 +134,7 @@ export async function diagnoseDirectWorkerReadiness(input) {
|
|
|
133
134
|
}
|
|
134
135
|
const pushInstall = (finding) => {
|
|
135
136
|
report.findings.push({ ...finding, kind: 'install', eligibility: null, eligibilityDetail: null });
|
|
136
|
-
if (finding.status === 'error' || finding.status === 'warn')
|
|
137
|
+
if (finding.readiness !== 'ready' && (finding.status === 'error' || finding.status === 'warn'))
|
|
137
138
|
report.ready = false;
|
|
138
139
|
};
|
|
139
140
|
const pushDispatch = (cli, profile, status, code, eligibility, detail, configKey, members, nextAction, diagnostics) => {
|
|
@@ -234,7 +235,7 @@ export async function diagnoseDirectWorkerReadiness(input) {
|
|
|
234
235
|
const rawBanner = outcome.rawBanner.trim();
|
|
235
236
|
let installedVersion;
|
|
236
237
|
try {
|
|
237
|
-
installedVersion = normalizeWorkerVersionBanner(rawBanner, adapter.invocation.versionPattern);
|
|
238
|
+
installedVersion = normalizeWorkerVersionBanner(rawBanner, adapter.invocation.versionPattern, adapter.provider);
|
|
238
239
|
}
|
|
239
240
|
catch {
|
|
240
241
|
pushInstall({ cli, profile: profileRef, executable, installedVersion: null,
|
|
@@ -246,7 +247,7 @@ export async function diagnoseDirectWorkerReadiness(input) {
|
|
|
246
247
|
pushDispatch(cli, profileRef, 'warn', 'WORKER_DIRECT_DISPATCH_BLOCKED', eligibility, detail, configKey, members, 'reinstall-supported-cli', diagnostics);
|
|
247
248
|
return;
|
|
248
249
|
}
|
|
249
|
-
const mismatch = workerVersionRangeMismatch(installedVersion, [profile.supportedVersions, adapter.supportedVersions]);
|
|
250
|
+
const mismatch = workerVersionRangeMismatch(installedVersion, [profile.supportedVersions, adapter.supportedVersions], adapter.provider);
|
|
250
251
|
if (mismatch) {
|
|
251
252
|
pushInstall({ cli, profile: profileRef, executable, installedVersion,
|
|
252
253
|
status: advisoryStatus('warn', required), code: 'WORKER_DIRECT_VERSION_OUT_OF_RANGE',
|
|
@@ -257,9 +258,11 @@ export async function diagnoseDirectWorkerReadiness(input) {
|
|
|
257
258
|
pushDispatch(cli, profileRef, 'warn', 'WORKER_DIRECT_DISPATCH_BLOCKED', eligibility, detail, configKey, members, 'upgrade-or-pin-cli', diagnostics);
|
|
258
259
|
return;
|
|
259
260
|
}
|
|
261
|
+
const versionWarning = adapter.provider === 'cursor'
|
|
262
|
+
? cursorWorkerVersionWarning(installedVersion, profile.health?.provenance?.map(row => row.cliVersion) ?? [], cli) : null;
|
|
260
263
|
pushInstall({ cli, profile: profileRef, executable, installedVersion,
|
|
261
|
-
status: 'ok', code: 'WORKER_DIRECT_READY',
|
|
262
|
-
message: `CLI '${executable}' version ${installedVersion} matches profile '${profileRef}' for cli '${cli}' (config ${configFile} key ${configKey}). Installation readiness: ready. ${SMOKE_NOTE} See the dispatch finding for whether the resolver would dispatch. (${describeConfigContext(members)})`,
|
|
264
|
+
status: versionWarning ? 'warn' : 'ok', code: 'WORKER_DIRECT_READY',
|
|
265
|
+
message: `CLI '${executable}' version ${installedVersion} matches profile '${profileRef}' for cli '${cli}' (config ${configFile} key ${configKey}). Installation readiness: ready. ${versionWarning ?? ''} ${SMOKE_NOTE} See the dispatch finding for whether the resolver would dispatch. (${describeConfigContext(members)})`,
|
|
263
266
|
nextAction: 'qualify-installed-cli',
|
|
264
267
|
configFile, configKey, readiness: 'ready', members });
|
|
265
268
|
const { eligibility, detail, diagnostics } = checkDispatchEligibility(parallelism, registry, cli, true, resolverSnapshot, refs);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Offline S1 health readiness projection; never launch authority or a probe. */
|
|
2
|
+
import { workerWiringDiagnostics } from './worker-wiring-diagnostics.js';
|
|
2
3
|
import { homedir } from 'node:os';
|
|
3
4
|
import { collectLocalOnlyPaths } from './conductor-data-policy.mjs';
|
|
4
5
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
@@ -119,6 +120,9 @@ export function diagnoseWorkerHealthReadiness(snapshot, request, paths = {}) {
|
|
|
119
120
|
nextAction: 'use-direct-checkpoint', role: null });
|
|
120
121
|
return report;
|
|
121
122
|
}
|
|
123
|
+
for (const diagnostic of workerWiringDiagnostics(p, snapshot.models.defaults.workerSelection)) {
|
|
124
|
+
add({ ...diagnostic, status: 'warn', role: null, nextAction: 'review-worker-configuration' });
|
|
125
|
+
}
|
|
122
126
|
const enabledGroups = Object.values(p?.groups ?? {});
|
|
123
127
|
const required = new Set(enabledGroups.flatMap(group => group.requiredRoles ?? []));
|
|
124
128
|
const roles = new Set([...Object.keys(snapshot.models.defaults.workerSelection?.roleGuidance ?? {}), ...required]);
|
|
@@ -18,11 +18,11 @@ export function loadRecordedWorkerInstallations(input: {
|
|
|
18
18
|
export function hasProvider(name: string): boolean;
|
|
19
19
|
|
|
20
20
|
export function compileWorkerVersionPattern(pattern: string): RegExp;
|
|
21
|
-
export function normalizeWorkerVersionBanner(banner: string, pattern?: string): string;
|
|
21
|
+
export function normalizeWorkerVersionBanner(banner: string, pattern?: string, provider?: string): string;
|
|
22
22
|
export const workerVersionProbeEnvAllowlist: readonly string[];
|
|
23
23
|
export function workerVersionProbeEnvironment(source?: Record<string, string | undefined>): Record<string, string>;
|
|
24
24
|
export const workerVersionProbeDefaults: { readonly timeoutMs: number; readonly maxBytes: number };
|
|
25
|
-
export function workerVersionRangeMismatch(version: string, ranges: string[]): string | null;
|
|
25
|
+
export function workerVersionRangeMismatch(version: string, ranges: string[], provider?: string): string | null;
|
|
26
26
|
export function boundedVersionProbe(
|
|
27
27
|
executable: string,
|
|
28
28
|
argv: string[],
|
|
@@ -31,6 +31,7 @@ export function boundedVersionProbe(
|
|
|
31
31
|
timeoutMs: number,
|
|
32
32
|
maxBytes: number,
|
|
33
33
|
versionPattern: string | undefined,
|
|
34
|
+
provider?: string,
|
|
34
35
|
): Promise<{ rawBanner: string; version: string }>;
|
|
35
36
|
|
|
36
37
|
export interface WorkerRecoveryCapabilities {
|
|
@@ -47,6 +48,8 @@ export function inspectRecordedWorkerQualifications(input: {
|
|
|
47
48
|
cwd: string; policy: WorkerSelectionPolicy; parallelism: import('../config/aiwg-config.js').ParallelismConfig;
|
|
48
49
|
/** Include signed historical inputs for offline health projection, never launch authority. */
|
|
49
50
|
includeInputs?: boolean;
|
|
51
|
+
/** Signed policy drift only; rejected records never grant authority. */
|
|
52
|
+
diagnostics?: import('./types.js').WorkerPolicyDiagnostic[];
|
|
50
53
|
}): Promise<Array<{ cli: string; provider: string; binding?: WorkerResolutionBinding;
|
|
51
54
|
adapter?: import('./provider-policy.js').WorkerAdapterMetadata;
|
|
52
55
|
observations?: import('./model-discovery.js').ProviderModelDiscovery }>>;
|
|
@@ -9,6 +9,7 @@ import { pathToFileURL } from 'node:url';
|
|
|
9
9
|
import { createHash } from 'node:crypto';
|
|
10
10
|
import { parse } from 'acorn';
|
|
11
11
|
import { satisfies, valid, validRange } from 'semver';
|
|
12
|
+
import { workerComparableVersion } from './cursor-worker-version.mjs';
|
|
12
13
|
|
|
13
14
|
// Recovery metadata belongs to the installed driver identity, never its shape.
|
|
14
15
|
const workerRecoveryCapabilities = new WeakMap();
|
|
@@ -138,7 +139,7 @@ export async function qualifyWorkerInstallation(instance, options) {
|
|
|
138
139
|
const { evidence } = request;
|
|
139
140
|
const { rawBanner, version } = await boundedVersionProbe(scope.binary.realpath,
|
|
140
141
|
request.adapter.invocation.versionArgv, request.environment ?? {}, request.cwd,
|
|
141
|
-
request.timeoutMs ?? 10_000, Math.min(request.maxBytes ?? 4096, 4096), request.adapter.invocation.versionPattern);
|
|
142
|
+
request.timeoutMs ?? 10_000, Math.min(request.maxBytes ?? 4096, 4096), request.adapter.invocation.versionPattern, request.adapter.provider);
|
|
142
143
|
if (version !== request.cliVersion) throw new Error('Installed CLI version changed');
|
|
143
144
|
if (request.versionProbe) {
|
|
144
145
|
const pattern = request.adapter.invocation.versionPattern;
|
|
@@ -373,7 +374,7 @@ export function compileWorkerVersionPattern(pattern) {
|
|
|
373
374
|
return new RegExp(pattern, 'u');
|
|
374
375
|
}
|
|
375
376
|
|
|
376
|
-
export function normalizeWorkerVersionBanner(banner, pattern) {
|
|
377
|
+
export function normalizeWorkerVersionBanner(banner, pattern, provider) {
|
|
377
378
|
if (typeof banner !== 'string' || Buffer.byteLength(banner) > 4096) throw new Error('Worker version banner exceeds bound');
|
|
378
379
|
if (pattern === undefined) return banner;
|
|
379
380
|
const match = compileWorkerVersionPattern(pattern).exec(banner);
|
|
@@ -383,7 +384,8 @@ export function normalizeWorkerVersionBanner(banner, pattern) {
|
|
|
383
384
|
// prerelease and build identifiers remain byte-for-byte unchanged.
|
|
384
385
|
const version = match[1].replace(/^([0-9]+)\.([0-9]+)\.([0-9]+)/,
|
|
385
386
|
(_, major, minor, patch) => [major, minor, patch].map(n => String(Number(n))).join('.'));
|
|
386
|
-
if (!/^[0-9]+\.[0-9]+\.[0-9]+(?:-|\+|$)/.test(version)
|
|
387
|
+
if (!/^[0-9]+\.[0-9]+\.[0-9]+(?:-|\+|$)/.test(version)
|
|
388
|
+
|| !(provider === 'cursor' ? workerComparableVersion(version, provider) : valid(version))) throw new Error('Worker version capture is not semver');
|
|
387
389
|
return version;
|
|
388
390
|
}
|
|
389
391
|
|
|
@@ -415,15 +417,15 @@ export const workerVersionProbeDefaults = Object.freeze({ timeoutMs: 10_000, max
|
|
|
415
417
|
// Shared semver range check for an installed CLI version. Returns the first
|
|
416
418
|
// unsupported range (or the invalid range declaration), else null. Read-only
|
|
417
419
|
// surfaces reuse this instead of re-deriving the inspector's range logic.
|
|
418
|
-
export function workerVersionRangeMismatch(version, ranges) {
|
|
420
|
+
export function workerVersionRangeMismatch(version, ranges, provider) {
|
|
419
421
|
for (const range of ranges) {
|
|
420
422
|
if (typeof range !== 'string' || !validRange(range)) return `Unsupported version range '${range}'`;
|
|
421
|
-
if (!satisfies(version, range)) return range;
|
|
423
|
+
if (!satisfies(workerComparableVersion(version, provider), range)) return range;
|
|
422
424
|
}
|
|
423
425
|
return null;
|
|
424
426
|
}
|
|
425
427
|
|
|
426
|
-
export function boundedVersionProbe(executable, argv, environment, cwd, timeoutMs, maxBytes, versionPattern) {
|
|
428
|
+
export function boundedVersionProbe(executable, argv, environment, cwd, timeoutMs, maxBytes, versionPattern, provider) {
|
|
427
429
|
if (!Number.isInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 10_000
|
|
428
430
|
|| !Number.isInteger(maxBytes) || maxBytes < 1 || maxBytes > 5 * 1024 * 1024
|
|
429
431
|
|| !Array.isArray(argv) || argv.some(arg => typeof arg !== 'string' || arg.includes('\0'))) {
|
|
@@ -433,7 +435,7 @@ export function boundedVersionProbe(executable, argv, environment, cwd, timeoutM
|
|
|
433
435
|
// process forked while the file was being written or a CLI mid-update. It
|
|
434
436
|
// clears in milliseconds, so retry the spawn within the same overall bound.
|
|
435
437
|
const deadline = Date.now() + timeoutMs;
|
|
436
|
-
const attempt = delayMs => runBoundedVersionProbe(executable, argv, environment, cwd, timeoutMs, maxBytes, versionPattern)
|
|
438
|
+
const attempt = delayMs => runBoundedVersionProbe(executable, argv, environment, cwd, timeoutMs, maxBytes, versionPattern, provider)
|
|
437
439
|
.catch(error => {
|
|
438
440
|
if (error?.code !== 'ETXTBSY' || Date.now() + delayMs >= deadline) throw error;
|
|
439
441
|
return new Promise(resolveDelay => setTimeout(resolveDelay, delayMs)).then(() => attempt(Math.min(delayMs * 2, 200)));
|
|
@@ -441,7 +443,7 @@ export function boundedVersionProbe(executable, argv, environment, cwd, timeoutM
|
|
|
441
443
|
return attempt(10);
|
|
442
444
|
}
|
|
443
445
|
|
|
444
|
-
function runBoundedVersionProbe(executable, argv, environment, cwd, timeoutMs, maxBytes, versionPattern) {
|
|
446
|
+
function runBoundedVersionProbe(executable, argv, environment, cwd, timeoutMs, maxBytes, versionPattern, provider) {
|
|
445
447
|
return new Promise((resolve, reject) => {
|
|
446
448
|
const child = spawn(executable, argv, { cwd, env: environment, stdio: 'pipe', detached: true, shell: false });
|
|
447
449
|
let output = Buffer.alloc(0);
|
|
@@ -481,7 +483,7 @@ function runBoundedVersionProbe(executable, argv, environment, cwd, timeoutMs, m
|
|
|
481
483
|
else {
|
|
482
484
|
try {
|
|
483
485
|
const rawBanner = new TextDecoder('utf-8', { fatal: true }).decode(output);
|
|
484
|
-
resolve({ rawBanner, version: normalizeWorkerVersionBanner(rawBanner.trim(), versionPattern) });
|
|
486
|
+
resolve({ rawBanner, version: normalizeWorkerVersionBanner(rawBanner.trim(), versionPattern, provider) });
|
|
485
487
|
}
|
|
486
488
|
catch (error) { reject(error); }
|
|
487
489
|
}
|
|
@@ -754,7 +756,7 @@ async function qualificationSignatureFailure(record, trust) {
|
|
|
754
756
|
* This is historical evidence, not current launch authority; loadRecordedWorkerInstallations
|
|
755
757
|
* performs binary/version/scope checks when dispatch actually requests a binding.
|
|
756
758
|
*/
|
|
757
|
-
export async function inspectRecordedWorkerQualifications({ cwd, policy, parallelism, includeInputs = false }) {
|
|
759
|
+
export async function inspectRecordedWorkerQualifications({ cwd, policy, parallelism, includeInputs = false, diagnostics = [] }) {
|
|
758
760
|
const filename = installationStorePath();
|
|
759
761
|
await assertTrustedStore(filename, [cwd]);
|
|
760
762
|
const { stored } = await readInstallationStore(filename);
|
|
@@ -767,8 +769,8 @@ export async function inspectRecordedWorkerQualifications({ cwd, policy, paralle
|
|
|
767
769
|
const configured = parallelism?.clis?.[cli];
|
|
768
770
|
if (!configured || configured.enabled === false || !/^[a-z][a-z0-9-]{0,62}$/.test(cli)
|
|
769
771
|
|| await realpath(installation.cwd) !== workspace
|
|
770
|
-
|| qualificationDigest(policy) !== installation.effectiveConfigDigest
|
|
771
772
|
|| (installation.localModelsDigest || configured.localModels) && installation.localModelsDigest !== qualificationDigest(configured.localModels ?? null)
|
|
773
|
+
|| (installation.modelLimitsDigest || configured.modelLimits) && installation.modelLimitsDigest !== qualificationDigest(configured.modelLimits ?? null)
|
|
772
774
|
|| configured.adapter !== `providers:${adapter.provider}` && configured.adapter !== adapter.id
|
|
773
775
|
|| configured.accountScope !== binding.accountScope
|
|
774
776
|
|| binding.profile !== installation.profile || binding.cliVersion !== installation.cliVersion
|
|
@@ -776,6 +778,11 @@ export async function inspectRecordedWorkerQualifications({ cwd, policy, paralle
|
|
|
776
778
|
const proof = adapter.invocationProfiles?.[binding.profile]?.installationQualification;
|
|
777
779
|
if (!proof || ['scopeDigest', 'fixtureDigest', 'verifiedAt', 'evidenceRef'].some(key => proof[key] !== installation.evidence?.[key])) continue;
|
|
778
780
|
if (await qualificationSignatureFailure(record, () => qualificationTrust(cwd))) continue;
|
|
781
|
+
if (qualificationDigest(policy) !== installation.effectiveConfigDigest) {
|
|
782
|
+
const { workerQualificationPolicyDiagnostic } = await import('./worker-qualification-policy.js');
|
|
783
|
+
diagnostics.push(workerQualificationPolicyDiagnostic([{ registration: 0, reason: 'effective-config-digest' }], [record], policy));
|
|
784
|
+
continue;
|
|
785
|
+
}
|
|
779
786
|
await assertWorkerInstallationEvidence({ ...installation, adapter, now: Date.now(), policy }, proof.scopeDigest);
|
|
780
787
|
results.push({ cli, provider: adapter.provider, ...(includeInputs
|
|
781
788
|
? { binding: structuredClone(binding), adapter: structuredClone(adapter), observations: structuredClone(record.modelObservations) } : {}) });
|
|
@@ -917,6 +924,7 @@ export async function loadRecordedWorkerInstallations({ registry, cwd, policy, p
|
|
|
917
924
|
|| binding.accountScope !== installation.accountScope
|
|
918
925
|
|| qualificationDigest(binding.boundary) !== qualificationDigest(installation.boundary)) throw fail();
|
|
919
926
|
if (parallelism && (installation.localModelsDigest || parallelism.clis?.[cli]?.localModels) && installation.localModelsDigest !== qualificationDigest(parallelism.clis?.[cli]?.localModels ?? null)) throw fail();
|
|
927
|
+
if (parallelism && (installation.modelLimitsDigest || parallelism.clis?.[cli]?.modelLimits) && installation.modelLimitsDigest !== qualificationDigest(parallelism.clis?.[cli]?.modelLimits ?? null)) throw fail();
|
|
920
928
|
reason = 'effective-config-digest';
|
|
921
929
|
if (qualificationDigest(policy) !== installation.effectiveConfigDigest) throw fail();
|
|
922
930
|
reason = 'evidence';
|
|
@@ -982,7 +990,7 @@ export async function loadRecordedWorkerInstallations({ registry, cwd, policy, p
|
|
|
982
990
|
const { version } = await boundedVersionProbe(scope.binary.realpath,
|
|
983
991
|
adapter.invocation.versionArgv, workerVersionProbeEnvironment(), cwd,
|
|
984
992
|
workerVersionProbeDefaults.timeoutMs, workerVersionProbeDefaults.maxBytes,
|
|
985
|
-
adapter.invocation.versionPattern);
|
|
993
|
+
adapter.invocation.versionPattern, adapter.provider);
|
|
986
994
|
if (version !== binding.cliVersion) throw fail();
|
|
987
995
|
reason = 'scope-digest';
|
|
988
996
|
if ((await inspectWorkerInstallation(instance, installation)).scopeDigest !== scope.scopeDigest) throw fail();
|
|
@@ -45,7 +45,7 @@ export function isOperatorQualifiedWorkerAdapter(adapter) {
|
|
|
45
45
|
}
|
|
46
46
|
/** Bundled renderers with an independently checked native direct baseline. */
|
|
47
47
|
export function hasOperatorWorkerNativeRenderer(adapter) {
|
|
48
|
-
return isOperatorQualifiedWorkerAdapter(adapter) && ['codex', 'muse', 'factory'].includes(adapter.provider)
|
|
48
|
+
return isOperatorQualifiedWorkerAdapter(adapter) && ['codex', 'muse', 'factory', 'cursor'].includes(adapter.provider)
|
|
49
49
|
&& adapter.invocation.kind === 'process';
|
|
50
50
|
}
|
|
51
51
|
/** The process-group launch boundary requires the independently verified native renderer. */
|
|
@@ -73,6 +73,26 @@ export function assertOperatorWorkerNativeArgv(adapter, argv, selected, permissi
|
|
|
73
73
|
const sandbox = permissions?.sandbox ?? 'workspace-write';
|
|
74
74
|
if (!['read-only', 'workspace-write', 'external'].includes(sandbox))
|
|
75
75
|
throw new Error('Requested sandbox has no verified native renderer');
|
|
76
|
+
if (adapter.provider === 'cursor') {
|
|
77
|
+
if (sandbox === 'external' || (permissions?.approval ?? 'never') !== 'never') {
|
|
78
|
+
throw new Error('Cursor direct worker requires native sandbox and never approval');
|
|
79
|
+
}
|
|
80
|
+
if (!selected.model || /[\0[\]"]/.test(selected.model)
|
|
81
|
+
|| ['opus', 'sonnet', 'haiku', 'auto', 'default'].includes(selected.model.toLowerCase())
|
|
82
|
+
|| selected.effort.value === null || !/^[A-Za-z0-9_.-]+$/.test(selected.effort.value)) {
|
|
83
|
+
throw new Error('Cursor direct worker requires an exact model ID and explicit effort metadata');
|
|
84
|
+
}
|
|
85
|
+
const cwd = args[args.indexOf('--workspace') + 1];
|
|
86
|
+
if (!args.includes('--workspace') || !cwd?.startsWith('/') || cwd.includes('\0')) {
|
|
87
|
+
throw new Error('Cursor direct worker requires an absolute workspace');
|
|
88
|
+
}
|
|
89
|
+
const expected = ['-p', '--output-format', 'stream-json', '--trust', '--sandbox', 'enabled',
|
|
90
|
+
...(sandbox === 'read-only' ? ['--mode', 'ask'] : []), '--workspace', cwd, '--model', selected.model];
|
|
91
|
+
if (args.length !== expected.length || args.some((value, index) => value !== expected[index])) {
|
|
92
|
+
throw new Error('Cursor native worker controls could be overridden');
|
|
93
|
+
}
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
76
96
|
if (adapter.provider === 'factory') {
|
|
77
97
|
if (sandbox === 'external' || (permissions?.approval ?? 'never') !== 'never') {
|
|
78
98
|
throw new Error('Factory direct worker requires native sandbox and never approval');
|
|
@@ -180,7 +200,7 @@ export function inspectWorkerInvocationProfile(adapter, selection) {
|
|
|
180
200
|
// Shared range predicate (worker-installation.mjs): read-only surfaces
|
|
181
201
|
// (worker-direct-readiness.ts) reuse the same helper instead of
|
|
182
202
|
// re-deriving this inspector's range logic.
|
|
183
|
-
if (workerVersionRangeMismatch(selection.cliVersion, [adapter.supportedVersions, profile.supportedVersions]) !== null) {
|
|
203
|
+
if (workerVersionRangeMismatch(selection.cliVersion, [adapter.supportedVersions, profile.supportedVersions], adapter.provider) !== null) {
|
|
184
204
|
throw new Error('Worker CLI version is outside qualified profile');
|
|
185
205
|
}
|
|
186
206
|
// The direct CLI baseline trusts the installed driver's bounded renderer.
|
|
@@ -124,10 +124,12 @@ export function resolveWorkerPlan(snapshot, request, ceilingDefaults = {}) {
|
|
|
124
124
|
if (request.member && !request.group)
|
|
125
125
|
block('OG_CONFIG_REFERENCE', '/request/member', 'Group-local member pins require a group');
|
|
126
126
|
if (request.group && !guidance?.groups.includes(request.group))
|
|
127
|
-
block('OG_CONFIG_REFERENCE', '/request/group',
|
|
127
|
+
block('OG_CONFIG_REFERENCE', '/request/group', `Group is outside role guidance. Edit models.json: add ${JSON.stringify(request.group)} to defaults.workerSelection.roleGuidance.${role}.groups.`);
|
|
128
128
|
if ([request.maxParallel, snapshot.constraints?.maxParallel].some(value => value !== undefined && (!Number.isSafeInteger(value) || value < 0)))
|
|
129
129
|
block('OG_CONFIG_REFERENCE', '/request/maxParallel', 'Capacity ceilings must be nonnegative integers');
|
|
130
130
|
plan.diagnostics.push(...workerReviewLineageDiagnostics(request));
|
|
131
|
+
if (plan.diagnostics.some(diagnostic => diagnostic.code === 'OG_CONFIG_REFERENCE'))
|
|
132
|
+
return plan;
|
|
131
133
|
const candidateGroups = request.group ? [request.group] : guidance?.groups ?? [];
|
|
132
134
|
const unqualifiedGroups = new Set(qualificationGaps.map(gapGroup));
|
|
133
135
|
const qualifiedGroups = candidateGroups.filter(groupId => !unqualifiedGroups.has(groupId));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Audit declared worker routes without granting qualification or launch authority.
|
|
2
|
+
import { expandWorkerGroupTemplates } from '../config/worker-group-templates.js';
|
|
3
|
+
export function workerWiringDiagnostics(parallelism, policy) {
|
|
4
|
+
const groups = expandWorkerGroupTemplates(parallelism).parallelism?.groups ?? {};
|
|
5
|
+
const diagnostics = [];
|
|
6
|
+
for (const [id, group] of Object.entries(groups)) {
|
|
7
|
+
const roles = new Set([...group.members.filter(member => member.enabled !== false
|
|
8
|
+
&& parallelism?.clis?.[member.cli]?.enabled !== false).flatMap(member => member.roles), ...group.requiredRoles ?? []]);
|
|
9
|
+
for (const role of roles) {
|
|
10
|
+
if (policy?.roleGuidance?.[role]?.groups.includes(id))
|
|
11
|
+
continue;
|
|
12
|
+
diagnostics.push({ code: 'OG_CONFIG_REFERENCE', pointer: `/defaults/workerSelection/roleGuidance/${role}/groups`,
|
|
13
|
+
message: `Group ${JSON.stringify(id)} is outside role guidance for ${role}. Edit models.json: add ${JSON.stringify(id)} to defaults.workerSelection.roleGuidance.${role}.groups.`,
|
|
14
|
+
roles: [role] });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
for (const cli of Object.keys(parallelism?.clis ?? {})) {
|
|
18
|
+
if (Object.values(groups).some(group => group.members.some(member => member.cli === cli)))
|
|
19
|
+
continue;
|
|
20
|
+
diagnostics.push({ code: 'OG_CONFIG_REFERENCE', pointer: `/parallelism/clis/${cli}`, blocking: false,
|
|
21
|
+
message: `Declared CLI ${JSON.stringify(cli)} is used by no group. Add a member with cli=${JSON.stringify(cli)} to parallelism.groups in .aiwg/aiwg.config, or remove parallelism.clis.${cli}.` });
|
|
22
|
+
}
|
|
23
|
+
return diagnostics;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=worker-wiring-diagnostics.js.map
|
|
@@ -107,7 +107,7 @@ async function validateArtifact(file, definition, expectation) {
|
|
|
107
107
|
return mismatches;
|
|
108
108
|
}
|
|
109
109
|
const fields = artifactFields(file, content)
|
|
110
|
-
?? (expectation.provider === '
|
|
110
|
+
?? (expectation.provider === 'devin' && content.includes(`### ${wrapper}`) ? { name: wrapper } : null);
|
|
111
111
|
if (!fields) {
|
|
112
112
|
addMismatch(mismatches, wrapper, file, 'format', 'wrapper artifact is malformed or has no parseable metadata');
|
|
113
113
|
return mismatches;
|
|
@@ -47,9 +47,13 @@ export function wrapperModelRisks(provider, artifact, catalog = loadProviderMode
|
|
|
47
47
|
const premium = !!state.effectiveModel && (Object.values(catalog.providers)
|
|
48
48
|
.some(entry => matches([entry?.tiers?.premium?.id, entry?.roles.reasoning.id]))
|
|
49
49
|
|| (provider === 'claude' && state.effectiveModel === 'opus'));
|
|
50
|
+
// Muse's explicit session setting elects its sole catalog model without cross-provider pins.
|
|
51
|
+
const muse = catalog.providers.muse;
|
|
52
|
+
const museSessionElected = provider === 'muse' && !!muse && !muse.tiers
|
|
53
|
+
&& Object.values(muse.roles).every(entry => entry.id === artifact.inheritedModel);
|
|
50
54
|
// Flagship always needs an operator election, pinned or not. Premium is a normal ladder tier
|
|
51
55
|
// (the reasoning role's default), so it is a risk only when a wrapper inherits it.
|
|
52
|
-
if ((flagship || (premium && state.model !== 'pinned')) && !flagshipElected(artifact)) {
|
|
56
|
+
if ((flagship || (premium && state.model !== 'pinned' && !museSessionElected)) && !flagshipElected(artifact)) {
|
|
53
57
|
findings.push('delegation.flagship-inheritance');
|
|
54
58
|
}
|
|
55
59
|
return findings;
|
|
@@ -97,7 +101,7 @@ export function wrapperEnforcementReport(provider, artifact) {
|
|
|
97
101
|
openclaw: 'Markdown wrapper mirrors do not set native subagents.model or per-spawn overrides.',
|
|
98
102
|
openhuman: 'User harness wrappers carry semantic model hints; project wrappers omit model. Neither is an exact pin.',
|
|
99
103
|
antigravity: 'Wrapper mirrors do not project native CLI model/effort flags.',
|
|
100
|
-
|
|
104
|
+
devin: 'Portable wrapper model selection is unsupported; the main UI session controls selection.',
|
|
101
105
|
pi: 'Agents are reference skills; CLI model/thinking flags are separate from deployed wrappers.',
|
|
102
106
|
'deepseek-harness': 'Agent references do not pin the configured Harness route.',
|
|
103
107
|
hermes: 'All delegated workers share the provider delegation configuration.',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Skill→Command Translation Layer
|
|
3
3
|
*
|
|
4
4
|
* Generates command files from canonical SKILL.md sources for providers that
|
|
5
|
-
* require command format natively (Factory, OpenCode, Warp,
|
|
5
|
+
* require command format natively (Factory, OpenCode, Warp, Devin Desktop, Copilot,
|
|
6
6
|
* Codex, OpenClaw).
|
|
7
7
|
*
|
|
8
8
|
* Skills are the canonical source format; commands are deployment artifacts.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Adapt itops workspace declarations without creating a competing authorization source.
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, relative, resolve } from 'node:path';
|
|
4
|
+
import { load as loadYaml } from 'js-yaml';
|
|
5
|
+
export const WORKSPACE_SPEC_PATH = 'config/workspace.yaml';
|
|
6
|
+
function object(value) {
|
|
7
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
export function workspaceSpecPath(root) {
|
|
10
|
+
const candidate = join(root, WORKSPACE_SPEC_PATH);
|
|
11
|
+
return existsSync(candidate) ? candidate : null;
|
|
12
|
+
}
|
|
13
|
+
export function readWorkspaceSpec(path) {
|
|
14
|
+
const raw = loadYaml(readFileSync(path, 'utf8'));
|
|
15
|
+
if (!object(raw) || raw.apiVersion !== 'workspace.aiwg.io/v1' || raw.kind !== 'WorkspaceSpec') {
|
|
16
|
+
throw new Error(`${path}: expected workspace.aiwg.io/v1 WorkspaceSpec`);
|
|
17
|
+
}
|
|
18
|
+
if (!Array.isArray(raw.repos))
|
|
19
|
+
throw new Error(`${path}: requires repos: []`);
|
|
20
|
+
const entries = [...raw.repos];
|
|
21
|
+
const routingPath = join(dirname(path), 'repository-routing.yaml');
|
|
22
|
+
if (existsSync(routingPath)) {
|
|
23
|
+
const routing = loadYaml(readFileSync(routingPath, 'utf8'));
|
|
24
|
+
if (!object(routing) || !Array.isArray(routing.repositories)) {
|
|
25
|
+
throw new Error(`${routingPath}: requires repositories: []`);
|
|
26
|
+
}
|
|
27
|
+
entries.push(...routing.repositories);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
workspaceName: object(raw.metadata) && typeof raw.metadata.name === 'string' ? raw.metadata.name : undefined,
|
|
31
|
+
repos: entries.map(entry => object(entry) ? {
|
|
32
|
+
...entry,
|
|
33
|
+
// Membership authorizes local reads/edits, never implicit push or destructive work.
|
|
34
|
+
allowed: entry.allowed ?? entry.actions ?? entry.permissions ?? ['read', 'write'],
|
|
35
|
+
} : entry),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function mergeSpecRepos(entries) {
|
|
39
|
+
const result = [];
|
|
40
|
+
for (const entry of entries) {
|
|
41
|
+
const previous = result.find(repo => repo.path === entry.path || repo.name === entry.name);
|
|
42
|
+
if (!previous) {
|
|
43
|
+
result.push(entry);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
if (previous.path !== entry.path || previous.name !== entry.name) {
|
|
47
|
+
throw new Error(`Conflicting workspace spec repository: ${entry.name} (${entry.path})`);
|
|
48
|
+
}
|
|
49
|
+
previous.actions = previous.actions.filter(action => entry.actions.includes(action));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
export function workspaceSpecEdit(path, name, repoPath, allowed) {
|
|
55
|
+
const root = resolve(dirname(path), '..');
|
|
56
|
+
const routing = join(dirname(path), 'repository-routing.yaml');
|
|
57
|
+
const edit = repoPath === undefined ? `Remove the entry named ${JSON.stringify(name)}.`
|
|
58
|
+
: `Add or update this entry (paths relative to ${root}):\n - name: ${JSON.stringify(name)}\n path: ${JSON.stringify(relative(root, repoPath) || '.')}`;
|
|
59
|
+
const requested = allowed ? `Requested actions: ${allowed.join(', ')}. ` : '';
|
|
60
|
+
return `${requested}Workspace spec is managed externally. Edit ${path} repos[] and ${routing} repositories[].\n${edit}\n`
|
|
61
|
+
+ 'Membership defaults to read,write; preserve any explicit allowed restrictions. No files were changed.';
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=repo-access-workspace-spec.js.map
|
|
@@ -4,6 +4,7 @@ import { dirname, isAbsolute, join, relative, resolve } from 'path';
|
|
|
4
4
|
import { load as loadYaml } from 'js-yaml';
|
|
5
5
|
import { WORKSPACE_REPO_ACTIONS, } from '../config/aiwg-config.js';
|
|
6
6
|
import { resolveProjectAiwgDir } from '../config/project-artifacts.js';
|
|
7
|
+
import { mergeSpecRepos, readWorkspaceSpec, workspaceSpecPath, WORKSPACE_SPEC_PATH } from './repo-access-workspace-spec.js';
|
|
7
8
|
export const REPO_ACCESS_MANIFEST_PATHS = [
|
|
8
9
|
'.aiwg/ops/security/repo-access.manifest.yaml',
|
|
9
10
|
'.aiwg/security/repo-access.manifest.yaml',
|
|
@@ -17,6 +18,8 @@ function isObject(value) {
|
|
|
17
18
|
}
|
|
18
19
|
function findProjectRootFromManifest(manifestPath) {
|
|
19
20
|
const normalized = manifestPath.replace(/\\/g, '/');
|
|
21
|
+
if (normalized.endsWith('/config/workspace.yaml'))
|
|
22
|
+
return resolve(dirname(manifestPath), '..');
|
|
20
23
|
if (normalized.endsWith('/.aiwg/aiwg.config')) {
|
|
21
24
|
return resolve(dirname(manifestPath), '..');
|
|
22
25
|
}
|
|
@@ -42,6 +45,9 @@ export function findRepoAccessManifest(startDir = process.cwd()) {
|
|
|
42
45
|
if (Array.isArray(parsed.repos))
|
|
43
46
|
return explicitConfig;
|
|
44
47
|
}
|
|
48
|
+
const spec = workspaceSpecPath(expanded);
|
|
49
|
+
if (spec)
|
|
50
|
+
return spec;
|
|
45
51
|
}
|
|
46
52
|
let current = resolve(startDir);
|
|
47
53
|
while (true) {
|
|
@@ -67,6 +73,9 @@ export function findRepoAccessManifest(startDir = process.cwd()) {
|
|
|
67
73
|
if (Array.isArray(parent.repos))
|
|
68
74
|
return parentConfig;
|
|
69
75
|
}
|
|
76
|
+
const spec = workspaceSpecPath(workspaceRoot);
|
|
77
|
+
if (spec)
|
|
78
|
+
return spec;
|
|
70
79
|
}
|
|
71
80
|
}
|
|
72
81
|
catch {
|
|
@@ -75,6 +84,9 @@ export function findRepoAccessManifest(startDir = process.cwd()) {
|
|
|
75
84
|
return workspaceConfig;
|
|
76
85
|
}
|
|
77
86
|
}
|
|
87
|
+
const spec = workspaceSpecPath(current);
|
|
88
|
+
if (spec)
|
|
89
|
+
return spec;
|
|
78
90
|
for (const manifestRel of REPO_ACCESS_MANIFEST_PATHS) {
|
|
79
91
|
const candidate = resolve(current, manifestRel);
|
|
80
92
|
if (existsSync(candidate))
|
|
@@ -124,10 +136,20 @@ export function loadRepoAccessManifest(startDir = process.cwd()) {
|
|
|
124
136
|
const manifestPath = findRepoAccessManifest(startDir);
|
|
125
137
|
if (!manifestPath) {
|
|
126
138
|
throw new Error('Repo access manifest not found. Expected .aiwg/aiwg.config workspace + repos blocks (canonical). '
|
|
139
|
+
+ `Itops workspace source: ${WORKSPACE_SPEC_PATH} + config/repository-routing.yaml. `
|
|
127
140
|
+ `Legacy compatibility fallbacks: ${REPO_ACCESS_MANIFEST_PATHS.join(' or ')}. `
|
|
128
141
|
+ 'Register a repo with aiwg repo-access add --path <repo-or-file> --name <name> --allow read,write.');
|
|
129
142
|
}
|
|
130
143
|
const workspaceProjectRoot = findProjectRootFromManifest(manifestPath);
|
|
144
|
+
if (manifestPath.replace(/\\/g, '/').endsWith(`/${WORKSPACE_SPEC_PATH}`)) {
|
|
145
|
+
const spec = readWorkspaceSpec(manifestPath);
|
|
146
|
+
return {
|
|
147
|
+
version: '1', path: manifestPath, source: 'workspace-spec',
|
|
148
|
+
workspaceProjectRoot, projectRoot: workspaceProjectRoot,
|
|
149
|
+
workspaceName: spec.workspaceName, defaultPolicy: 'deny',
|
|
150
|
+
repos: mergeSpecRepos(spec.repos.map((entry, index) => normalizeRepoEntry(entry, index, workspaceProjectRoot))),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
131
153
|
const isWorkspaceConfig = manifestPath.endsWith('/.aiwg/aiwg.config')
|
|
132
154
|
|| manifestPath.endsWith('\\.aiwg\\aiwg.config');
|
|
133
155
|
const raw = isWorkspaceConfig
|
|
@@ -457,10 +457,10 @@ providers:
|
|
|
457
457
|
deploy_target: project
|
|
458
458
|
aggregated_output: true
|
|
459
459
|
|
|
460
|
-
|
|
460
|
+
devin:
|
|
461
461
|
display_name: Devin Desktop
|
|
462
462
|
aliases:
|
|
463
|
-
-
|
|
463
|
+
- windsurf
|
|
464
464
|
- devin-desktop
|
|
465
465
|
- devin-local
|
|
466
466
|
- cascade
|
|
@@ -476,13 +476,13 @@ providers:
|
|
|
476
476
|
source_date: "2026-10-08"
|
|
477
477
|
live_qualified: false
|
|
478
478
|
sources:
|
|
479
|
-
- "src/providers/provider-
|
|
479
|
+
- "src/providers/provider-seeds-3.ts#devin"
|
|
480
480
|
- "https://docs.devin.ai/cli/reference/commands.md"
|
|
481
481
|
- "https://docs.devin.ai/_llms/en/desktop.md"
|
|
482
482
|
exclusion_gap: "Devin Desktop documents no headless worker command and no worker-serving MCP tool; its MCP settings configure clients, IDE startup is not inference."
|
|
483
483
|
recheck: "Rechecked 2026-10-08: Desktop unchanged, still OUT. Devin CLI documents `devin -p/--print`, `--model`, `--prompt-file`, `--permission-mode` and `--sandbox` (no JSON output or effort flag found; `devin acp` is ACP, `devin mcp` manages client servers). Devin CLI stays a distinct future-provider surface, not a windsurf alias, until registry support exists."
|
|
484
484
|
status: stable
|
|
485
|
-
# Devin Desktop uses
|
|
485
|
+
# Devin Desktop uses retained legacy compatibility paths and requires a VS Code host — daemon not supported
|
|
486
486
|
daemon_tier: unsupported
|
|
487
487
|
daemon_pty_adapter: false
|
|
488
488
|
artifact_paths:
|
|
@@ -32,7 +32,7 @@ export function deploymentOutputRoots(provider, target) {
|
|
|
32
32
|
const roots = Object.values(provider.paths || {}).filter(Boolean).map(dir => path.isAbsolute(dir)
|
|
33
33
|
? dir : path.join(target, dir.split(/[\\/]/)[0]));
|
|
34
34
|
if (provider.kernelSkillsPath) roots.push(path.resolve(target, provider.kernelSkillsPath));
|
|
35
|
-
return [...new Set([...roots, path.join(target, `.${provider.name}`), path.join(target, '.agents'),
|
|
35
|
+
return [...new Set([...roots, path.join(target, `.${provider.name === 'devin' ? 'windsurf' : provider.name}`), path.join(target, '.agents'),
|
|
36
36
|
...(provider.deploymentFiles?.(target) || []).map(name => path.join(target, name)),
|
|
37
37
|
...['AGENTS.md', 'AIWG.md', 'WORKSPACE.md', 'CLAUDE.md', 'WARP.md', '.hermes.md', 'opencode.json',
|
|
38
38
|
'.windsurfrules', 'models.json', '.aiwg/frameworks', '.aiwg/.aiwg-manifest.json'].map(name => path.join(target, name))])];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Preserve copy-mode deletions and edited receipt-owned payloads across provider passes.
|
|
2
2
|
import fs from 'node:fs';
|
|
3
|
+
import { canonicalDesktopProviderId, canonicalizeDesktopProviderKeys } from './devin-compat.mjs';
|
|
3
4
|
import path from 'node:path';
|
|
4
5
|
import { createHash } from 'node:crypto';
|
|
5
6
|
import { frameworkRegistryId } from '../config/framework-aliases.js';
|
|
@@ -9,13 +10,16 @@ const parse = bytes => { try { return JSON.parse(bytes?.toString() || '{}'); } c
|
|
|
9
10
|
const sidecar = '.aiwg-manifest.json';
|
|
10
11
|
const context = new Set(['AGENTS.md', 'AIWG.md', 'WORKSPACE.md', 'CLAUDE.md', 'WARP.md', '.hermes.md', 'copilot-instructions.md']);
|
|
11
12
|
export function providerCopyMode(project, provider, owner, config, indexOwner) {
|
|
12
|
-
|
|
13
|
+
provider = canonicalDesktopProviderId(provider);
|
|
14
|
+
const histories = parse(fs.existsSync(path.join(project, '.aiwg', sidecar)) ? fs.readFileSync(path.join(project, '.aiwg', sidecar)) : null).bundleDeployments || {};
|
|
15
|
+
const history = canonicalizeDesktopProviderKeys(histories)[provider] || {};
|
|
13
16
|
if (!config) {
|
|
14
17
|
try { config = JSON.parse(fs.readFileSync(path.join(project, '.aiwg/aiwg.config'), 'utf8')); } catch { config = {}; }
|
|
15
18
|
}
|
|
16
19
|
const modes = new Map(Object.entries(history).map(([id, mode]) => [frameworkRegistryId(id), mode.copy === true || mode.package === true]));
|
|
17
20
|
for (const [id, entry] of Object.entries(config.installed || {})) {
|
|
18
|
-
|
|
21
|
+
const deployment = canonicalizeDesktopProviderKeys(entry.deployedTo || {})[provider];
|
|
22
|
+
if (deployment) modes.set(frameworkRegistryId(id), deployment.copy === true || deployment.package === true);
|
|
19
23
|
}
|
|
20
24
|
if (indexOwner) modes.set(frameworkRegistryId(indexOwner), false);
|
|
21
25
|
const inherited = new Set();
|
|
@@ -85,8 +89,9 @@ export function preserveDeploymentOutputs(before, roots, opts = {}) {
|
|
|
85
89
|
&& !context.has(path.basename(file)) && claim.record.kind !== 'settings';
|
|
86
90
|
const owners = claim?.record.owners || (claim?.record.frameworkSlug ? [claim.record.frameworkSlug] : []);
|
|
87
91
|
const currentOwner = (opts.srcRoot || '').replaceAll('\\', '/').match(/(?:agentic\/code|\.aiwg)\/(?:frameworks|addons|extensions)\/([^/]+)/)?.[1] || frameworkRegistryId(opts.mode || '');
|
|
88
|
-
const
|
|
89
|
-
const
|
|
92
|
+
const keepCopies = (opts.copyMode ?? opts.copyStandardSkills) && !(opts.discoveryOnly && claim?.record?.kind === 'rule');
|
|
93
|
+
const copy = keepCopies || owners.some(owner => providerCopyMode(opts.target, opts.provider, owner, opts.config, currentOwner));
|
|
94
|
+
const retire = (opts.copyMode === false || opts.discoveryOnly) && opts.retiredRuleFiles?.has(file);
|
|
90
95
|
if (!(outOfScope || edited || !exists && copy && !retire) || exists && fs.readFileSync(file).equals(bytes)) continue;
|
|
91
96
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
92
97
|
fs.writeFileSync(file, bytes);
|
|
@@ -148,7 +153,7 @@ export function deploymentEditWarnings(project, provider) {
|
|
|
148
153
|
}
|
|
149
154
|
}
|
|
150
155
|
};
|
|
151
|
-
visit(path.join(project, `.${provider}`));
|
|
156
|
+
visit(path.join(project, `.${provider === 'devin' ? 'windsurf' : provider}`));
|
|
152
157
|
visit(path.join(project, '.agents'));
|
|
153
158
|
return [...warnings];
|
|
154
159
|
}
|
|
@@ -30,7 +30,7 @@ function symlinkBetween(root, file) {
|
|
|
30
30
|
export function planDeploymentRemoval(project, provider, owner, includeProject = true, preserveRoots = []) {
|
|
31
31
|
const paths = Object.values(getProviderArtifactPathStrings(provider) || {}).filter(Boolean);
|
|
32
32
|
const roots = [...new Set([...paths.map(dir => path.isAbsolute(dir) ? dir : path.join(project, dir.split(/[\\/]/)[0])),
|
|
33
|
-
...deployedSkillRoots(project, provider), path.join(project, `.${provider}`), ...(includeProject ? [path.join(project, '.aiwg/frameworks')] : [])])].map(root => path.resolve(root));
|
|
33
|
+
...deployedSkillRoots(project, provider), path.join(project, `.${provider === 'devin' ? 'windsurf' : provider}`), ...(includeProject ? [path.join(project, '.aiwg/frameworks')] : [])])].map(root => path.resolve(root));
|
|
34
34
|
const files = new Set();
|
|
35
35
|
const decisions = [], writes = [], remaining = [], recorded = [];
|
|
36
36
|
const visit = (file) => {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export function canonicalDesktopProviderId(provider: string): string;
|
|
2
|
+
export function canonicalizeDesktopProviderKeys<T>(records: Record<string, T>): Record<string, T>;
|
|
3
|
+
export function normalizeDesktopConfig<T>(config: T): T;
|
|
4
|
+
export function normalizeDesktopModelConfig<T>(config: T): T;
|