@aopslabs/aops 0.3.31 → 0.3.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +11 -3
  2. package/aops-assets-release/aops-assets.json.gz +0 -0
  3. package/aops-assets-release/disciplines/build-review-chat/SKILL.md +33 -0
  4. package/aops-assets-release/disciplines/coordinator-loop/SKILL.md +33 -0
  5. package/aops-assets-release/disciplines/design-first-consensus/SKILL.md +30 -0
  6. package/aops-assets-release/disciplines/solo-pm-loop/SKILL.md +31 -0
  7. package/aops-assets-release/docs/user-guides/agentspace-user-guide.md +384 -0
  8. package/aops-assets-release/docs/user-guides/aops-cli-user-guide.md +2067 -0
  9. package/aops-assets-release/docs/user-guides/chatv3-user-guide.md +500 -0
  10. package/aops-assets-release/docs/user-guides/docman-user-guide.md +1009 -0
  11. package/aops-assets-release/docs/user-guides/projectman-user-guide.md +763 -0
  12. package/aops-assets-release/docs/user-guides/tasker-user-guide.md +244 -0
  13. package/aops-assets-release/release.json +6 -0
  14. package/aops-assets-release/roles/coordinator/ROLE.md +28 -0
  15. package/aops-assets-release/roles/implementer/ROLE.md +27 -0
  16. package/aops-assets-release/roles/reviewer/ROLE.md +27 -0
  17. package/aops-assets-release/skills/aops/SKILL.md +112 -0
  18. package/aops-assets-release/skills/aops-bootstrapper-authoring/SKILL.md +245 -0
  19. package/aops-assets-release/skills/aops-cli-agentspace/SKILL.md +186 -0
  20. package/aops-assets-release/skills/aops-cli-board-lifecycle/SKILL.md +64 -0
  21. package/aops-assets-release/skills/aops-cli-chat/SKILL.md +204 -0
  22. package/aops-assets-release/skills/aops-cli-collab/SKILL.md +42 -0
  23. package/aops-assets-release/skills/aops-cli-core/SKILL.md +219 -0
  24. package/aops-assets-release/skills/aops-cli-discuss/SKILL.md +172 -0
  25. package/aops-assets-release/skills/aops-cli-docman/SKILL.md +192 -0
  26. package/aops-assets-release/skills/aops-cli-fileman/SKILL.md +169 -0
  27. package/aops-assets-release/skills/aops-cli-mission/SKILL.md +128 -0
  28. package/aops-assets-release/skills/aops-cli-operator-brief/SKILL.md +67 -0
  29. package/aops-assets-release/skills/aops-cli-projectman/SKILL.md +235 -0
  30. package/aops-assets-release/skills/aops-cli-sugar-authoring/SKILL.md +188 -0
  31. package/aops-assets-release/skills/aops-cli-tasker/SKILL.md +108 -0
  32. package/aops-assets-release/skills/aops-cli-tooling-agent/SKILL.md +112 -0
  33. package/aops-assets-release/skills/aops-cli-view/SKILL.md +210 -0
  34. package/aops-assets-release/skills/aops-collaborative-work/SKILL.md +304 -0
  35. package/aops-assets-release/skills/aops-interactive/SKILL.md +70 -0
  36. package/aops-assets-release/skills/aops-loop-interactive/SKILL.md +314 -0
  37. package/aops-assets-release/skills/aops-working-disciplines/SKILL.md +310 -0
  38. package/aops-assets-release/skills/feature-retirement-flow/SKILL.md +126 -0
  39. package/assets/skills/aops-install/SKILL.md +18 -17
  40. package/dist/commands/assets.js +93 -1264
  41. package/dist/commands/community-server.js +27 -8
  42. package/dist/commands/community-setup.js +1 -2
  43. package/dist/commands/discuss.js +1 -1
  44. package/dist/commands/doc.js +88 -27
  45. package/dist/commands/docs.js +68 -0
  46. package/dist/commands/global-update.js +28 -0
  47. package/dist/commands/init.js +3 -1
  48. package/dist/commands/loop.js +6379 -0
  49. package/dist/commands/memory.js +2 -1
  50. package/dist/commands/pm/index.js +11 -9
  51. package/dist/commands/pm/projectman.js +33 -2
  52. package/dist/commands/project.js +6 -6
  53. package/dist/commands/prompt.js +1 -1
  54. package/dist/commands/repo-sync.js +92 -27
  55. package/dist/commands/runner.js +257 -0
  56. package/dist/commands/skill.js +1 -1
  57. package/dist/commands/start.js +1 -1
  58. package/dist/commands/tasker.js +361 -0
  59. package/dist/commands/view.js +53 -9
  60. package/dist/lib/commercial-setup-readiness-adapter.js +0 -1
  61. package/dist/lib/community-migration-snapshot.js +7 -9
  62. package/dist/lib/community-native-database-recovery.js +5 -14
  63. package/dist/lib/community-native-lifecycle.js +13 -0
  64. package/dist/lib/setup-agent-assets-bridge.js +28 -148
  65. package/dist/lib/setup-agent-assets-release.js +16 -44
  66. package/dist/lib/setup-init-orchestrator.js +11 -15
  67. package/dist/lib/simple-agent-assets.js +447 -0
  68. package/dist/lib/user-guide-sections.js +488 -0
  69. package/dist/main.js +10 -2
  70. package/dist/seeds/agents-md.js +3 -3
  71. package/dist/utils/agents-md.js +1 -1
  72. package/dist/utils/guide-paths.js +7 -7
  73. package/dist/utils/hosted-workspace.js +2 -1
  74. package/dist/utils/repo-first-storage.js +26 -1
  75. package/dist/utils/session-state.js +2 -7
  76. package/launchers/aops-cockpit.sh +0 -0
  77. package/launchers/aops-server.sh +0 -0
  78. package/package.json +67 -35
  79. package/THIRD_PARTY_NOTICES +0 -16169
  80. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/SKILL.md +0 -47
  81. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/agentspace/SKILL.md +0 -72
  82. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/aops-cli-core/SKILL.md +0 -110
  83. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/chatv3/SKILL.md +0 -59
  84. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/collaborative-work/SKILL.md +0 -81
  85. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/discuss/SKILL.md +0 -66
  86. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/docman/SKILL.md +0 -75
  87. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/projectman/SKILL.md +0 -92
  88. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/sys/SKILL.md +0 -36
  89. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/view/SKILL.md +0 -58
  90. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/references/working-disciplines/SKILL.md +0 -66
  91. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/agent-assets.md +0 -81
  92. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/agentspace.md +0 -183
  93. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/aops-cli.md +0 -1108
  94. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/aops-system.md +0 -102
  95. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/chatv3.md +0 -113
  96. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/docman.md +0 -223
  97. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/projectman.md +0 -233
  98. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/sys.md +0 -94
  99. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/files/user-guides/working-disciplines.md +0 -482
  100. package/agent-assets-release/agent-assets/core/bc42dd7792dbe66040e99a7ef3d80b3bc788c72b369b5a065cf936aef29f53fb/manifest.json +0 -117
  101. package/agent-assets-release/agent-assets/gateway/aops/SKILL.md +0 -14
  102. package/agent-assets-release/agent-assets/inventory.json +0 -29
  103. package/agent-assets-release/agent-assets/projection.json +0 -8
  104. package/agent-assets-release/agent-assets-release.json +0 -171
  105. package/agent-assets-release/agent-assets-release.sigstore.json +0 -67
  106. package/assets/agent-assets/core/SKILL.md +0 -47
  107. package/assets/agent-assets/core/references/agentspace/SKILL.md +0 -72
  108. package/assets/agent-assets/core/references/aops-cli-core/SKILL.md +0 -110
  109. package/assets/agent-assets/core/references/chatv3/SKILL.md +0 -59
  110. package/assets/agent-assets/core/references/collaborative-work/SKILL.md +0 -81
  111. package/assets/agent-assets/core/references/discuss/SKILL.md +0 -66
  112. package/assets/agent-assets/core/references/docman/SKILL.md +0 -75
  113. package/assets/agent-assets/core/references/projectman/SKILL.md +0 -92
  114. package/assets/agent-assets/core/references/sys/SKILL.md +0 -36
  115. package/assets/agent-assets/core/references/view/SKILL.md +0 -58
  116. package/assets/agent-assets/core/references/working-disciplines/SKILL.md +0 -66
  117. package/assets/agent-assets/core/user-guides/agent-assets.md +0 -81
  118. package/assets/agent-assets/core/user-guides/agentspace.md +0 -183
  119. package/assets/agent-assets/core/user-guides/aops-cli.md +0 -1108
  120. package/assets/agent-assets/core/user-guides/aops-system.md +0 -102
  121. package/assets/agent-assets/core/user-guides/chatv3.md +0 -113
  122. package/assets/agent-assets/core/user-guides/docman.md +0 -223
  123. package/assets/agent-assets/core/user-guides/projectman.md +0 -233
  124. package/assets/agent-assets/core/user-guides/sys.md +0 -94
  125. package/assets/agent-assets/core/user-guides/working-disciplines.md +0 -482
  126. package/assets/agent-assets/gateway/aops/SKILL.md +0 -14
  127. package/dist/lib/agent-assets/gateway.js +0 -15
  128. package/dist/lib/agent-assets/guards.js +0 -23
  129. package/dist/lib/agent-assets/hosted-discovery.js +0 -148
  130. package/dist/lib/agent-assets/hosted-package-input.js +0 -154
  131. package/dist/lib/agent-assets/legacy-pointer-migration.js +0 -677
  132. package/dist/lib/agent-assets/native-fs.js +0 -589
  133. package/dist/lib/agent-assets/roots.js +0 -45
  134. package/dist/lib/agent-assets/runtime-binding-reader.js +0 -545
  135. package/dist/lib/agent-assets/runtime-targets.js +0 -50
  136. package/dist/lib/agent-assets/store-reader.js +0 -1212
  137. package/dist/lib/agent-assets/store-writer.js +0 -1484
  138. package/native/bin/darwin-arm64/aops-agent-assets-fs +0 -0
  139. package/native/bin/darwin-x64/aops-agent-assets-fs +0 -0
  140. package/native/bin/linux-arm64/aops-agent-assets-fs +0 -0
  141. package/native/bin/linux-x64/aops-agent-assets-fs +0 -0
  142. package/native/bin/win32-x64/aops-agent-assets-fs.exe +0 -0
  143. package/native/manifest.json +0 -49
  144. package/native/qualifications/win32-x64.json +0 -23
  145. package/native/tui/darwin-arm64/aops-tui +0 -0
  146. package/native/tui/linux-x64/aops-tui +0 -0
  147. package/native/tui/win32-x64/aops-tui.exe +0 -0
@@ -20,7 +20,7 @@ import { asCommunityDiagnosticError } from '../lib/community-diagnostic.js';
20
20
  import { assertCommunityNativePathLayout, attestCommunityNativeExternalSnapshot, inspectCommunityNativeInstall, inspectCommunityNativeRuntime, loadExternalPostgresUrl, loadExternalServerAuthConfig, planCommunityNativeInstalledMigration, readCommunityNativeLogs, rollbackCommunityNativeApplication, resolveCommunityNativeInstalledNpmSourceRoot, resolveCommunityNativeLaunchMode, resolveCommunityNativePaths, setupCommunityNativeInstall, startCommunityNativeInstall, stopCommunityNativeInstall, } from '../lib/community-native-lifecycle.js';
21
21
  import { inspectPgToolchain, locatePgTool, pgEnvironmentFromUrl } from '../lib/pg-tool-location.js';
22
22
  import { readAopsServerEnvConfig } from '../utils/community-host-runtime.js';
23
- import { inspectCommunityNativeApplicationRecoveryStatus } from '../lib/community-native-application-recovery.js';
23
+ import { inspectCommunityNativeApplicationRecoveryStatus, readCommunityNativeApplicationUpdate, } from '../lib/community-native-application-recovery.js';
24
24
  import { inspectCommunityNativeDatabaseRecoveryStatus, restoreCommunityNativeDatabaseForUpdate, } from '../lib/community-native-database-recovery.js';
25
25
  import { inspectCommunityNativePostgres, removeCommunityNativePostgresContainerForReset, removeCommunityNativeManagedPostgres, } from '../lib/community-native-postgres.js';
26
26
  import { stopCommunityNativeCockpit } from '../lib/community-cockpit-lifecycle.js';
@@ -1420,12 +1420,28 @@ export async function runCommunityServerRollbackApplication(options, dependencie
1420
1420
  throw new Error('community_native_application_rollback_update_id_required');
1421
1421
  if (!options.sourceRoot)
1422
1422
  throw new Error('community_native_application_rollback_source_root_required');
1423
- if (options.confirmDataRewind === true) {
1424
- throw new Error('community_native_application_rollback_data_rewind_option_refused');
1425
- }
1426
1423
  await withMutatingCommandScope(dependencies, async (runtime, signal) => {
1427
- const result = await withNativeOperation(options, 'rollback', runtime, signal, async (locked) => {
1428
- return runtime.rollbackNativeApplication({
1424
+ const operation = await withNativeOperation(options, 'rollback', runtime, signal, async (locked) => {
1425
+ const update = readCommunityNativeApplicationUpdate(locked.paths, options.updateId);
1426
+ let databaseRewound = false;
1427
+ if (update.outcome?.migration?.action === 'migrate') {
1428
+ if (options.confirmDataRewind !== true) {
1429
+ throw new Error('community_native_application_rollback_data_rewind_confirmation_required');
1430
+ }
1431
+ const restored = await runtime.restoreNativeDatabase({
1432
+ paths: locked.paths,
1433
+ state: locked.state,
1434
+ updateId: options.updateId,
1435
+ sourceRoot: path.resolve(options.sourceRoot),
1436
+ confirmDataRewind: true,
1437
+ signal,
1438
+ });
1439
+ if (restored.actionRequired || !restored.completed || !restored.dataRewound) {
1440
+ throw new Error('community_native_application_rollback_database_restore_incomplete');
1441
+ }
1442
+ databaseRewound = true;
1443
+ }
1444
+ const result = await runtime.rollbackNativeApplication({
1429
1445
  instanceName: locked.state.instanceName,
1430
1446
  dataRoot: locked.paths.dataRoot,
1431
1447
  updateId: options.updateId,
@@ -1434,8 +1450,10 @@ export async function runCommunityServerRollbackApplication(options, dependencie
1434
1450
  readyTimeoutMs: resolveReadyTimeoutMs(options),
1435
1451
  signal,
1436
1452
  });
1453
+ return { result, databaseRewound };
1437
1454
  });
1438
1455
  throwIfCommunityCommandAborted(signal);
1456
+ const { result, databaseRewound } = operation;
1439
1457
  const rollback = result.applicationUpdate.rollbackOutcome;
1440
1458
  if (!rollback || rollback.status !== 'community-native-application-rolled-back') {
1441
1459
  throw new Error('community_native_application_rollback_receipt_missing');
@@ -1448,7 +1466,7 @@ export async function runCommunityServerRollbackApplication(options, dependencie
1448
1466
  applicationContentSha256: result.applicationUpdate.prepared.prior.content.applicationContentSha256,
1449
1467
  databaseAction: rollback.migration?.action,
1450
1468
  databasePlanSha256: rollback.migration?.acceptedPlanSha256,
1451
- databaseRewound: false,
1469
+ databaseRewound,
1452
1470
  }, options.json);
1453
1471
  if (result.launch.waitForExit)
1454
1472
  await result.launch.waitForExit();
@@ -2310,9 +2328,10 @@ export function makeCommunityServerCommand(identity = {}) {
2310
2328
  const rollback = common(command.command('rollback').description('Rollback application code; legacy flat form remains OCI-only until P4'))
2311
2329
  .option('--confirm-data-rewind', 'Confirm that data will be rewound to the pre-update backup')
2312
2330
  .action((options) => runCommunityServerRollback(options, dependencies));
2313
- common(rollback.command('app').description('Rollback only native application code; never restore or rewind PostgreSQL'))
2331
+ common(rollback.command('app').description('Rollback one native application update; restore its exact pre-migration snapshot when required'))
2314
2332
  .requiredOption('--update-id <id>', 'Exact native application update ID')
2315
2333
  .requiredOption('--source-root <path>', 'Exact prior public release checkout; the CLI never downloads or changes it')
2334
+ .option('--confirm-data-rewind', 'Confirm exact pre-migration snapshot restore when this update changed PostgreSQL')
2316
2335
  .option('--foreground', 'Keep the rolled-back native server attached to this terminal')
2317
2336
  .option('--detach', 'Start the rolled-back native server in the background (default)')
2318
2337
  .option('--ready-timeout-ms <milliseconds>', 'Native Server readiness budget from 1000 to 900000 ms; default 120000')
@@ -146,8 +146,7 @@ function addSetupInitOptions(command) {
146
146
  .option('--target-name <name>', 'Persistent target name for path 4')
147
147
  .option('--target-auth-provider <provider>', 'Path 4 target auth: trusted-local | remote-session (authv2-jwt-session is a one-release alias)')
148
148
  .option('--target-tls-policy <policy>', 'Path 4 target TLS: loopback-http for local trusted targets, system-ca for remote-session')
149
- .option('--agent-assets <action>', 'Global AOPS gateway action: status | install | repair | skip')
150
- .option('--agent-assets-release <path>', 'Advanced offline/maintainer override for --agent-assets install')
149
+ .option('--agent-assets <action>', 'Global AOPS skill action: status | install | skip')
151
150
  .option('--no-catalog', 'Skip the default inert official server catalog import')
152
151
  .option('--catalog-release <path>', 'Explicit verified-release override (normally resolved from the Community install)')
153
152
  .option('--catalog-idempotency-key <key>', 'Explicit official catalog reconcile replay key')
@@ -1207,7 +1207,7 @@ export function makeDiscussCommand() {
1207
1207
  cmd.addHelpText('after', `
1208
1208
  Server-first discussion (no local files):
1209
1209
  Source of truth is the hosted Agentspace discussion ops. The CLI never writes
1210
- or reads .aops/agentspace/discussions; create/write/read all go through the
1210
+ or reads .aops-cache/agentspace/discussions; create/write/read all go through the
1211
1211
  hosted gateway. discussion-topic.status/.get are authoritative; the CLI maps
1212
1212
  server data into lifecycleState/nextTurn/openQuestions for UX only.
1213
1213
 
@@ -1991,7 +1991,7 @@ function localMirrorLimit(value) {
1991
1991
  return parsed && parsed > 0 ? parsed : 10;
1992
1992
  }
1993
1993
  function resolveDocMirrorRoot(context, mirrorDir) {
1994
- const requested = normalizeNonEmpty(mirrorDir) ?? path.join('.aops', 'docman');
1994
+ const requested = normalizeNonEmpty(mirrorDir) ?? path.join('.aops-cache', 'docman');
1995
1995
  return path.isAbsolute(requested) ? requested : path.resolve(context.repoRoot, requested);
1996
1996
  }
1997
1997
  function resolveLocalMirrorIndexPath(root) {
@@ -2968,7 +2968,7 @@ export async function runDocMirrorPull(options = {}) {
2968
2968
  if (target !== 'markdown' && target !== 'html') {
2969
2969
  throw new Error('Target must be markdown or html.');
2970
2970
  }
2971
- const outputRoot = path.resolve(normalizeNonEmpty(options.outDir) ?? path.join('.aops', 'docman'));
2971
+ const outputRoot = path.resolve(normalizeNonEmpty(options.outDir) ?? path.join('.aops-cache', 'docman'));
2972
2972
  const groupUid = normalizeNonEmpty(options.groupUid);
2973
2973
  const groups = await listDocGroups(apiState, options, resolvedContext);
2974
2974
  const groupsById = new Map();
@@ -3085,7 +3085,7 @@ export async function runDocMirrorPull(options = {}) {
3085
3085
  if (await guardMirrorFileWrite({
3086
3086
  options,
3087
3087
  command: 'doc.mirror.pull',
3088
- surface: 'docman materialize -> .aops/docman',
3088
+ surface: 'docman materialize -> .aops-cache/docman',
3089
3089
  resolvedContext,
3090
3090
  input,
3091
3091
  }))
@@ -3206,7 +3206,7 @@ export async function runDocMirrorPull(options = {}) {
3206
3206
  await emitDocResult({
3207
3207
  options,
3208
3208
  command: 'doc.mirror.pull',
3209
- surface: 'docman materialize -> .aops/docman',
3209
+ surface: 'docman materialize -> .aops-cache/docman',
3210
3210
  resolvedContext,
3211
3211
  input,
3212
3212
  result: {
@@ -3697,6 +3697,36 @@ export async function runDocCreate(options = {}) {
3697
3697
  process.exitCode = 1;
3698
3698
  }
3699
3699
  }
3700
+ export function buildDocDeleteInput(options) {
3701
+ const id = normalizeNonEmpty(options.id);
3702
+ if (!id)
3703
+ throw new Error('Provide --id.');
3704
+ if (typeof options.confirmName !== 'string' || options.confirmName.length === 0) {
3705
+ throw new Error('Provide --confirm-name with the exact document title.');
3706
+ }
3707
+ return { id, confirmName: options.confirmName };
3708
+ }
3709
+ export async function runDocDelete(options = {}) {
3710
+ try {
3711
+ const input = buildDocDeleteInput(options);
3712
+ const apiState = await requireApiState(options);
3713
+ if (!apiState)
3714
+ return;
3715
+ const resolvedContext = await resolveDocContext(options, apiState);
3716
+ await invokeDocCrudMutationTool(apiState, options, resolvedContext, {
3717
+ command: 'doc.delete',
3718
+ toolId: 'docman.document.delete.safe',
3719
+ input,
3720
+ successText: 'Document deleted safely.',
3721
+ destructive: true,
3722
+ artifacts: collectDocArtifacts,
3723
+ });
3724
+ }
3725
+ catch (error) {
3726
+ logError(error instanceof Error ? error.message : String(error));
3727
+ process.exitCode = 1;
3728
+ }
3729
+ }
3700
3730
  export async function runDocGroupCreate(options = {}) {
3701
3731
  try {
3702
3732
  const seed = readJsonObjectInput(options.input);
@@ -4528,9 +4558,31 @@ export async function runDocPageUnlink(options = {}) {
4528
4558
  const resolvedContext = await resolveDocContext(options, apiState);
4529
4559
  await invokeDocCrudMutationTool(apiState, options, resolvedContext, {
4530
4560
  command: 'doc.page.unlink',
4561
+ toolId: 'docman.document-section-link.delete',
4562
+ input: { id: linkId },
4563
+ successText: 'Page node unlinked from the document outline.',
4564
+ artifacts: collectDocArtifacts,
4565
+ });
4566
+ }
4567
+ catch (error) {
4568
+ logError(error instanceof Error ? error.message : String(error));
4569
+ process.exitCode = 1;
4570
+ }
4571
+ }
4572
+ export async function runDocSectionPageLinkDelete(options = {}) {
4573
+ try {
4574
+ const linkId = normalizeNonEmpty(options.linkId);
4575
+ if (!linkId)
4576
+ throw new Error('Provide --link-id.');
4577
+ const apiState = await requireApiState(options);
4578
+ if (!apiState)
4579
+ return;
4580
+ const resolvedContext = await resolveDocContext(options, apiState);
4581
+ await invokeDocCrudMutationTool(apiState, options, resolvedContext, {
4582
+ command: 'doc.page.membership-unlink',
4531
4583
  toolId: 'docman.section-page-link.delete',
4532
4584
  input: { id: linkId },
4533
- successText: 'Page unlinked.',
4585
+ successText: 'Reusable section page link deleted.',
4534
4586
  artifacts: collectDocArtifacts,
4535
4587
  });
4536
4588
  }
@@ -5395,6 +5447,13 @@ export function makeDocCommand() {
5395
5447
  .option('--tag <value>', 'Repeatable tag', collectRepeatedOption, [])).action(async (options) => {
5396
5448
  await runDocUpdate(options);
5397
5449
  }));
5450
+ applyDocContextOptions(applyWriteOptions(cmd
5451
+ .command('delete')
5452
+ .description('Safely delete one Docman document graph after exact title confirmation')
5453
+ .requiredOption('--id <id>', 'Document id')
5454
+ .requiredOption('--confirm-name <title>', 'Exact current document title required by document.delete.safe')).action(async (options) => {
5455
+ await runDocDelete(options);
5456
+ }));
5398
5457
  const group = cmd.command('group').description('Docman document-group commands');
5399
5458
  applyDocContextOptions(group
5400
5459
  .command('list')
@@ -5623,10 +5682,16 @@ export function makeDocCommand() {
5623
5682
  }));
5624
5683
  applyDocContextOptions(applyWriteOptions(page
5625
5684
  .command('unlink')
5626
- .description('Unlink a page version from a section without deleting the page')
5627
- .requiredOption('--link-id <id>', 'Section-page-link id')).action(async (options) => {
5685
+ .description('Unlink a page node created in the document outline without deleting the page')
5686
+ .requiredOption('--link-id <id>', 'Document-section-link id whose kind is page')).action(async (options) => {
5628
5687
  await runDocPageUnlink(options);
5629
5688
  }));
5689
+ applyDocContextOptions(applyWriteOptions(page
5690
+ .command('membership-unlink')
5691
+ .description('Delete a reusable section-page-link without deleting the page')
5692
+ .requiredOption('--link-id <id>', 'Section-page-link id')).action(async (options) => {
5693
+ await runDocSectionPageLinkDelete(options);
5694
+ }));
5630
5695
  applyDocContextOptions(applyWriteOptions(page
5631
5696
  .command('draft-save')
5632
5697
  .description('Create or update a page-version draft through the canonical flow surface')
@@ -5696,12 +5761,6 @@ export function makeDocCommand() {
5696
5761
  .option('--numbering <text>', 'Optional numbering override')).action(async (options) => {
5697
5762
  await runDocLinkPage(options);
5698
5763
  }));
5699
- applyDocContextOptions(applyWriteOptions(linkPage
5700
- .command('delete')
5701
- .description('Alias for doc page unlink')
5702
- .requiredOption('--link-id <id>', 'Section-page-link id')).action(async (options) => {
5703
- await runDocPageUnlink(options);
5704
- }));
5705
5764
  const order = cmd.command('order').description('Docman outline ordering commands');
5706
5765
  applyDocContextOptions(applyWriteOptions(order
5707
5766
  .command('sections')
@@ -5753,9 +5812,9 @@ export function makeDocCommand() {
5753
5812
  .option('--limit <count>', 'Result limit', (value) => Number.parseInt(String(value), 10))
5754
5813
  .option('--retrieval-strategy <mode>', 'Retrieval strategy: lexical, hybrid, semantic', 'hybrid')
5755
5814
  .option('--ensure <mode>', 'Hosted pre-read build: none = read existing, index = refresh rows, summary = refresh rows + summaries', 'summary')
5756
- .option('--local', 'Search only the repo-local .aops/docman mirror')
5815
+ .option('--local', 'Search only the repo-local .aops-cache/docman mirror')
5757
5816
  .option('--remote', 'Use the hosted Docman API directly instead of local-first auto mode')
5758
- .option('--mirror-dir <path>', 'Repo-local Docman mirror directory for local-first/--local', path.join('.aops', 'docman'))
5817
+ .option('--mirror-dir <path>', 'Repo-local Docman mirror directory for local-first/--local', path.join('.aops-cache', 'docman'))
5759
5818
  .action(async (options) => {
5760
5819
  await runDocSearch(options);
5761
5820
  }));
@@ -5766,9 +5825,9 @@ export function makeDocCommand() {
5766
5825
  .requiredOption('--q <text>', 'Search query')
5767
5826
  .option('--limit <count>', 'Result limit', (value) => Number.parseInt(String(value), 10))
5768
5827
  .option('--retrieval-strategy <mode>', 'Retrieval strategy: lexical, hybrid, semantic', 'hybrid')
5769
- .option('--local', 'Search only the repo-local .aops/docman mirror')
5828
+ .option('--local', 'Search only the repo-local .aops-cache/docman mirror')
5770
5829
  .option('--remote', 'Use the hosted Docman API directly instead of local-first auto mode')
5771
- .option('--mirror-dir <path>', 'Repo-local Docman mirror directory for local-first/--local', path.join('.aops', 'docman'))
5830
+ .option('--mirror-dir <path>', 'Repo-local Docman mirror directory for local-first/--local', path.join('.aops-cache', 'docman'))
5772
5831
  .action(async (options) => {
5773
5832
  await runDocScopeSearch(options);
5774
5833
  }));
@@ -5778,9 +5837,9 @@ export function makeDocCommand() {
5778
5837
  .requiredOption('--q <text>', 'Question text')
5779
5838
  .option('--limit <count>', 'Citation limit', (value) => Number.parseInt(String(value), 10))
5780
5839
  .option('--retrieval-strategy <mode>', 'Retrieval strategy: lexical, hybrid, semantic', 'hybrid')
5781
- .option('--local', 'Read only from the repo-local .aops/docman mirror')
5840
+ .option('--local', 'Read only from the repo-local .aops-cache/docman mirror')
5782
5841
  .option('--remote', 'Use the hosted Docman API directly instead of local-first auto mode')
5783
- .option('--mirror-dir <path>', 'Repo-local Docman mirror directory for local-first/--local', path.join('.aops', 'docman'))
5842
+ .option('--mirror-dir <path>', 'Repo-local Docman mirror directory for local-first/--local', path.join('.aops-cache', 'docman'))
5784
5843
  .action(async (options) => {
5785
5844
  await runDocScopeAnswer(options);
5786
5845
  }));
@@ -5805,8 +5864,8 @@ export function makeDocCommand() {
5805
5864
  }));
5806
5865
  importCommand.addHelpText('after', buildOperatorCookbook({
5807
5866
  examples: [
5808
- 'aops-cli doc import --from-markdown --document-version-id <docver-id> --source ./candidate.md --baseline ./.aops/docman/<group>/<document>.md --guard-target "<intended heading>" --dry-run --json',
5809
- 'aops-cli doc import --from-markdown --document-version-id <docver-id> --source ./candidate.md --baseline ./.aops/docman/<group>/<document>.md --guard-target "<intended heading>" --synthesize-overview-pages --dry-run --json',
5867
+ 'aops-cli doc import --from-markdown --document-version-id <docver-id> --source ./candidate.md --baseline ./.aops-cache/docman/<group>/<document>.md --guard-target "<intended heading>" --dry-run --json',
5868
+ 'aops-cli doc import --from-markdown --document-version-id <docver-id> --source ./candidate.md --baseline ./.aops-cache/docman/<group>/<document>.md --guard-target "<intended heading>" --synthesize-overview-pages --dry-run --json',
5810
5869
  ],
5811
5870
  guide: GUIDE_PATHS.docman,
5812
5871
  notes: [
@@ -5855,7 +5914,7 @@ export function makeDocCommand() {
5855
5914
  .option('--document-slug <slug>', 'Only pull matching document slug (repeatable)', collectRepeatedOption, [])
5856
5915
  .option('--status <value>', 'Document status filter')
5857
5916
  .option('--limit <count>', 'Document limit', (value) => Number.parseInt(String(value), 10))
5858
- .option('--out-dir <path>', 'Repo-local mirror output directory', path.join('.aops', 'docman'))
5917
+ .option('--out-dir <path>', 'Repo-local mirror output directory', path.join('.aops-cache', 'docman'))
5859
5918
  .option('--target <target>', 'Publish target: markdown or html', 'markdown')).action(async (options) => {
5860
5919
  await runDocMirrorPull(options);
5861
5920
  }));
@@ -5867,9 +5926,9 @@ export function makeDocCommand() {
5867
5926
  .option('--limit <count>', 'Citation limit', (value) => Number.parseInt(String(value), 10))
5868
5927
  .option('--retrieval-strategy <mode>', 'Retrieval strategy: lexical, hybrid, semantic', 'hybrid')
5869
5928
  .option('--ensure <mode>', 'Hosted pre-read build: none = read existing, index = refresh rows, summary = refresh rows + summaries', 'summary')
5870
- .option('--local', 'Read a deterministic answer pack only from the repo-local .aops/docman mirror')
5929
+ .option('--local', 'Read a deterministic answer pack only from the repo-local .aops-cache/docman mirror')
5871
5930
  .option('--remote', 'Use the hosted Docman API directly instead of local-first auto mode')
5872
- .option('--mirror-dir <path>', 'Repo-local Docman mirror directory for local-first/--local', path.join('.aops', 'docman'))
5931
+ .option('--mirror-dir <path>', 'Repo-local Docman mirror directory for local-first/--local', path.join('.aops-cache', 'docman'))
5873
5932
  .action(async (options) => {
5874
5933
  await runDocAnswer(options);
5875
5934
  }));
@@ -5898,13 +5957,15 @@ export function makeDocCommand() {
5898
5957
  cmd.addHelpText('after', buildOperatorCookbook({
5899
5958
  examples: [
5900
5959
  'aops-cli doc create --title "Power Tree" --apply --json',
5960
+ 'aops-cli doc delete --id <doc-id> --confirm-name "Power Tree" --preview --json',
5961
+ 'aops-cli doc delete --id <doc-id> --confirm-name "Power Tree" --apply --confirm --json',
5901
5962
  'aops-cli doc group create --title "Guides" --apply --json',
5902
5963
  'aops-cli doc group list --json',
5903
5964
  'aops-cli doc version create --document-id <doc-id> --version 1 --status draft --apply --json',
5904
5965
  'aops-cli doc section create --document-version-id <docver-id> --title "Overview" --apply --json',
5905
5966
  'aops-cli doc page create --document-version-id <docver-id> --section-id <section-id> --title "Startup" --content \'@./page.md\' --apply --json',
5906
5967
  'aops-cli doc import --from-markdown --document-version-id <docver-id> --source ./ui-system-v2.md --dry-run --json',
5907
- 'aops-cli doc import --from-markdown --document-version-id <docver-id> --source ./user_guide.md --baseline ./.aops/docman/eops-cli/user_guide.md --guard-target "BOM Variant Build Models" --dry-run --json',
5968
+ 'aops-cli doc import --from-markdown --document-version-id <docver-id> --source ./user_guide.md --baseline ./.aops-cache/docman/eops-cli/user_guide.md --guard-target "BOM Variant Build Models" --dry-run --json',
5908
5969
  'aops-cli doc import --from-markdown --document-version-id <docver-id> --source ./ui-system-v2.md --apply --json',
5909
5970
  'aops-cli doc outline get --document-version-id <docver-id> --json',
5910
5971
  'aops-cli doc index build --document-version-id <docver-id> --json',
@@ -5915,7 +5976,7 @@ export function makeDocCommand() {
5915
5976
  'aops-cli doc answer --document-version-id <docver-id> --q "Enable pin behavior?" --json',
5916
5977
  'aops-cli doc answer --document-version-id <docver-id> --q "Enable pin behavior?" --remote --ensure summary --json',
5917
5978
  'aops-cli doc publish --document-version-id <docver-id> --target markdown --out ./tmp/doc.md',
5918
- 'aops-cli doc mirror pull --project-slug aops --group-uid architecture --out-dir ./.aops/docman --apply --json',
5979
+ 'aops-cli doc mirror pull --project-slug aops --group-uid architecture --out-dir ./.aops-cache/docman --apply --json',
5919
5980
  'aops-cli doc mirror push --project-slug aops --source-dir ./docs --group-uid architecture --group-title Architecture --apply --json # import-only helper',
5920
5981
  'aops-cli doc scope search --project-id <project-id> --q "startup current" --json',
5921
5982
  'aops-cli doc scope answer --project-id <project-id> --q "startup current" --json',
@@ -5927,7 +5988,7 @@ export function makeDocCommand() {
5927
5988
  notes: [
5928
5989
  'For one-page/one-section edits, prefer clone_all + page/section CRUD + set-current-version + mirror pull.',
5929
5990
  'Use doc import --baseline for full-document imports; apply is blocked on unrelated deltas unless --confirm is explicit.',
5930
- '.aops/docman/** is a read-only mirror. Refresh it with doc mirror pull after canonical Docman changes.',
5991
+ '.aops-cache/docman/** is a generated mirror. Refresh it with doc mirror pull after canonical Docman changes; only text-file v3 sidecars are eligible for doc mirror push.',
5931
5992
  ],
5932
5993
  }));
5933
5994
  return cmd;
@@ -0,0 +1,68 @@
1
+ import { readFileSync, writeFileSync } from 'node:fs';
2
+ import { resolve } from 'node:path';
3
+ import { Command } from 'commander';
4
+ import { refreshGeneratedUserGuideSections, refreshGeneratedDocmanGuideSections, refreshGeneratedChatv3GuideSections, refreshGeneratedAgentspaceGuideSections, refreshGeneratedTaskerGuideSections, renderGeneratedUserGuideSections, renderGeneratedDocmanGuideSections, renderGeneratedChatv3GuideSections, renderGeneratedAgentspaceGuideSections, renderGeneratedTaskerGuideSections, } from '../lib/user-guide-sections.js';
5
+ export function makeDocsCommand(getProgram) {
6
+ const command = new Command('docs').description('Generate AOPS documentation sections from live CLI registrations');
7
+ command
8
+ .command('user-guide')
9
+ .description('Generate or refresh the dynamic appendix sections in the AOPS CLI user guide')
10
+ .option('--guide <name>', 'Guide profile: aops-cli, docman, chatv3, agentspace, or tasker', 'aops-cli')
11
+ .option('--source <path>', 'Authored Markdown containing an Appendices section and generated markers')
12
+ .option('--out <path>', 'Write the generated Markdown to this path instead of stdout')
13
+ .option('--check', 'Fail without writing when --source is not already current')
14
+ .action((options) => {
15
+ if (options.check && !options.source) {
16
+ throw new Error('user_guide_check_requires_source');
17
+ }
18
+ if (options.check && options.out) {
19
+ throw new Error('user_guide_check_does_not_write');
20
+ }
21
+ const program = getProgram();
22
+ if (options.guide !== 'aops-cli'
23
+ && options.guide !== 'docman'
24
+ && options.guide !== 'chatv3'
25
+ && options.guide !== 'agentspace'
26
+ && options.guide !== 'tasker') {
27
+ throw new Error('user_guide_profile_must_be_aops_cli_docman_chatv3_agentspace_or_tasker');
28
+ }
29
+ const sourcePath = options.source ? resolve(options.source) : undefined;
30
+ const source = sourcePath ? readFileSync(sourcePath, 'utf8') : undefined;
31
+ const rendered = options.guide === 'docman'
32
+ ? source === undefined
33
+ ? renderGeneratedDocmanGuideSections(program)
34
+ : refreshGeneratedDocmanGuideSections(source, program)
35
+ : options.guide === 'chatv3'
36
+ ? source === undefined
37
+ ? renderGeneratedChatv3GuideSections(program)
38
+ : refreshGeneratedChatv3GuideSections(source, program)
39
+ : options.guide === 'agentspace'
40
+ ? source === undefined
41
+ ? renderGeneratedAgentspaceGuideSections(program)
42
+ : refreshGeneratedAgentspaceGuideSections(source, program)
43
+ : options.guide === 'tasker'
44
+ ? source === undefined
45
+ ? renderGeneratedTaskerGuideSections(program)
46
+ : refreshGeneratedTaskerGuideSections(source, program)
47
+ : source === undefined
48
+ ? renderGeneratedUserGuideSections(program)
49
+ : refreshGeneratedUserGuideSections(source, program);
50
+ if (options.check) {
51
+ if (rendered !== source) {
52
+ process.stderr.write(`AOPS CLI user guide generated sections are stale: ${sourcePath}\n`);
53
+ process.exitCode = 1;
54
+ return;
55
+ }
56
+ process.stdout.write(`AOPS CLI user guide generated sections are current: ${sourcePath}\n`);
57
+ return;
58
+ }
59
+ if (options.out) {
60
+ const outPath = resolve(options.out);
61
+ writeFileSync(outPath, rendered, 'utf8');
62
+ process.stdout.write(`${outPath}\n`);
63
+ return;
64
+ }
65
+ process.stdout.write(rendered);
66
+ });
67
+ return command;
68
+ }
@@ -774,6 +774,7 @@ function rollbackServerApplication(run, cliPath, updateId, serverPath, expectedR
774
774
  updateId,
775
775
  '--source-root',
776
776
  serverPath,
777
+ '--confirm-data-rewind',
777
778
  '--detach',
778
779
  '--json',
779
780
  ]);
@@ -781,6 +782,22 @@ function rollbackServerApplication(run, cliPath, updateId, serverPath, expectedR
781
782
  assert.equal(result.updateId, updateId);
782
783
  assert.equal(result.releaseVersion, expectedRelease);
783
784
  }
785
+ function restoreServerDatabase(run, cliPath, updateId, serverPath) {
786
+ const result = runInstalledJson(run, cliPath, [
787
+ 'server',
788
+ 'restore',
789
+ 'db',
790
+ '--update-id',
791
+ updateId,
792
+ '--source-root',
793
+ serverPath,
794
+ '--confirm-data-rewind',
795
+ '--json',
796
+ ]);
797
+ assert.equal(result.status, 'community-native-database-restored');
798
+ assert.equal(result.updateId, updateId);
799
+ assert.equal(result.dataRewound, true);
800
+ }
784
801
  const defaultExecutionDependencies = {
785
802
  fetch: globalThis.fetch.bind(globalThis),
786
803
  sleep: (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)),
@@ -1288,6 +1305,17 @@ export async function applyGlobalUpdate(options, run = defaultRunner, execution
1288
1305
  try {
1289
1306
  stopService(run, plan.cliPath, 'cockpit', true);
1290
1307
  stopService(run, plan.cliPath, 'server', true);
1308
+ if (applicationUpdateId) {
1309
+ const target = inspectGlobalInstall(run);
1310
+ try {
1311
+ restoreServerDatabase(run, target.cliPath, applicationUpdateId, target.serverPath);
1312
+ events.push('restored:server-database');
1313
+ }
1314
+ catch (error) {
1315
+ events.push('failed:server-database-restore');
1316
+ throw new ForwardSchemaRetainsTarget(error);
1317
+ }
1318
+ }
1291
1319
  installGlobalUpdateClosure(run, plan, plan.restorePackages, plan.prior.topology);
1292
1320
  events.push('installed:restore');
1293
1321
  const restored = inspectGlobalInstall(run);
@@ -5,6 +5,7 @@ import { Command } from 'commander';
5
5
  import { logError, logInfo, logSuccess, logWarn } from '@aopslabs/xf-cli-ui';
6
6
  import { findWorkspaceRoot } from '../utils/workspace-root.js';
7
7
  import { buildAopsRepoConfig } from '../utils/repo-config.js';
8
+ import { ensureAopsPrivatePathsIgnored } from '../utils/repo-first-storage.js';
8
9
  function nonEmpty(value) {
9
10
  if (typeof value !== 'string')
10
11
  return undefined;
@@ -26,7 +27,7 @@ This section is generated by AOPS Community.
26
27
 
27
28
  Server-first model:
28
29
  - The local AOPS server is canonical for Projectman, Agentspace, and Docman writes.
29
- - .aops/aops.config.json stores repo metadata; hosted mirror and planning views under .aops are read-only caches.
30
+ - .aops/aops.config.json stores private repo metadata; generated mirrors and planning views live under ignored .aops-cache.
30
31
  - Use aops-cli agent tools for capability discovery and aops-cli host health for readiness.
31
32
  - ChatV3 runs self-hosted/local-trusted in this distribution.
32
33
  `;
@@ -74,6 +75,7 @@ export async function runInit(options = {}) {
74
75
  const config = buildAopsRepoConfig({ repoName, projectName, projectSlug, projectId });
75
76
  await fs.mkdir(path.dirname(configPath), { recursive: true });
76
77
  await fs.writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
78
+ await ensureAopsPrivatePathsIgnored(rootDir);
77
79
  if (options.agentsMd !== false) {
78
80
  try {
79
81
  await writeCommunityAgentsSection(rootDir);