@indigoai-us/hq-cli 5.345.105 → 5.345.107

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 (60) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/assets/scaffold/core/scripts/hq-task.mjs +259 -0
  3. package/assets/scaffold/core/scripts/hq-task.sh +31 -0
  4. package/assets/scaffold/core/scripts/pipeline-worker-table.sh +285 -0
  5. package/dist/command-catalog.generated.d.ts +135 -5
  6. package/dist/command-catalog.generated.js +161 -5
  7. package/dist/commands/auth.js +42 -0
  8. package/dist/commands/core-hq-task-fast.d.ts +4 -0
  9. package/dist/commands/core-hq-task-fast.js +11 -0
  10. package/dist/commands/core-hq-task-native.d.ts +20 -0
  11. package/dist/commands/core-hq-task-native.js +275 -0
  12. package/dist/commands/core-native-bucket-c-flag.d.ts +3 -0
  13. package/dist/commands/core-native-bucket-c-flag.js +6 -0
  14. package/dist/commands/core-native-family-flag.d.ts +0 -2
  15. package/dist/commands/core-native-family-flag.js +0 -4
  16. package/dist/commands/core-native-pipeline-flag.d.ts +3 -0
  17. package/dist/commands/core-native-pipeline-flag.js +6 -0
  18. package/dist/commands/core-ontology-native.js +24 -30
  19. package/dist/commands/core-pipeline-workers-command.d.ts +3 -0
  20. package/dist/commands/core-pipeline-workers-command.js +37 -0
  21. package/dist/commands/core-pipeline-workers-native.d.ts +13 -0
  22. package/dist/commands/core-pipeline-workers-native.js +361 -0
  23. package/dist/commands/core.js +12 -10
  24. package/dist/commands/lanes.js +32 -7
  25. package/dist/commands/logout.d.ts +6 -1
  26. package/dist/commands/logout.js +18 -2
  27. package/dist/commands/outposts.d.ts +5 -0
  28. package/dist/commands/outposts.js +5 -0
  29. package/dist/fast-scaffold.d.ts +14 -1
  30. package/dist/fast-scaffold.js +149 -5
  31. package/dist/hq-cloud-sync-runner/bin/sync-runner.js +56937 -64550
  32. package/dist/hq-cloud-sync-runner/package.json +1 -1
  33. package/dist/index.js +15 -1
  34. package/dist/lib/daemon/remote-control-pools.d.ts +2 -2
  35. package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
  36. package/dist/lib/flag-registry-worker-source.generated.js +1 -1
  37. package/dist/lib/lanes/reconcile.js +4 -0
  38. package/dist/lib/lanes/remote-control-lane.d.ts +33 -0
  39. package/dist/lib/lanes/remote-control-lane.js +276 -0
  40. package/dist/lib/lanes/spawn.d.ts +5 -0
  41. package/dist/lib/lanes/spawn.js +65 -14
  42. package/dist/lib/lanes/store.js +7 -0
  43. package/dist/lib/lanes/types.d.ts +2 -0
  44. package/dist/lib/lanes/types.js +1 -1
  45. package/dist/lib/lanes/watcher.js +8 -1
  46. package/dist/utils/cognito-config.d.ts +5 -0
  47. package/dist/utils/cognito-config.js +14 -0
  48. package/dist/utils/cognito-revoke.d.ts +33 -0
  49. package/dist/utils/cognito-revoke.js +42 -0
  50. package/dist/utils/cognito-session.d.ts +12 -4
  51. package/dist/utils/cognito-session.js +42 -9
  52. package/dist/utils/token-keychain.d.ts +96 -0
  53. package/dist/utils/token-keychain.js +218 -0
  54. package/package.json +2 -2
  55. package/assets/scaffold/core/scripts/ontology-audience-grant.sh +0 -81
  56. package/assets/scaffold/core/scripts/ontology-brief.mjs +0 -93
  57. package/assets/scaffold/core/scripts/ontology-candidate.sh +0 -100
  58. package/assets/scaffold/core/scripts/ontology-garden.mjs +0 -327
  59. package/assets/scaffold/core/scripts/ontology-source-worklist.sh +0 -226
  60. package/assets/scaffold/core/scripts/source-yaml-validate.sh +0 -36
@@ -9,6 +9,142 @@
9
9
  * on every turn's Stop. The entrypoint routes eligible commands before loading
10
10
  * the graph, and this module holds the parser + table that routing needs.
11
11
  */
12
+ export const CORE_COMMAND_PATH_OPERANDS = {
13
+ "audit-log": "comma:--files",
14
+ "codex-skill-bridge": "options:--root,--old-root",
15
+ "git-pack-extension-check": "options:--root",
16
+ "job notify": "options:--hq-root,--log-path",
17
+ "hq-status-summary": "options:--porcelain-file,--session-files-file",
18
+ "ontology-readme-drift": "options:--root",
19
+ "policy age-report": "options:--dir",
20
+ "policy retire": "options:--dir,--report-dir",
21
+ "policy frontmatter": "all-nonoptions",
22
+ "qmd-reindex-after-sync": "first-nonoption",
23
+ "refresh-vault-access": "options:--root",
24
+ "resize-screenshot": "position:0",
25
+ "token-usage-report": "options:--project-dir",
26
+ worktree: "options:--source",
27
+ };
28
+ /** True when argv names a command that declares path operands. */
29
+ export function coreCommandHasPathOperands(argv) {
30
+ if (argv[2] !== "core")
31
+ return false;
32
+ const coreArgs = argv.slice(3);
33
+ if (coreArgs.some((value, index) => (value === "--hq-root" && coreArgs[index + 1]?.startsWith("/")) ||
34
+ (value.startsWith("--hq-root=") && value.slice("--hq-root=".length).startsWith("/")))) {
35
+ return true;
36
+ }
37
+ let commandStart = 3;
38
+ if (argv[commandStart] === "--hq-root")
39
+ commandStart += 2;
40
+ else if (argv[commandStart]?.startsWith("--hq-root="))
41
+ commandStart += 1;
42
+ return Object.keys(CORE_COMMAND_PATH_OPERANDS).some((name) => name.split(" ").every((part, index) => argv[commandStart + index] === part));
43
+ }
44
+ /** Apply the manifest's operand rule to a copied process.argv vector. */
45
+ export function normalizeCorePathOperands(argv, platform = process.platform, convertPath = (value) => value) {
46
+ const normalized = [...argv];
47
+ if (platform !== "win32" || normalized[2] !== "core")
48
+ return normalized;
49
+ let commandStart = 3;
50
+ if (normalized[commandStart] === "--hq-root") {
51
+ const root = normalized[commandStart + 1];
52
+ if (root?.startsWith("/"))
53
+ normalized[commandStart + 1] = convertPath(root);
54
+ commandStart += 2;
55
+ }
56
+ else if (normalized[commandStart]?.startsWith("--hq-root=")) {
57
+ const value = normalized[commandStart].slice("--hq-root=".length);
58
+ if (value.startsWith("/"))
59
+ normalized[commandStart] = `--hq-root=${convertPath(value)}`;
60
+ commandStart += 1;
61
+ }
62
+ // Commander accepts the core group's root override after the subcommand too.
63
+ // Fast parsing defers that form, but normalize it before either route sees argv.
64
+ for (let index = commandStart; index < normalized.length; index += 1) {
65
+ const value = normalized[index];
66
+ if (value === "--")
67
+ break;
68
+ if (value === "--hq-root") {
69
+ index += 1;
70
+ if (normalized[index]?.startsWith("/"))
71
+ normalized[index] = convertPath(normalized[index]);
72
+ }
73
+ else if (value.startsWith("--hq-root=")) {
74
+ const root = value.slice("--hq-root=".length);
75
+ if (root.startsWith("/"))
76
+ normalized[index] = `--hq-root=${convertPath(root)}`;
77
+ }
78
+ }
79
+ const commandName = Object.keys(CORE_COMMAND_PATH_OPERANDS)
80
+ .sort((left, right) => right.split(" ").length - left.split(" ").length)
81
+ .find((name) => name.split(" ").every((part, index) => normalized[commandStart + index] === part));
82
+ if (!commandName)
83
+ return normalized;
84
+ const argsStart = commandStart + commandName.split(" ").length;
85
+ const args = normalized.slice(argsStart);
86
+ const convert = (index) => {
87
+ const value = args[index];
88
+ if (value?.startsWith("/"))
89
+ args[index] = convertPath(value);
90
+ };
91
+ const rule = CORE_COMMAND_PATH_OPERANDS[commandName];
92
+ if (rule === "all-nonoptions") {
93
+ args.forEach((value, index) => { if (!value.startsWith("--"))
94
+ convert(index); });
95
+ }
96
+ else if (rule === "first-nonoption") {
97
+ const index = args.findIndex((value) => !value.startsWith("--"));
98
+ if (index >= 0)
99
+ convert(index);
100
+ }
101
+ else if (rule.startsWith("position:")) {
102
+ convert(Number(rule.slice("position:".length)));
103
+ }
104
+ else if (rule.startsWith("options:")) {
105
+ const options = new Set(rule.slice("options:".length).split(","));
106
+ for (let index = 0; index < args.length; index += 1) {
107
+ const value = args[index];
108
+ if (options.has(value)) {
109
+ index += 1;
110
+ if (index < args.length)
111
+ convert(index);
112
+ }
113
+ else {
114
+ const equalsAt = value.indexOf("=");
115
+ if (equalsAt >= 0 && options.has(value.slice(0, equalsAt)) && value.slice(equalsAt + 1).startsWith("/")) {
116
+ args[index] = `${value.slice(0, equalsAt + 1)}${convertPath(value.slice(equalsAt + 1))}`;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ else if (rule.startsWith("comma:")) {
122
+ const option = rule.slice("comma:".length);
123
+ for (let index = 0; index < args.length; index += 1) {
124
+ if (args[index] === option && index + 1 < args.length) {
125
+ index += 1;
126
+ args[index] = convertCommaPaths(args[index]);
127
+ break;
128
+ }
129
+ const prefix = `${option}=`;
130
+ if (args[index].startsWith(prefix)) {
131
+ const value = args[index].slice(prefix.length);
132
+ if (value.startsWith("/")) {
133
+ args[index] = `${prefix}${convertCommaPaths(value)}`;
134
+ }
135
+ break;
136
+ }
137
+ }
138
+ }
139
+ normalized.splice(argsStart, args.length, ...args);
140
+ return normalized;
141
+ function convertCommaPaths(value) {
142
+ const parts = value.split(",");
143
+ while (parts.at(-1) === "")
144
+ parts.pop();
145
+ return parts.map((part) => part.startsWith("/") ? convertPath(part) : part).join(",");
146
+ }
147
+ }
12
148
  /** Family kill switches whose owner-approved default is enabled. */
13
149
  export const CORE_NATIVE_DEFAULT_ON_FAMILY_FLAGS = [
14
150
  "core-native-session",
@@ -16,8 +152,8 @@ export const CORE_NATIVE_DEFAULT_ON_FAMILY_FLAGS = [
16
152
  "core-native-policy",
17
153
  "core-native-utilities",
18
154
  "core-native-jobs",
19
- "core-native-ontology",
20
155
  "core-native-handoff",
156
+ "core-native-bucket-c",
21
157
  "core-native-delegate",
22
158
  ];
23
159
  const defaultOnFamilyFlags = new Set(CORE_NATIVE_DEFAULT_ON_FAMILY_FLAGS);
@@ -470,11 +606,7 @@ export const FAST_SCAFFOLD_SCRIPTS = [
470
606
  modulePath: "./commands/core-ontology-native.js",
471
607
  exportName: "runOntologyNativeFast",
472
608
  flagKey: "hq-core-native-fast-route",
473
- familyFlagKey: "core-native-ontology",
474
- asset: `core/scripts/${name === "audience-grant" ? "ontology-audience-grant" : name === "source-worklist" ? "ontology-source-worklist" : name === "source-yaml-validate" ? "source-yaml-validate" : `ontology-${name}`}.${name === "brief" || name === "garden" ? "mjs" : "sh"}`,
475
609
  root: name === "source-yaml-validate" ? "cwd" : "live",
476
- shellCwd: "caller",
477
- shellHqRoot: name === "source-yaml-validate" ? "none" : "live",
478
610
  })),
479
611
  {
480
612
  name: "audit-log",
@@ -577,6 +709,18 @@ export const FAST_SCAFFOLD_SCRIPTS = [
577
709
  shellHqRoot: "live",
578
710
  requiresNodeNetworkCompatibility: true,
579
711
  },
712
+ {
713
+ name: "hq-task",
714
+ kind: "native",
715
+ modulePath: "./commands/core-hq-task-fast.js",
716
+ exportName: "runHqTaskFast",
717
+ flagKey: "hq-core-native-fast-route",
718
+ familyFlagKey: "core-native-bucket-c",
719
+ asset: "core/scripts/hq-task.sh",
720
+ root: "live",
721
+ shellCwd: "live",
722
+ shellHqRoot: "live",
723
+ },
580
724
  ];
581
725
  /**
582
726
  * Parse the small, non-ambiguous `hq secrets env` surface for the gated entry