@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
|
@@ -92,16 +92,16 @@ import {
|
|
|
92
92
|
const PROVIDER_ALIASES = {
|
|
93
93
|
agy: 'antigravity',
|
|
94
94
|
'openai': 'codex',
|
|
95
|
-
'
|
|
96
|
-
'devin-desktop': '
|
|
97
|
-
'devin-local': '
|
|
98
|
-
'cascade': '
|
|
95
|
+
'windsurf': 'devin',
|
|
96
|
+
'devin-desktop': 'devin',
|
|
97
|
+
'devin-local': 'devin',
|
|
98
|
+
'cascade': 'devin',
|
|
99
99
|
'pi-coding-agent': 'pi',
|
|
100
100
|
'oh-my-pi': 'omp',
|
|
101
101
|
'dsh': 'deepseek-harness',
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
const AVAILABLE_PROVIDERS = ['antigravity', 'claude', 'factory', 'codex', 'opencode', 'copilot', 'cursor', 'flue', 'pi', 'omp', 'deepseek-harness', 'warp', '
|
|
104
|
+
const AVAILABLE_PROVIDERS = ['antigravity', 'claude', 'factory', 'codex', 'opencode', 'copilot', 'cursor', 'flue', 'pi', 'omp', 'deepseek-harness', 'warp', 'devin', 'hermes', 'openclaw', 'openhuman', 'grokbot', 'grok-build', 'muse', 'generic'];
|
|
105
105
|
|
|
106
106
|
const UNSUPPORTED_PROVIDER_HINTS = {
|
|
107
107
|
'devin-cli': [
|
|
@@ -263,6 +263,7 @@ async function mainUnlocked(args, internal) {
|
|
|
263
263
|
|
|
264
264
|
// Build options for provider
|
|
265
265
|
const { writeContextFileSync } = await import('./providers/context-write.mjs');
|
|
266
|
+
const namedDiscoveryPass = cfg.discoveryOnly && (cfg.bundleOnly || (cfg.ruleSelectionMode || cfg.mode) !== 'all');
|
|
266
267
|
const opts = {
|
|
267
268
|
replacedSkillCopies: new Set(),
|
|
268
269
|
writeReceipt: writeContextFileSync,
|
|
@@ -271,6 +272,7 @@ async function mainUnlocked(args, internal) {
|
|
|
271
272
|
target: cfg.target,
|
|
272
273
|
...(cfg.userScope ? { userScope: true } : {}),
|
|
273
274
|
mode: cfg.mode,
|
|
275
|
+
ruleSelectionMode: cfg.ruleSelectionMode,
|
|
274
276
|
// Provider aliases are selectors, not artifact identities. Passing the
|
|
275
277
|
// canonical id keeps generated frontmatter byte-identical for devin,
|
|
276
278
|
// devin-desktop, and the deprecated windsurf selector.
|
|
@@ -292,13 +294,13 @@ async function mainUnlocked(args, internal) {
|
|
|
292
294
|
deployRules: !cfg.deferRuleProjection && (cfg.kernelOnly || cfg.deployRules),
|
|
293
295
|
deployBehaviors: cfg.kernelOnly ? false : cfg.deployBehaviors,
|
|
294
296
|
commandsOnly: cfg.commandsOnly,
|
|
295
|
-
|
|
296
|
-
skillsOnly: cfg.skillsOnly || (cfg.kernelOnly && provider.name !== 'grok-build'),
|
|
297
|
+
skillsOnly: cfg.skillsOnly || cfg.discoveryOnly || cfg.kernelOnly,
|
|
297
298
|
rulesOnly: cfg.rulesOnly,
|
|
298
299
|
strict: cfg.strict,
|
|
299
300
|
reportOnly: cfg.reportOnly,
|
|
300
301
|
allowOverBudget: cfg.allowOverBudget === true,
|
|
301
302
|
kernelOnly: cfg.kernelOnly,
|
|
303
|
+
discoveryOnly: cfg.discoveryOnly,
|
|
302
304
|
deferRuleProjection: cfg.deferRuleProjection,
|
|
303
305
|
bundleOnly: cfg.bundleOnly,
|
|
304
306
|
additionalSources: cfg.additionalSources,
|
|
@@ -318,7 +320,7 @@ async function mainUnlocked(args, internal) {
|
|
|
318
320
|
// Default (#1217) is no-copy + index-driven discovery.
|
|
319
321
|
fluePackage: cfg.fluePackage === true,
|
|
320
322
|
copyStandardSkills: cfg.copyStandardSkills === true,
|
|
321
|
-
copyMode: cfg.copyStandardSkills === true && cfg.indexMode !== true,
|
|
323
|
+
copyMode: (cfg.discoveryOnly && provider.name !== 'flue') || (cfg.copyStandardSkills === true && cfg.indexMode !== true),
|
|
322
324
|
// #228: Muse provider hooks/MCP profile surface.
|
|
323
325
|
mcp: cfg.mcp === true,
|
|
324
326
|
hooks: cfg.hooks !== false,
|
|
@@ -370,8 +372,8 @@ async function mainUnlocked(args, internal) {
|
|
|
370
372
|
// Delegate to provider
|
|
371
373
|
try {
|
|
372
374
|
if (!internal.finalizeOnly) {
|
|
373
|
-
if (
|
|
374
|
-
&& !['claude', 'codex', 'cursor', 'hermes', 'warp', 'openclaw', 'flue', 'pi', 'copilot', 'factory', 'opencode', '
|
|
375
|
+
if (opts.kernelOnly && !namedDiscoveryPass && (!cfg.deferRuleProjection || preparationActive)
|
|
376
|
+
&& !['claude', 'codex', 'cursor', 'hermes', 'warp', 'openclaw', 'flue', 'pi', 'copilot', 'factory', 'opencode', 'devin', 'antigravity', 'muse', 'omp', 'grok-build', 'generic'].includes(provider.name)) {
|
|
375
377
|
const { deployWithRuleDelivery } = await import('./providers/rule-delivery.mjs');
|
|
376
378
|
await deployWithRuleDelivery(opts, provider, staged => provider.deploy(staged));
|
|
377
379
|
} else await provider.deploy(opts);
|
|
@@ -98,6 +98,7 @@ export function parseArgs(args = process.argv.slice(2)) {
|
|
|
98
98
|
else if (a === '--allow-over-budget') cfg.allowOverBudget = true;
|
|
99
99
|
else if (a === '--report-only') cfg.reportOnly = true;
|
|
100
100
|
else if (a === '--kernel-only') cfg.kernelOnly = true;
|
|
101
|
+
else if (a === '--discovery-only') { cfg.kernelOnly = true; cfg.discoveryOnly = true; }
|
|
101
102
|
// Internal use orchestration: the final source owns rule presentation.
|
|
102
103
|
else if (a === '--defer-rule-projection') cfg.deferRuleProjection = true;
|
|
103
104
|
else if (a === '--bundle-only') cfg.bundleOnly = true;
|
|
@@ -67,7 +67,7 @@ export const BEHAVIOR_EMULATION_TARGETS = {
|
|
|
67
67
|
factory: { dir: '.factory/rules/behaviors', extension: '.md', surface: 'Factory rules' },
|
|
68
68
|
opencode: { dir: '.opencode/rule/behaviors', extension: '.md', surface: 'OpenCode rules' },
|
|
69
69
|
warp: { dir: '.warp/rules/behaviors', extension: '.md', surface: 'Warp rules/context surface' },
|
|
70
|
-
|
|
70
|
+
devin: { dir: '.windsurf/rules/behaviors', extension: '.md', surface: 'Devin Desktop rules' },
|
|
71
71
|
hermes: { dir: '.hermes/behaviors', extension: '.md', surface: 'Hermes behavior context' },
|
|
72
72
|
};
|
|
73
73
|
|
|
@@ -71,7 +71,7 @@ export const ProviderInterface = {
|
|
|
71
71
|
deploySkills(skillDirs, targetDir, opts) {},
|
|
72
72
|
deployRules(ruleFiles, targetDir, opts) {},
|
|
73
73
|
|
|
74
|
-
// ── Aggregation (for Warp,
|
|
74
|
+
// ── Aggregation (for Warp, Devin Desktop) ────────────────────────────────
|
|
75
75
|
aggregate(artifacts, targetDir, opts) {},
|
|
76
76
|
|
|
77
77
|
// ── Create/update AGENTS.md ────────────────────────────────────────
|
|
@@ -89,7 +89,7 @@ export function deploySkillsWithKernelRouting(
|
|
|
89
89
|
const kernel = [];
|
|
90
90
|
const standard = [];
|
|
91
91
|
for (const dir of skillDirs) {
|
|
92
|
-
if (kernelDestDir && (opts?.deploySource === 'project-local' || isKernelSkill(dir))) kernel.push(dir);
|
|
92
|
+
if (kernelDestDir && ((!opts?.discoveryOnly && opts?.deploySource === 'project-local') || isKernelSkill(dir))) kernel.push(dir);
|
|
93
93
|
else standard.push(dir);
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -72,10 +72,10 @@ export function loadModelConfig(srcRoot) {
|
|
|
72
72
|
config[provider] = Object.fromEntries(Object.entries(catalog.providers[provider].roles)
|
|
73
73
|
.map(([role, entry]) => [role, { model: entry.id }]));
|
|
74
74
|
}
|
|
75
|
-
//
|
|
76
|
-
// supplies concrete IDs, use Factory's API pins, matching shipped
|
|
77
|
-
config.
|
|
78
|
-
const id = catalog.providers.
|
|
75
|
+
// Devin Desktop's catalog currently has only "inherited" placeholders. Until it
|
|
76
|
+
// supplies concrete IDs, use Factory's API pins, matching shipped Devin Desktop.
|
|
77
|
+
config.devin = Object.fromEntries(Object.entries(config.factory).map(([role, entry]) => {
|
|
78
|
+
const id = catalog.providers.devin?.roles?.[role]?.id;
|
|
79
79
|
return [role, { model: typeof id === 'string' && id.trim() && id !== 'inherited' ? id : entry.model }];
|
|
80
80
|
}));
|
|
81
81
|
config.shorthand = { inherit: 'inherit' };
|
|
@@ -97,11 +97,12 @@ export function loadModelConfig(srcRoot) {
|
|
|
97
97
|
]) {
|
|
98
98
|
const layer = readConfig(loc.path);
|
|
99
99
|
if (layer) {
|
|
100
|
-
|
|
100
|
+
// Deprecated provider key remains readable in pre-buyout models.json files.
|
|
101
|
+
config = mergeModelConfig(config, layer.windsurf && !layer.devin ? { ...layer, devin: layer.windsurf } : layer, loc.path);
|
|
101
102
|
sources.push(`${loc.label} (${loc.path})`);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
|
-
return { ...config, _source: sources.join(' ← ') };
|
|
105
|
+
return { ...config, devin: config.devin ?? config.windsurf, windsurf: config.devin ?? config.windsurf, _source: sources.join(' ← ') };
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
|
|
@@ -195,7 +196,8 @@ export function skillMatchesProvider(content, provider) {
|
|
|
195
196
|
if (!platforms) return true; // No restriction
|
|
196
197
|
|
|
197
198
|
const platformName = PROVIDER_TO_PLATFORM[provider] || provider;
|
|
198
|
-
return platforms.includes(platformName) || platforms.includes(provider)
|
|
199
|
+
return platforms.includes(platformName) || platforms.includes(provider)
|
|
200
|
+
|| (['devin', 'windsurf'].includes(provider) && platforms.some(name => ['devin', 'windsurf'].includes(name)));
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
|
|
@@ -408,7 +408,7 @@ export function getRulesIndexPath(srcRoot) {
|
|
|
408
408
|
|
|
409
409
|
/**
|
|
410
410
|
* Generate consolidated rules content from manifest for a specific provider.
|
|
411
|
-
* Used by content-injection providers (copilot, warp,
|
|
411
|
+
* Used by content-injection providers (copilot, warp, devin) that need
|
|
412
412
|
* the rules content inline rather than as a file.
|
|
413
413
|
*
|
|
414
414
|
* @param {string} srcRoot - Source root directory
|
|
@@ -317,6 +317,7 @@ export async function deploySkills(targetDir, srcRoot, opts) {
|
|
|
317
317
|
console.log(`Deploying skills to ${crossAgentSkillsDir} (.agents/skills — codex-scanned path)...`);
|
|
318
318
|
|
|
319
319
|
const args = ['--source', srcRoot, '--target', crossAgentSkillsDir];
|
|
320
|
+
if (opts.discoveryOnly) args.push('--preserve-copies');
|
|
320
321
|
// Overflow past Codex's startup listing cap lands here instead of being
|
|
321
322
|
// deployed over the cap (#2561); the index still reaches these skills.
|
|
322
323
|
args.push('--standard-target', path.join(targetDir, ...paths.skills.split('/').filter(Boolean)));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Install package-owned prompt discovery for full Cursor project deployments.
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { importImpl } from '../../_resolve-impl.mjs';
|
|
4
|
+
|
|
5
|
+
export async function deployCursorPromptDiscovery(targetDir, opts) {
|
|
6
|
+
const fullDeploy = !opts.commandsOnly && !opts.rulesOnly && (!opts.skillsOnly || opts.kernelOnly === true);
|
|
7
|
+
if (!fullDeploy || opts.hooks === false || opts.scope === 'user') return;
|
|
8
|
+
const { installCursorPromptDiscovery } = await importImpl(import.meta.url, 'smiths/hook-bridge/cursor-translator.js');
|
|
9
|
+
const result = await installCursorPromptDiscovery({ projectPath: targetDir,
|
|
10
|
+
commandRoot: opts.logicalOutputPath?.(targetDir), frameworkRoot: fileURLToPath(new URL('../../../', import.meta.url)),
|
|
11
|
+
dryRun: opts.dryRun });
|
|
12
|
+
for (const warning of result.warnings) console.warn(warning);
|
|
13
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { deployCursorPromptDiscovery } from './cursor-prompt-discovery.mjs';
|
|
1
2
|
import { withModelWrapper } from './model-wrapper.mjs';
|
|
2
3
|
/**
|
|
3
4
|
* Cursor IDE Provider
|
|
@@ -410,6 +411,7 @@ export function deployCursorConfigTemplates(targetDir, srcRoot, opts) {
|
|
|
410
411
|
|
|
411
412
|
export async function postDeploy(targetDir, opts) {
|
|
412
413
|
initializeFrameworkWorkspace(targetDir, opts.mode, opts.dryRun, opts.srcRoot);
|
|
414
|
+
await deployCursorPromptDiscovery(targetDir, opts);
|
|
413
415
|
|
|
414
416
|
if (opts.createAgentsMd) {
|
|
415
417
|
if (opts.contextFiles !== false) createAgentsMd(targetDir, opts.srcRoot, opts.dryRun);
|
|
@@ -12,12 +12,13 @@ import { withModelWrapper } from './model-wrapper.mjs';
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import path from 'node:path';
|
|
15
|
-
import os from 'node:os';
|
|
16
15
|
import fs from 'node:fs';
|
|
17
16
|
import { createHash, randomUUID } from 'node:crypto';
|
|
18
17
|
import yaml from 'js-yaml';
|
|
19
18
|
import { importImpl } from '../../_resolve-impl.mjs';
|
|
20
|
-
|
|
19
|
+
import { removeSkillCopy } from './skill-copy-prune.mjs';
|
|
20
|
+
const { GROK_BUILD_STANDARD_SKILLS_PATH, resolveGrokHome } = await importImpl(import.meta.url, 'providers/grok-build-paths.js');
|
|
21
|
+
export { resolveGrokHome };
|
|
21
22
|
import {
|
|
22
23
|
withRuleDeployment,
|
|
23
24
|
replaceBoundRulesBlock,
|
|
@@ -56,7 +57,7 @@ export const support = {
|
|
|
56
57
|
skills: 'native',
|
|
57
58
|
// CONTEXT_CONTRACTS: https://docs.x.ai/build/features/project-rules
|
|
58
59
|
// .grok/rules/*.md loads hierarchically on every task; no frontmatter marker
|
|
59
|
-
// is required for always-on rules (unlike
|
|
60
|
+
// is required for always-on rules (unlike Devin Desktop's trigger field).
|
|
60
61
|
rules: 'native', // always-on Markdown rules discovered root-to-cwd by Grok Build
|
|
61
62
|
};
|
|
62
63
|
|
|
@@ -69,20 +70,6 @@ export const capabilities = {
|
|
|
69
70
|
parallelCommandAndSkillSurfaces: false,
|
|
70
71
|
};
|
|
71
72
|
|
|
72
|
-
const GROK_HOME_ENV = 'GROK_HOME';
|
|
73
|
-
|
|
74
|
-
export function resolveGrokHome(env = process.env, userHome = os.homedir()) {
|
|
75
|
-
const raw = (env[GROK_HOME_ENV] || '').trim();
|
|
76
|
-
const candidate = raw || path.join(userHome, '.grok');
|
|
77
|
-
if (candidate === '~') return null;
|
|
78
|
-
let expanded = candidate;
|
|
79
|
-
if (candidate.startsWith('~/')) expanded = path.join(userHome, candidate.slice(2));
|
|
80
|
-
if (!path.isAbsolute(expanded)) return null;
|
|
81
|
-
const resolved = path.resolve(expanded);
|
|
82
|
-
if (!resolved || path.parse(resolved).root === resolved) return null;
|
|
83
|
-
return resolved;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
73
|
export function createAgentsMd(target, srcRoot, dryRun) {
|
|
87
74
|
assertSafeAgentsMd(target);
|
|
88
75
|
createAgentsMdFromTemplate(
|
|
@@ -242,6 +229,14 @@ function matchesSkillSource(source, target) {
|
|
|
242
229
|
} catch { return false; }
|
|
243
230
|
}
|
|
244
231
|
|
|
232
|
+
// Modern authored and projected skills share receipt-based copy verification.
|
|
233
|
+
function removableSkill(skill, sources) {
|
|
234
|
+
if (fs.existsSync(path.join(skill, '.aiwg-manifest.json'))) {
|
|
235
|
+
return removeSkillCopy(skill, { dryRun: true });
|
|
236
|
+
}
|
|
237
|
+
return sources.some(source => matchesSkillSource(source, skill));
|
|
238
|
+
}
|
|
239
|
+
|
|
245
240
|
/** Remove only unchanged AIWG Grok artifacts; shared context files stay intact. */
|
|
246
241
|
export function uninstall(target, opts = {}) {
|
|
247
242
|
const root = path.resolve(target);
|
|
@@ -278,7 +273,7 @@ export function uninstall(target, opts = {}) {
|
|
|
278
273
|
if (fs.lstatSync(marker).isSymbolicLink() || fs.readFileSync(marker, 'utf8') !== 'aiwg\n') {
|
|
279
274
|
skipped.push(relative); continue;
|
|
280
275
|
}
|
|
281
|
-
if ((byName.get(entry.name) ?? [])
|
|
276
|
+
if (removableSkill(skill, byName.get(entry.name) ?? [])) {
|
|
282
277
|
planned.push(relative);
|
|
283
278
|
} else skipped.push(relative);
|
|
284
279
|
}
|
|
@@ -310,7 +305,7 @@ export function uninstall(target, opts = {}) {
|
|
|
310
305
|
if (relative.includes(`${path.sep}skills${path.sep}`)) {
|
|
311
306
|
const marker = path.join(file, '.aiwg-managed');
|
|
312
307
|
if (!fs.existsSync(marker) || fs.readFileSync(marker, 'utf8') !== 'aiwg\n'
|
|
313
|
-
|| !(byName.get(path.basename(file)) ?? [])
|
|
308
|
+
|| !removableSkill(file, byName.get(path.basename(file)) ?? [])) {
|
|
314
309
|
skipped.push(relative); continue;
|
|
315
310
|
}
|
|
316
311
|
fs.rmSync(file, { recursive: true });
|
|
@@ -40,7 +40,7 @@ export function withModelWrapper(provider, translate) {
|
|
|
40
40
|
resolveWrapperPin(provider, wrapper, { catalog, override, effort });
|
|
41
41
|
// Legacy translators read a single tools line; normalize YAML lists before mapping.
|
|
42
42
|
const toolList = parsed.metadata.tools;
|
|
43
|
-
const normalized = Array.isArray(toolList) && ['antigravity', 'copilot', 'factory', '
|
|
43
|
+
const normalized = Array.isArray(toolList) && ['antigravity', 'copilot', 'factory', 'devin'].includes(provider)
|
|
44
44
|
? content.replace(/^tools:[^\n]*(?:\n[ \t]+- [^\n]*)*/m,
|
|
45
45
|
`tools: ${provider === 'antigravity' ? `[${toolList.join(', ')}]` : JSON.stringify(toolList)}`)
|
|
46
46
|
: content;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Select OpenClaw startup destinations for default sessions and agent exec --cwd.
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
export function openClawContextWorkspaces(opts, workspace) {
|
|
5
|
+
return [...new Set([workspace, ...(opts.contextFiles === false ? [] : [opts.target])].map(dir => path.resolve(dir)))];
|
|
6
|
+
}
|
|
@@ -25,6 +25,7 @@ let fs;
|
|
|
25
25
|
try { const gfs = _require('graceful-fs'); gfs.gracefulify(realFs); fs = realFs; } catch { fs = realFs; }
|
|
26
26
|
import path from 'path';
|
|
27
27
|
import os from 'os';
|
|
28
|
+
import { openClawContextWorkspaces } from './openclaw-context.mjs';
|
|
28
29
|
import {
|
|
29
30
|
withRuleDeployment,
|
|
30
31
|
ensureDir,
|
|
@@ -553,19 +554,20 @@ async function deploySelected(opts) {
|
|
|
553
554
|
srcRoot, 'agentic', 'code', 'frameworks', 'sdlc-complete', 'templates', 'openclaw', 'AGENTS.md.aiwg-template',
|
|
554
555
|
);
|
|
555
556
|
if (fs.existsSync(templatePath)) {
|
|
556
|
-
const workspace
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
557
|
+
for (const workspace of openClawContextWorkspaces(opts, opts.activeWorkspace || resolveOpenClawWorkspace())) {
|
|
558
|
+
ensureDir(workspace, dryRun);
|
|
559
|
+
if (verbose || !opts.quiet) {
|
|
560
|
+
console.log(`\nBridging AIWG context into ${path.join(workspace, 'AGENTS.md')} + SOUL.md (#1562/#1572)...`);
|
|
561
|
+
}
|
|
562
|
+
// AGENTS.md = methodology/rules; SOUL.md = the AIWG Steward identity (the
|
|
563
|
+
// discover-first reflex baked in as *who the agent is*, which a weak model
|
|
564
|
+
// adopts far more reliably than a rules appendix). Both update in place.
|
|
565
|
+
createAgentsMdFromTemplate(workspace, srcRoot, 'openclaw/AGENTS.md.aiwg-template', dryRun);
|
|
566
|
+
createManagedMdFromTemplate(workspace, 'SOUL.md', srcRoot, 'openclaw/SOUL.md.aiwg-template', dryRun, {
|
|
567
|
+
sectionMarker: '<!-- AIWG Steward Identity -->',
|
|
568
|
+
legacyHeading: '## AIWG Steward',
|
|
569
|
+
});
|
|
560
570
|
}
|
|
561
|
-
// AGENTS.md = methodology/rules; SOUL.md = the AIWG Steward identity (the
|
|
562
|
-
// discover-first reflex baked in as *who the agent is*, which a weak model
|
|
563
|
-
// adopts far more reliably than a rules appendix). Both update in place.
|
|
564
|
-
createAgentsMdFromTemplate(workspace, srcRoot, 'openclaw/AGENTS.md.aiwg-template', dryRun);
|
|
565
|
-
createManagedMdFromTemplate(workspace, 'SOUL.md', srcRoot, 'openclaw/SOUL.md.aiwg-template', dryRun, {
|
|
566
|
-
sectionMarker: '<!-- AIWG Steward Identity -->',
|
|
567
|
-
legacyHeading: '## AIWG Steward',
|
|
568
|
-
});
|
|
569
571
|
}
|
|
570
572
|
}
|
|
571
573
|
|
|
@@ -114,11 +114,12 @@ export function collectDeploymentRuleSources(opts) {
|
|
|
114
114
|
};
|
|
115
115
|
for (const bundle of bundles.filter(b => b.manifest.core && b.manifest.autoInstall)) select(bundle.id);
|
|
116
116
|
for (const name of names.filter(name => name !== 'all')) select(name);
|
|
117
|
+
const kernelOnly = opts.kernelOnly && !(opts.discoveryOnly && (opts.bundleOnly || (opts.ruleSelectionMode || opts.mode) !== 'all'));
|
|
117
118
|
const invoked = bundles.find(bundle => path.resolve(bundle.root) === path.resolve(opts.srcRoot));
|
|
118
|
-
if (invoked && !
|
|
119
|
+
if (invoked && !kernelOnly) select(invoked.id);
|
|
119
120
|
// Include the invocation being installed before its config entry is saved.
|
|
120
|
-
if (!
|
|
121
|
-
const roots = [...(!invoked || !
|
|
121
|
+
if (!kernelOnly) for (const framework of getFrameworksForMode(opts.srcRoot, opts.mode === 'all' && names.length ? 'general' : opts.mode)) select(framework.id);
|
|
122
|
+
const roots = [...(!invoked || !kernelOnly ? [opts.srcRoot] : []), ...(opts.additionalSources || []), ...[...selected].map(bundle => bundle.root)];
|
|
122
123
|
for (const entry of Object.values(installed)) if (entry?.localPath) roots.push(path.resolve(opts.target, entry.localPath));
|
|
123
124
|
const files = roots.flatMap(root => listMdFiles(path.join(root, 'rules'))).filter(file => !structural(file));
|
|
124
125
|
const behaviors = roots.flatMap(root => walk(path.join(root, 'behaviors')).filter(file => path.basename(file) === 'BEHAVIOR.md'));
|
|
@@ -201,7 +202,7 @@ export function finishBindings(opts, provider) {
|
|
|
201
202
|
const roots = [opts.target, opts.deploymentHome,
|
|
202
203
|
...[opts.kernelSkillsPath, opts.activeWorkspace, ...Object.values(provider.paths)].filter(p => p && path.isAbsolute(p))];
|
|
203
204
|
const files = [...new Set(roots.flatMap(walk))];
|
|
204
|
-
const indexRel = provider.name === 'copilot' ? '.github/RULES-BOUND.md' : provider.name === 'flue' ? '.agents/.aiwg/RULES-BOUND.md' : `.${provider.name}/RULES-BOUND.md`;
|
|
205
|
+
const indexRel = provider.name === 'copilot' ? '.github/RULES-BOUND.md' : provider.name === 'flue' ? '.agents/.aiwg/RULES-BOUND.md' : `.${provider.name === 'devin' ? 'windsurf' : provider.name}/RULES-BOUND.md`;
|
|
205
206
|
const indexFile = path.join(opts.target, indexRel);
|
|
206
207
|
const anchor = boundRuleAnchor;
|
|
207
208
|
const sections = new Map();
|
|
@@ -288,10 +289,11 @@ export function projectBoundFlowSkills(opts, provider, selected) {
|
|
|
288
289
|
opts.flowSkillSources = new Map();
|
|
289
290
|
if (opts.rulesOnly || opts.commandsOnly || !(opts.deploySkills || opts.skillsOnly)) return;
|
|
290
291
|
const kernel = path.isAbsolute(provider.kernelSkillsPath || '') ? opts.kernelSkillsPath
|
|
291
|
-
: path.join(opts.target, provider.kernelSkillsPath || `.${provider.name}/skills`);
|
|
292
|
+
: path.join(opts.target, provider.kernelSkillsPath || `.${provider.name === 'devin' ? 'windsurf' : provider.name}/skills`);
|
|
292
293
|
// Codex's opt-in standard tier shares the native skills directory.
|
|
293
|
-
const
|
|
294
|
-
|
|
294
|
+
const standardPath = provider.standardSkillsPath || provider.paths.skills;
|
|
295
|
+
const standard = provider.name === 'codex' ? kernel : path.isAbsolute(standardPath)
|
|
296
|
+
? standardPath : path.join(opts.target, standardPath);
|
|
295
297
|
const flows = opts.ruleDelivery.targets.filter(entry => entry.type === 'flow' && selected(entry));
|
|
296
298
|
const sources = new Set(flows.map(entry => entry.source));
|
|
297
299
|
for (const root of new Set([kernel, standard])) {
|
|
@@ -335,9 +337,11 @@ export function projectBoundFlowSkills(opts, provider, selected) {
|
|
|
335
337
|
const projected = provider.transformSkillMd ? provider.transformSkillMd(markdown, opts) : markdown;
|
|
336
338
|
const content = managed(replaceBoundRulesBlock(projected, opts.ruleDelivery.bindings.get(entry.source)), opts);
|
|
337
339
|
put(file, content);
|
|
338
|
-
put(path.join(dir, '.aiwg-managed'), '
|
|
340
|
+
put(path.join(dir, '.aiwg-managed'), 'aiwg\n');
|
|
341
|
+
const frameworkSlug = extractFrameworkSlug(opts.logicalInputPath?.(entry.source) || entry.source);
|
|
339
342
|
put(receiptFile, `${JSON.stringify({ flowSource: entry.source,
|
|
340
|
-
managed: { 'SKILL.md': { sourcePath: entry.source,
|
|
343
|
+
managed: { 'SKILL.md': { sourcePath: entry.source, source: opts.deploySource || 'bundled',
|
|
344
|
+
...(frameworkSlug ? { frameworkSlug } : {}), hash: `sha256:${contentHash(content)}` } } }, null, 2)}\n`);
|
|
341
345
|
}
|
|
342
346
|
opts.flowSkillSources.set(file, entry.source);
|
|
343
347
|
if (['warp', 'hermes'].includes(provider.name)) opts.definitionRoutes.push(`${name}: ${file}`);
|
|
@@ -354,7 +358,7 @@ export function warpRuleContent(content) {
|
|
|
354
358
|
}
|
|
355
359
|
|
|
356
360
|
export function startupFiles(opts, provider) {
|
|
357
|
-
const bridgeNames = { claude: ['CLAUDE.md'], cursor: ['AGENTS.md'], codex: ['AGENTS.md'], hermes: ['AGENTS.md', '.hermes.md'], pi: ['AGENTS.md'], warp: ['WARP.md'], openclaw: [] };
|
|
361
|
+
const bridgeNames = { claude: ['CLAUDE.md'], cursor: ['AGENTS.md'], codex: ['AGENTS.md'], hermes: ['AGENTS.md', '.hermes.md'], pi: ['AGENTS.md'], warp: ['WARP.md'], openclaw: ['AGENTS.md'] };
|
|
358
362
|
const paths = ['AIWG.md', 'WORKSPACE.md', ...(bridgeNames[provider.name] || ['AGENTS.md']), inlineStartup[provider.name]].filter(Boolean).map(name => path.join(opts.target, name));
|
|
359
363
|
if (opts.activeWorkspace) paths.push(path.join(opts.activeWorkspace, 'AGENTS.md'));
|
|
360
364
|
{
|
|
@@ -371,7 +375,7 @@ export function startupFiles(opts, provider) {
|
|
|
371
375
|
// Count managed rule sections while preserving historical accounting for
|
|
372
376
|
// operator aggregates; discrete hook-reached rule files are counted above.
|
|
373
377
|
if ((provider.name === 'warp' && path.basename(file) === 'WARP.md')
|
|
374
|
-
|| (provider.name === '
|
|
378
|
+
|| (provider.name === 'devin' && file === path.join(opts.target, 'AGENTS.md'))) content = warpRuleContent(content);
|
|
375
379
|
return { path: file, content };
|
|
376
380
|
});
|
|
377
381
|
}
|
|
@@ -62,7 +62,7 @@ export async function prepareRuleDeployment(original, provider, deploy) {
|
|
|
62
62
|
|
|
63
63
|
async function prepareWithInputs(original, provider, deploy) {
|
|
64
64
|
const budgetEnv = { ...process.env };
|
|
65
|
-
const ruleDir = path.isAbsolute(provider.paths.rules || '') ? provider.paths.rules : path.join(original.target, provider.paths.rules || `.${provider.name}/rules`);
|
|
65
|
+
const ruleDir = path.isAbsolute(provider.paths.rules || '') ? provider.paths.rules : path.join(original.target, provider.paths.rules || `.${provider.name === 'devin' ? 'windsurf' : provider.name}/rules`);
|
|
66
66
|
const manifestFile = path.join(ruleDir, '.aiwg-manifest.json');
|
|
67
67
|
const previousText = fs.existsSync(manifestFile) ? read(manifestFile) : '';
|
|
68
68
|
const previous = previousText ? JSON.parse(previousText) : {};
|
|
@@ -229,12 +229,13 @@ async function prepareWithInputs(original, provider, deploy) {
|
|
|
229
229
|
// Mount directories independently so only provider-owned surfaces are promoted.
|
|
230
230
|
const relativeRoots = Object.values(provider.paths).filter(dir => dir && !path.isAbsolute(dir))
|
|
231
231
|
.map(dir => dir.split(/[\\/]/)[0]).filter(dir => dir && dir !== '.' && !path.extname(dir));
|
|
232
|
-
for (const dir of new Set([`.${provider.name}`, '.agents', '.aiwg/skills', ...relativeRoots])) mount(path.join(target, dir), path.join(stage, dir));
|
|
232
|
+
for (const dir of new Set([`.${provider.name === 'devin' ? 'windsurf' : provider.name}`, '.agents', '.aiwg/skills', ...relativeRoots])) mount(path.join(target, dir), path.join(stage, dir));
|
|
233
233
|
fs.mkdirSync(path.join(stage, '.aiwg'), { recursive: true });
|
|
234
234
|
if (fs.existsSync(projectSnapshot)) materializeInput(projectSnapshot, path.join(stage, '.aiwg', 'aiwg.config'));
|
|
235
235
|
const rootNames = ['opencode.json', ...GENERATED_CONTEXT_NAMES, ...OPERATOR_CONTEXT_NAMES, '.aiwg/frameworks/registry.json'];
|
|
236
|
+
if (provider.name === 'openclaw' && original.contextFiles !== false) rootNames.push('SOUL.md');
|
|
236
237
|
if (provider.deploymentFiles) rootNames.push(...provider.deploymentFiles(target));
|
|
237
|
-
if (provider.name === '
|
|
238
|
+
if (provider.name === 'devin') rootNames.push('.windsurfrules');
|
|
238
239
|
for (const framework of getFrameworksForMode(original.srcRoot, original.mode)) {
|
|
239
240
|
for (const entry of framework.manifest?.memory?.creates || []) {
|
|
240
241
|
if (typeof entry?.path !== 'string' || !entry.path.startsWith('.aiwg/') || !path.extname(entry.path)) continue;
|
|
@@ -371,13 +372,13 @@ async function prepareWithInputs(original, provider, deploy) {
|
|
|
371
372
|
}
|
|
372
373
|
}
|
|
373
374
|
projectBoundFlowSkills(opts, provider, selected);
|
|
374
|
-
if (['warp', '
|
|
375
|
-
for (const file of walk(path.join(stage, `.${provider.name}`, 'commands'))) {
|
|
376
|
-
if (/\.md$/.test(file)) opts.definitionRoutes.push(`${path.basename(file, '.md')}: .${provider.name}/commands/${path.basename(file)}`);
|
|
375
|
+
if (['warp', 'devin'].includes(provider.name)) {
|
|
376
|
+
for (const file of walk(path.join(stage, `.${provider.name === 'devin' ? 'windsurf' : provider.name}`, 'commands'))) {
|
|
377
|
+
if (/\.md$/.test(file)) opts.definitionRoutes.push(`${path.basename(file, '.md')}: .${provider.name === 'devin' ? 'windsurf' : provider.name}/commands/${path.basename(file)}`);
|
|
377
378
|
}
|
|
378
379
|
for (const entry of delivery.targets.filter(entry => entry.type === 'agent' && selected(entry))) {
|
|
379
|
-
const dest = path.join(stage, `.${provider.name}`, 'agents', path.basename(entry.source));
|
|
380
|
-
if (fs.existsSync(dest)) opts.definitionRoutes.push(`${entry.name}: .${provider.name}/agents/${path.basename(entry.source)}`);
|
|
380
|
+
const dest = path.join(stage, `.${provider.name === 'devin' ? 'windsurf' : provider.name}`, 'agents', path.basename(entry.source));
|
|
381
|
+
if (fs.existsSync(dest)) opts.definitionRoutes.push(`${entry.name}: .${provider.name === 'devin' ? 'windsurf' : provider.name}/agents/${path.basename(entry.source)}`);
|
|
381
382
|
}
|
|
382
383
|
}
|
|
383
384
|
if (!opts.deferRuleProjection) {
|
|
@@ -29,7 +29,7 @@ export function renderRuleKernelIndex(rules, nativePaths = false, perRuleFetch =
|
|
|
29
29
|
// RULES-INDEX receipts are parsed by deployment accounting; retain their command format.
|
|
30
30
|
// #3900: "fetch before governed work" made Muse read every rule before discovery; fetch on need.
|
|
31
31
|
if (!perRuleFetch) lines.push("Fetch a rule's full body when a task or discovered component needs it: `aiwg show rule <name> --body`.", '');
|
|
32
|
-
if (kernelFile && kernels.length) lines.push("Kernel rules bind every task and subagent task. On a new task, first run discovery for the request (`aiwg discover --stdin <<'AIWG_REQUEST'`, the request, then `AIWG_REQUEST`) before reading any file below; then read a kernel file before work its subject covers.", '');
|
|
32
|
+
if (kernelFile && kernels.length) lines.push("Kernel rules bind every task and subagent task. On a new task, first run discovery for the request (`aiwg discover --stdin <<'AIWG_REQUEST'`, the request, then `AIWG_REQUEST`) before reading any file below; then read a kernel file before work its subject covers. For AIWG lookup, never open `.agents/skills/**` or `agentic/code/**`, including a discovered skill's mirror file or a template. After discover, use `aiwg show <type> <name>` and its drill-ins (`--section`, `--rules --with-rule-bodies`, `--body`); read required rules before governed work.", '');
|
|
33
33
|
for (const rule of kernels) lines.push(kernelFile
|
|
34
34
|
? `- ${rule.name} — ${rule.summary || 'Binding kernel rule.'} Full rule: [${kernelFile(rule)}](./${kernelFile(rule)}).`
|
|
35
35
|
: perRuleFetch
|
|
@@ -22,19 +22,19 @@ export function ruleRemovalReason(file) {
|
|
|
22
22
|
return ` (${level} retired because the selected deployment no longer projects its source at this path)`;
|
|
23
23
|
}
|
|
24
24
|
const put = (file, content) => { fs.mkdirSync(path.dirname(file), { recursive: true }); fs.writeFileSync(file, content); };
|
|
25
|
-
export const nativeRuleLoader = name => ['claude', 'cursor', 'grok-build', '
|
|
26
|
-
export const nativePathLoader = name => ['claude', 'cursor', '
|
|
25
|
+
export const nativeRuleLoader = name => ['claude', 'cursor', 'grok-build', 'devin', 'opencode'].includes(name);
|
|
26
|
+
export const nativePathLoader = name => ['claude', 'cursor', 'devin'].includes(name);
|
|
27
27
|
export function ruleDirectory(opts, provider) {
|
|
28
28
|
// Muse has no declared rules path; use its existing .muse harness convention.
|
|
29
|
-
const dir = provider.paths.rules || (provider.name === 'grok-build' ? '.grok/rules' : `.${provider.name}/rules`);
|
|
29
|
+
const dir = provider.paths.rules || (provider.name === 'grok-build' ? '.grok/rules' : `.${provider.name === 'devin' ? 'windsurf' : provider.name}/rules`);
|
|
30
30
|
return path.isAbsolute(dir) ? dir : path.join(opts.target, dir);
|
|
31
31
|
}
|
|
32
32
|
const ruleName = (rule, provider) => rule.behavior
|
|
33
|
-
? `${['grok-build', '
|
|
33
|
+
? `${['grok-build', 'devin'].includes(provider.name) ? 'behavior-' : 'behaviors/'}${path.basename(path.dirname(rule.file))}`
|
|
34
34
|
: path.basename(rule.file, '.md');
|
|
35
35
|
function nativeContent(provider, rule, content, opts) {
|
|
36
36
|
if (provider.name === 'cursor') return provider.transformRule(rule.file, content, opts);
|
|
37
|
-
if (provider.name === '
|
|
37
|
+
if (provider.name === 'devin') {
|
|
38
38
|
const parsed = parseRuleFrontmatter(content);
|
|
39
39
|
const data = { ...parsed.data, trigger: rule.activation === 'paths' ? 'glob' : 'always_on' };
|
|
40
40
|
if (rule.activation === 'paths') data.glob = rule.paths.join(',');
|
|
@@ -11,7 +11,7 @@ const read = file => fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : '';
|
|
|
11
11
|
export const inlineStartup = {
|
|
12
12
|
codex: 'AGENTS.md', flue: 'AGENTS.md', pi: 'AGENTS.md', hermes: 'AGENTS.md', warp: 'WARP.md',
|
|
13
13
|
copilot: '.github/copilot-instructions.md', factory: 'AGENTS.md', opencode: 'AGENTS.md',
|
|
14
|
-
|
|
14
|
+
devin: 'AGENTS.md', antigravity: 'AGENTS.md', muse: 'AGENTS.md',
|
|
15
15
|
omp: '.omp/AGENTS.md', 'grok-build': 'AGENTS.md',
|
|
16
16
|
};
|
|
17
17
|
function section(content, owner, body) {
|
|
@@ -50,13 +50,15 @@ export function projectStartup(opts, provider, coreSection, indexFile) {
|
|
|
50
50
|
const file = provider.name === 'openclaw' ? path.join(opts.activeWorkspace, 'AGENTS.md')
|
|
51
51
|
: path.join(opts.target, owner || 'AGENTS.md');
|
|
52
52
|
retireInlineStartup(opts, provider, file);
|
|
53
|
-
const files = provider.name === 'hermes' ? [file, path.join(opts.target, '.hermes.md')]
|
|
53
|
+
const files = provider.name === 'hermes' ? [file, path.join(opts.target, '.hermes.md')]
|
|
54
|
+
: provider.name === 'openclaw' ? [...new Set([file, path.join(opts.target, 'AGENTS.md')])] : [file];
|
|
54
55
|
for (const startup of files) {
|
|
55
56
|
let content = provider.name === 'flue' ? read(startup) : normalizeRuleStartup(read(startup), bootstrap, path.basename(startup) === 'AGENTS.md');
|
|
56
57
|
if (provider.name !== 'flue' || coreSection) content = section(content, 'rule-core', coreSection.replace(/<!-- AIWG:(?:core-rules|rule-core):(?:start|end) -->\n?/g, '').trimEnd());
|
|
57
58
|
const logical = opts.logicalOutputPath || (file => file);
|
|
58
59
|
const location = path.relative(logical(opts.target), logical(indexFile)).replaceAll('\\', '/');
|
|
59
60
|
let hook = `${provider.name}: Before every task and subagent task, read and follow \`${location}\`; read every listed kernel file and fetch matching full rules before governed work.`;
|
|
61
|
+
if (['codex', 'muse'].includes(provider.name)) hook = `${provider.name}: On every new directive, including subagent tasks, run \`aiwg discover\` as the first information-gathering call, before tool-based context reads. After discovery, read and follow \`${location}\`; read every listed kernel file and fetch matching full rules before governed work.`;
|
|
60
62
|
if (CONTEXT_CONTRACTS[provider.name]?.promptDiscovery?.delivery === 'bootstrap-rule') {
|
|
61
63
|
hook += " Before any other tool call or answer on every new request, run `aiwg discover --stdin <<'AIWG_REQUEST'` "
|
|
62
64
|
+ "with the request text on the next lines and `AIWG_REQUEST` alone on the last line; never put request text in quotes on a command line. "
|
|
@@ -17,7 +17,11 @@ export function removeSkillCopy(dir, opts = {}) {
|
|
|
17
17
|
return false;
|
|
18
18
|
};
|
|
19
19
|
let receipt;
|
|
20
|
-
try {
|
|
20
|
+
try {
|
|
21
|
+
const manifest = path.join(dir, '.aiwg-manifest.json');
|
|
22
|
+
if (!fs.lstatSync(manifest).isFile()) return keep('unverifiable ownership');
|
|
23
|
+
receipt = JSON.parse(fs.readFileSync(manifest, 'utf8'));
|
|
24
|
+
}
|
|
21
25
|
catch (error) {
|
|
22
26
|
if (opts.bundleOnly) return false;
|
|
23
27
|
// Only a missing receipt may use legacy ownership. An invalid receipt must
|