@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
@@ -1407,6 +1407,22 @@ export declare const COMMAND_CATALOG: readonly [{
1407
1407
  readonly arguments: readonly [];
1408
1408
  readonly options: readonly [];
1409
1409
  readonly subcommands: readonly [];
1410
+ }, {
1411
+ readonly name: "keychain";
1412
+ readonly description: "Show or retry HQ's access to your sign-in in the macOS Keychain";
1413
+ readonly aliases: readonly [];
1414
+ readonly hidden: false;
1415
+ readonly helpOption: true;
1416
+ readonly helpCommand: false;
1417
+ readonly usage: "[options]";
1418
+ readonly helpText: readonly [];
1419
+ readonly arguments: readonly [];
1420
+ readonly options: readonly [{
1421
+ readonly flags: "--retry";
1422
+ readonly description: "Ask macOS again after Keychain access was denied";
1423
+ readonly hidden: false;
1424
+ }];
1425
+ readonly subcommands: readonly [];
1410
1426
  }, {
1411
1427
  readonly name: "refresh";
1412
1428
  readonly description: "Ensure a valid cached Cognito session (refresh only if expiring; no-op if already valid)";
@@ -6932,7 +6948,7 @@ export declare const COMMAND_CATALOG: readonly [{
6932
6948
  }];
6933
6949
  }, {
6934
6950
  readonly name: "outposts";
6935
- readonly description: "Manage your personal HQ Outposts (EC2 boxes)";
6951
+ readonly description: "Manage personal and company HQ Outposts (EC2 boxes)";
6936
6952
  readonly aliases: readonly [];
6937
6953
  readonly hidden: false;
6938
6954
  readonly helpOption: true;
@@ -7051,15 +7067,19 @@ export declare const COMMAND_CATALOG: readonly [{
7051
7067
  readonly arguments: readonly [];
7052
7068
  readonly options: readonly [{
7053
7069
  readonly flags: "--runtime <runtime>";
7054
- readonly description: "Agent runtime: claude | codex (default claude)";
7070
+ readonly description: "Agent runtime: claude | codex (default claude). Personal boxes only.";
7055
7071
  readonly hidden: false;
7056
7072
  }, {
7057
7073
  readonly flags: "--disk <gb>";
7058
- readonly description: "Root disk size in GB (EC2 only)";
7074
+ readonly description: "Root disk size in GB (EC2 only). Personal boxes only.";
7059
7075
  readonly hidden: false;
7060
7076
  }, {
7061
7077
  readonly flags: "--client-ip <ip>";
7062
- readonly description: "Your public IP for the box's SSH ingress (optional; server derives it otherwise)";
7078
+ readonly description: "Your public IP for the box's SSH ingress (optional; server derives it otherwise). Personal boxes only.";
7079
+ readonly hidden: false;
7080
+ }, {
7081
+ readonly flags: "--company <slug>";
7082
+ readonly description: "Provision the company's Outpost instead of your personal box";
7063
7083
  readonly hidden: false;
7064
7084
  }, {
7065
7085
  readonly flags: "--yes";
@@ -7095,7 +7115,11 @@ export declare const COMMAND_CATALOG: readonly [{
7095
7115
  readonly arguments: readonly [];
7096
7116
  readonly options: readonly [{
7097
7117
  readonly flags: "--id <outpostId>";
7098
- readonly description: "Outpost id (defaults to your primary box)";
7118
+ readonly description: "Personal Outpost id (defaults to your primary box)";
7119
+ readonly hidden: false;
7120
+ }, {
7121
+ readonly flags: "--company <slug>";
7122
+ readonly description: "Show the company Outpost, its jobs, and each job's run status";
7099
7123
  readonly hidden: false;
7100
7124
  }, {
7101
7125
  readonly flags: "--json";
@@ -7103,6 +7127,62 @@ export declare const COMMAND_CATALOG: readonly [{
7103
7127
  readonly hidden: false;
7104
7128
  }];
7105
7129
  readonly subcommands: readonly [];
7130
+ }, {
7131
+ readonly name: "jobs";
7132
+ readonly description: "Register a job on a company Outpost";
7133
+ readonly aliases: readonly [];
7134
+ readonly hidden: false;
7135
+ readonly helpOption: true;
7136
+ readonly helpCommand: true;
7137
+ readonly usage: "[options] [command]";
7138
+ readonly helpText: readonly [];
7139
+ readonly arguments: readonly [];
7140
+ readonly options: readonly [];
7141
+ readonly subcommands: readonly [{
7142
+ readonly name: "register";
7143
+ readonly description: "Register a company job and print the accepted revision";
7144
+ readonly aliases: readonly [];
7145
+ readonly hidden: false;
7146
+ readonly helpOption: true;
7147
+ readonly helpCommand: false;
7148
+ readonly usage: "[options]";
7149
+ readonly helpText: readonly [];
7150
+ readonly arguments: readonly [];
7151
+ readonly options: readonly [{
7152
+ readonly flags: "--company <slug>";
7153
+ readonly description: "Company that owns the Outpost";
7154
+ readonly hidden: false;
7155
+ }, {
7156
+ readonly flags: "--prompt <text>";
7157
+ readonly description: "What the job should do";
7158
+ readonly hidden: false;
7159
+ }, {
7160
+ readonly flags: "--timezone <name>";
7161
+ readonly description: "IANA timezone, such as America/New_York";
7162
+ readonly hidden: false;
7163
+ }, {
7164
+ readonly flags: "--cron <expr>";
7165
+ readonly description: "Recurring schedule, such as rate(1 day) or a cron expression";
7166
+ readonly hidden: false;
7167
+ }, {
7168
+ readonly flags: "--at <iso>";
7169
+ readonly description: "One-time ISO-8601 instant. Do not combine with --cron";
7170
+ readonly hidden: false;
7171
+ }, {
7172
+ readonly flags: "--script <text>";
7173
+ readonly description: "Optional precondition script stored with the job";
7174
+ readonly hidden: false;
7175
+ }, {
7176
+ readonly flags: "--context <json>";
7177
+ readonly description: "Optional JSON object stored with the job";
7178
+ readonly hidden: false;
7179
+ }, {
7180
+ readonly flags: "--json";
7181
+ readonly description: "Emit the job id and accepted revision as JSON";
7182
+ readonly hidden: false;
7183
+ }];
7184
+ readonly subcommands: readonly [];
7185
+ }];
7106
7186
  }, {
7107
7187
  readonly name: "exec";
7108
7188
  readonly description: "Run a shell command on an Outpost and print its output (use -- before flags meant for the remote command). The command waits for the submitted job to finish. Use --wait-timeout-seconds to bound local waiting, or --detach to print the commandId and return immediately.";
@@ -8506,6 +8586,35 @@ export declare const COMMAND_CATALOG: readonly [{
8506
8586
  readonly options: readonly [];
8507
8587
  readonly subcommands: readonly [];
8508
8588
  }];
8589
+ }, {
8590
+ readonly name: "pipeline";
8591
+ readonly description: "Pipeline orchestration helpers";
8592
+ readonly aliases: readonly [];
8593
+ readonly hidden: false;
8594
+ readonly helpOption: true;
8595
+ readonly helpCommand: true;
8596
+ readonly usage: "[options] [command]";
8597
+ readonly helpText: readonly [];
8598
+ readonly arguments: readonly [];
8599
+ readonly options: readonly [];
8600
+ readonly subcommands: readonly [{
8601
+ readonly name: "workers";
8602
+ readonly description: "Propose or render the pipeline worker engine table";
8603
+ readonly aliases: readonly [];
8604
+ readonly hidden: false;
8605
+ readonly helpOption: false;
8606
+ readonly helpCommand: false;
8607
+ readonly usage: "[args...]";
8608
+ readonly helpText: readonly [];
8609
+ readonly arguments: readonly [{
8610
+ readonly name: "args";
8611
+ readonly required: false;
8612
+ readonly variadic: true;
8613
+ readonly description: "";
8614
+ }];
8615
+ readonly options: readonly [];
8616
+ readonly subcommands: readonly [];
8617
+ }];
8509
8618
  }, {
8510
8619
  readonly name: "resolve-company";
8511
8620
  readonly description: "Resolve the active company for skills and routing";
@@ -9187,6 +9296,23 @@ export declare const COMMAND_CATALOG: readonly [{
9187
9296
  }];
9188
9297
  readonly options: readonly [];
9189
9298
  readonly subcommands: readonly [];
9299
+ }, {
9300
+ readonly name: "hq-task";
9301
+ readonly description: "List and update tasks on personal or company boards";
9302
+ readonly aliases: readonly [];
9303
+ readonly hidden: false;
9304
+ readonly helpOption: false;
9305
+ readonly helpCommand: false;
9306
+ readonly usage: "[args...]";
9307
+ readonly helpText: readonly [];
9308
+ readonly arguments: readonly [{
9309
+ readonly name: "args";
9310
+ readonly required: false;
9311
+ readonly variadic: true;
9312
+ readonly description: "arguments passed through to the script";
9313
+ }];
9314
+ readonly options: readonly [];
9315
+ readonly subcommands: readonly [];
9190
9316
  }, {
9191
9317
  readonly name: "checkpoint-stop-gate";
9192
9318
  readonly description: "Stop-hook checkpoint + company-scope gate (reads the hook payload on stdin)";
@@ -12950,6 +13076,10 @@ export declare const COMMAND_CATALOG: readonly [{
12950
13076
  readonly flags: "--provider <name>";
12951
13077
  readonly description: "claude | codex | grok";
12952
13078
  readonly hidden: false;
13079
+ }, {
13080
+ readonly flags: "--remote-control";
13081
+ readonly description: "Open a Claude lane in Remote Control using account a for login and the selected account for inference";
13082
+ readonly hidden: false;
12953
13083
  }, {
12954
13084
  readonly flags: "--account <id>";
12955
13085
  readonly description: "Provider account id";
@@ -1684,6 +1684,25 @@ export const COMMAND_CATALOG = [
1684
1684
  "options": [],
1685
1685
  "subcommands": []
1686
1686
  },
1687
+ {
1688
+ "name": "keychain",
1689
+ "description": "Show or retry HQ's access to your sign-in in the macOS Keychain",
1690
+ "aliases": [],
1691
+ "hidden": false,
1692
+ "helpOption": true,
1693
+ "helpCommand": false,
1694
+ "usage": "[options]",
1695
+ "helpText": [],
1696
+ "arguments": [],
1697
+ "options": [
1698
+ {
1699
+ "flags": "--retry",
1700
+ "description": "Ask macOS again after Keychain access was denied",
1701
+ "hidden": false
1702
+ }
1703
+ ],
1704
+ "subcommands": []
1705
+ },
1687
1706
  {
1688
1707
  "name": "refresh",
1689
1708
  "description": "Ensure a valid cached Cognito session (refresh only if expiring; no-op if already valid)",
@@ -8447,7 +8466,7 @@ export const COMMAND_CATALOG = [
8447
8466
  },
8448
8467
  {
8449
8468
  "name": "outposts",
8450
- "description": "Manage your personal HQ Outposts (EC2 boxes)",
8469
+ "description": "Manage personal and company HQ Outposts (EC2 boxes)",
8451
8470
  "aliases": [],
8452
8471
  "hidden": false,
8453
8472
  "helpOption": true,
@@ -8590,17 +8609,22 @@ export const COMMAND_CATALOG = [
8590
8609
  "options": [
8591
8610
  {
8592
8611
  "flags": "--runtime <runtime>",
8593
- "description": "Agent runtime: claude | codex (default claude)",
8612
+ "description": "Agent runtime: claude | codex (default claude). Personal boxes only.",
8594
8613
  "hidden": false
8595
8614
  },
8596
8615
  {
8597
8616
  "flags": "--disk <gb>",
8598
- "description": "Root disk size in GB (EC2 only)",
8617
+ "description": "Root disk size in GB (EC2 only). Personal boxes only.",
8599
8618
  "hidden": false
8600
8619
  },
8601
8620
  {
8602
8621
  "flags": "--client-ip <ip>",
8603
- "description": "Your public IP for the box's SSH ingress (optional; server derives it otherwise)",
8622
+ "description": "Your public IP for the box's SSH ingress (optional; server derives it otherwise). Personal boxes only.",
8623
+ "hidden": false
8624
+ },
8625
+ {
8626
+ "flags": "--company <slug>",
8627
+ "description": "Provision the company's Outpost instead of your personal box",
8604
8628
  "hidden": false
8605
8629
  },
8606
8630
  {
@@ -8643,7 +8667,12 @@ export const COMMAND_CATALOG = [
8643
8667
  "options": [
8644
8668
  {
8645
8669
  "flags": "--id <outpostId>",
8646
- "description": "Outpost id (defaults to your primary box)",
8670
+ "description": "Personal Outpost id (defaults to your primary box)",
8671
+ "hidden": false
8672
+ },
8673
+ {
8674
+ "flags": "--company <slug>",
8675
+ "description": "Show the company Outpost, its jobs, and each job's run status",
8647
8676
  "hidden": false
8648
8677
  },
8649
8678
  {
@@ -8654,6 +8683,74 @@ export const COMMAND_CATALOG = [
8654
8683
  ],
8655
8684
  "subcommands": []
8656
8685
  },
8686
+ {
8687
+ "name": "jobs",
8688
+ "description": "Register a job on a company Outpost",
8689
+ "aliases": [],
8690
+ "hidden": false,
8691
+ "helpOption": true,
8692
+ "helpCommand": true,
8693
+ "usage": "[options] [command]",
8694
+ "helpText": [],
8695
+ "arguments": [],
8696
+ "options": [],
8697
+ "subcommands": [
8698
+ {
8699
+ "name": "register",
8700
+ "description": "Register a company job and print the accepted revision",
8701
+ "aliases": [],
8702
+ "hidden": false,
8703
+ "helpOption": true,
8704
+ "helpCommand": false,
8705
+ "usage": "[options]",
8706
+ "helpText": [],
8707
+ "arguments": [],
8708
+ "options": [
8709
+ {
8710
+ "flags": "--company <slug>",
8711
+ "description": "Company that owns the Outpost",
8712
+ "hidden": false
8713
+ },
8714
+ {
8715
+ "flags": "--prompt <text>",
8716
+ "description": "What the job should do",
8717
+ "hidden": false
8718
+ },
8719
+ {
8720
+ "flags": "--timezone <name>",
8721
+ "description": "IANA timezone, such as America/New_York",
8722
+ "hidden": false
8723
+ },
8724
+ {
8725
+ "flags": "--cron <expr>",
8726
+ "description": "Recurring schedule, such as rate(1 day) or a cron expression",
8727
+ "hidden": false
8728
+ },
8729
+ {
8730
+ "flags": "--at <iso>",
8731
+ "description": "One-time ISO-8601 instant. Do not combine with --cron",
8732
+ "hidden": false
8733
+ },
8734
+ {
8735
+ "flags": "--script <text>",
8736
+ "description": "Optional precondition script stored with the job",
8737
+ "hidden": false
8738
+ },
8739
+ {
8740
+ "flags": "--context <json>",
8741
+ "description": "Optional JSON object stored with the job",
8742
+ "hidden": false
8743
+ },
8744
+ {
8745
+ "flags": "--json",
8746
+ "description": "Emit the job id and accepted revision as JSON",
8747
+ "hidden": false
8748
+ }
8749
+ ],
8750
+ "subcommands": []
8751
+ }
8752
+ ]
8753
+ },
8657
8754
  {
8658
8755
  "name": "exec",
8659
8756
  "description": "Run a shell command on an Outpost and print its output (use -- before flags meant for the remote command). The command waits for the submitted job to finish. Use --wait-timeout-seconds to bound local waiting, or --detach to print the commandId and return immediately.",
@@ -10339,6 +10436,40 @@ export const COMMAND_CATALOG = [
10339
10436
  }
10340
10437
  ]
10341
10438
  },
10439
+ {
10440
+ "name": "pipeline",
10441
+ "description": "Pipeline orchestration helpers",
10442
+ "aliases": [],
10443
+ "hidden": false,
10444
+ "helpOption": true,
10445
+ "helpCommand": true,
10446
+ "usage": "[options] [command]",
10447
+ "helpText": [],
10448
+ "arguments": [],
10449
+ "options": [],
10450
+ "subcommands": [
10451
+ {
10452
+ "name": "workers",
10453
+ "description": "Propose or render the pipeline worker engine table",
10454
+ "aliases": [],
10455
+ "hidden": false,
10456
+ "helpOption": false,
10457
+ "helpCommand": false,
10458
+ "usage": "[args...]",
10459
+ "helpText": [],
10460
+ "arguments": [
10461
+ {
10462
+ "name": "args",
10463
+ "required": false,
10464
+ "variadic": true,
10465
+ "description": ""
10466
+ }
10467
+ ],
10468
+ "options": [],
10469
+ "subcommands": []
10470
+ }
10471
+ ]
10472
+ },
10342
10473
  {
10343
10474
  "name": "resolve-company",
10344
10475
  "description": "Resolve the active company for skills and routing",
@@ -11142,6 +11273,26 @@ export const COMMAND_CATALOG = [
11142
11273
  "options": [],
11143
11274
  "subcommands": []
11144
11275
  },
11276
+ {
11277
+ "name": "hq-task",
11278
+ "description": "List and update tasks on personal or company boards",
11279
+ "aliases": [],
11280
+ "hidden": false,
11281
+ "helpOption": false,
11282
+ "helpCommand": false,
11283
+ "usage": "[args...]",
11284
+ "helpText": [],
11285
+ "arguments": [
11286
+ {
11287
+ "name": "args",
11288
+ "required": false,
11289
+ "variadic": true,
11290
+ "description": "arguments passed through to the script"
11291
+ }
11292
+ ],
11293
+ "options": [],
11294
+ "subcommands": []
11295
+ },
11145
11296
  {
11146
11297
  "name": "checkpoint-stop-gate",
11147
11298
  "description": "Stop-hook checkpoint + company-scope gate (reads the hook payload on stdin)",
@@ -15749,6 +15900,11 @@ export const COMMAND_CATALOG = [
15749
15900
  "description": "claude | codex | grok",
15750
15901
  "hidden": false
15751
15902
  },
15903
+ {
15904
+ "flags": "--remote-control",
15905
+ "description": "Open a Claude lane in Remote Control using account a for login and the selected account for inference",
15906
+ "hidden": false
15907
+ },
15752
15908
  {
15753
15909
  "flags": "--account <id>",
15754
15910
  "description": "Provider account id",
@@ -22,6 +22,9 @@ import path from "node:path";
22
22
  import chalk from "chalk";
23
23
  import { browserLogin, clearCachedTokens, loadCachedTokens, isExpiring, loadMachineCreds, CognitoAuthError, } from "@indigoai-us/hq-cloud";
24
24
  import { DEFAULT_COGNITO, refreshCachedSession, resolveCognitoTokenSource, ensureMachineSessionTokens, personTokenCacheFile, machineTokenCacheFile, } from "../utils/cognito-session.js";
25
+ // Static (node builtins only): a lazy import here would need a resident
26
+ // preload entry for the auth-login path.
27
+ import * as tokenKeychain from "../utils/token-keychain.js";
25
28
  import { resolveLoginProviderSelection, } from "../utils/login-provider.js";
26
29
  import { getLastLoginProviderStatePath, loadLastLoginProvider, storeLastLoginProvider, } from "../lib/auth-login-provider-state.js";
27
30
  import { callbackPortBusyGuidance, DEFAULT_CALLBACK_PORT, isCallbackPortBusy, } from "../utils/callback-port-busy.js";
@@ -278,6 +281,45 @@ export function registerAuthCommands(program) {
278
281
  clearCachedTokens();
279
282
  console.log(chalk.green("Signed out — removed ~/.hq/cognito-tokens.json"));
280
283
  });
284
+ authCmd
285
+ .command("keychain")
286
+ .description("Show or retry HQ's access to your sign-in in the macOS Keychain")
287
+ .option("--retry", "Ask macOS again after Keychain access was denied")
288
+ .action(async (options) => {
289
+ const keychain = tokenKeychain;
290
+ if (!keychain.keychainTokenReadEnabled()) {
291
+ console.log("HQ reads your sign-in from ~/.hq/cognito-tokens.json here; the Keychain is only used on macOS.");
292
+ return;
293
+ }
294
+ if (!options.retry) {
295
+ const state = keychain.readKeychainAccessState();
296
+ if (state.deniedAt) {
297
+ console.log("Keychain access wasn't allowed, so HQ uses ~/.hq/cognito-tokens.json. Run `hq auth keychain --retry` to ask again.");
298
+ }
299
+ else if (state.allowedAt) {
300
+ console.log(chalk.green("HQ can read your sign-in from the Keychain."));
301
+ }
302
+ else {
303
+ console.log("HQ hasn't asked for Keychain access yet. It will ask the next time you run an hq command in a terminal.");
304
+ }
305
+ return;
306
+ }
307
+ const state = keychain.readKeychainAccessState();
308
+ if (!state.allowedAt)
309
+ console.error(keychain.KEYCHAIN_FIRST_READ_NOTE);
310
+ const result = keychain.readKeychainTokensDetailed({ retry: true, interactive: true, notify: () => { } });
311
+ if (result.outcome === "hit") {
312
+ console.log(result.tokens
313
+ ? chalk.green("HQ can read your sign-in from the Keychain.")
314
+ : chalk.yellow("HQ can read the Keychain, but the HQ sign-in saved there isn't usable. HQ will use ~/.hq/cognito-tokens.json."));
315
+ }
316
+ else if (result.outcome === "miss") {
317
+ console.log("No HQ sign-in is saved in the Keychain yet. HQ will use ~/.hq/cognito-tokens.json.");
318
+ }
319
+ else {
320
+ console.log(chalk.yellow("Keychain access wasn't allowed. HQ will use ~/.hq/cognito-tokens.json. Run `hq auth keychain --retry` to ask again."));
321
+ }
322
+ });
281
323
  authCmd
282
324
  .command("refresh")
283
325
  .description("Ensure a valid cached Cognito session (refresh only if expiring; no-op if already valid)")
@@ -0,0 +1,4 @@
1
+ import { HQ_TASK_ASSET, runHqTask } from "./core-hq-task-native.js";
2
+ export { HQ_TASK_ASSET, runHqTask };
3
+ export declare function runHqTaskFast(args: string[], _stdin: string, _cwd: string, root: string): number;
4
+ //# sourceMappingURL=core-hq-task-fast.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { HQ_TASK_ASSET, runHqTask } from "./core-hq-task-native.js";
2
+ export { HQ_TASK_ASSET, runHqTask };
3
+ export function runHqTaskFast(args, _stdin, _cwd, root) {
4
+ const result = runHqTask(args, root);
5
+ if (result.stdout)
6
+ process.stdout.write(result.stdout);
7
+ if (result.stderr)
8
+ process.stderr.write(result.stderr);
9
+ return result.code;
10
+ }
11
+ //# sourceMappingURL=core-hq-task-fast.js.map
@@ -0,0 +1,20 @@
1
+ import * as fs from "node:fs";
2
+ export declare const HQ_TASK_ASSET = "core/scripts/hq-task.sh";
3
+ type Board = {
4
+ tasks: Array<Record<string, any>>;
5
+ objectives?: Array<Record<string, any>>;
6
+ [key: string]: any;
7
+ };
8
+ export type HqTaskResult = {
9
+ code: number;
10
+ stdout: string;
11
+ stderr: string;
12
+ };
13
+ type AtomicFileIO = Pick<typeof fs, "writeFileSync" | "renameSync" | "chmodSync" | "statSync" | "existsSync" | "unlinkSync">;
14
+ declare function save(file: string, board: Board, io?: AtomicFileIO): HqTaskResult | undefined;
15
+ export declare const __hqTaskTest: {
16
+ save: typeof save;
17
+ };
18
+ export declare function runHqTask(args: readonly string[], root: string, env?: NodeJS.ProcessEnv): HqTaskResult;
19
+ export {};
20
+ //# sourceMappingURL=core-hq-task-native.d.ts.map