@indigoai-us/hq-cli 5.312.0 → 5.312.1
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/CHANGELOG.md +7 -0
- package/assets/scaffold/core/scripts/lib/work-mesh-live-hook.sh +378 -0
- package/assets/scaffold/core/scripts/lib/work-mesh-live-rebind.sh +141 -0
- package/assets/scaffold/core/scripts/migrate-policy-triggers.sh +373 -0
- package/assets/scaffold/core/scripts/register-project.sh +262 -0
- package/assets/scaffold/core/scripts/work-mesh-live-rebind.sh +59 -0
- package/dist/command-catalog.generated.d.ts +65 -0
- package/dist/command-catalog.generated.js +80 -0
- package/dist/commands/company-rename-flag.d.ts +4 -0
- package/dist/commands/company-rename-flag.js +7 -0
- package/dist/commands/company-rename.d.ts +4 -0
- package/dist/commands/company-rename.js +90 -0
- package/dist/commands/company.js +2 -0
- package/dist/commands/core-checkpoint-stop-gate-native.js +12 -0
- package/dist/commands/core-eval-trigger-native.d.ts +4 -0
- package/dist/commands/core-eval-trigger-native.js +12 -0
- package/dist/commands/core-migrate-policy-triggers-native.d.ts +21 -0
- package/dist/commands/core-migrate-policy-triggers-native.js +378 -0
- package/dist/commands/core-native-hook-helper-commands.d.ts +4 -0
- package/dist/commands/core-native-hook-helper-commands.js +56 -0
- package/dist/commands/core-native-hook-helpers-flag.d.ts +4 -0
- package/dist/commands/core-native-hook-helpers-flag.js +7 -0
- package/dist/commands/core-register-project-native.d.ts +30 -0
- package/dist/commands/core-register-project-native.js +347 -0
- package/dist/commands/core-work-mesh-live-rebind-native.d.ts +18 -0
- package/dist/commands/core-work-mesh-live-rebind-native.js +262 -0
- package/dist/commands/core.js +7 -0
- package/dist/fast-core.js +10 -3
- package/dist/fast-scaffold.d.ts +2 -0
- package/dist/fast-scaffold.js +11 -0
- package/dist/lib/agents/model-catalog.d.ts +3 -2
- package/dist/lib/company-skill-wrapper.d.ts +0 -8
- package/dist/lib/core-utils/codex-skill-bridge.d.ts +2 -1
- package/dist/lib/deploy-api.d.ts +0 -1
- package/dist/lib/deploy-api.js +1 -1
- package/dist/lib/doctor/checks/work-context.js +9 -1
- package/dist/lib/mesh/client.js +23 -5
- package/dist/lib/mesh/denial-codes.d.ts +5 -0
- package/dist/lib/mesh/denial-codes.js +14 -0
- package/dist/lib/mesh/live/daemon/doctor.d.ts +2 -0
- package/dist/lib/mesh/live/daemon/doctor.js +11 -1
- package/dist/lib/report-run.d.ts +3 -2
- package/dist/lib/report-templates.d.ts +0 -1
- package/dist/lib/report-templates.js +0 -3
- package/dist/lib/scaffold-cli-floor.d.ts +0 -1
- package/dist/lib/scaffold-cli-floor.js +1 -1
- package/dist/lib/search-index/embed-lock.d.ts +2 -0
- package/dist/lib/search-index/embed-lock.js +10 -1
- package/dist/lib/work-context/contract.d.ts +3 -0
- package/dist/lib/work-context/contract.schema.json +3 -1
- package/dist/lib/work-context/outbox.d.ts +14 -5
- package/dist/lib/work-context/outbox.js +48 -5
- package/dist/lib/work-context/reconcile.js +26 -5
- package/dist/main.d.ts +20 -0
- package/dist/main.js +8 -1
- package/dist/run/discover-schemas.d.ts +2 -1
- package/dist/utils/core-eval-trigger.d.ts +4 -0
- package/dist/utils/core-eval-trigger.js +88 -0
- package/dist/utils/hq-roots.d.ts +0 -2
- package/dist/utils/hq-roots.js +1 -8
- package/dist/utils/incomplete-install-error.d.ts +7 -6
- package/dist/utils/large-file-guard.d.ts +0 -10
- package/dist/utils/large-file-guard.js +1 -1
- package/dist/utils/package-root-diagnostics.d.ts +1 -1
- package/dist/utils/self-update.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# hq-core: public
|
|
3
|
+
# US-011 — enqueue session_end/session_start when project binding changes.
|
|
4
|
+
# Usage:
|
|
5
|
+
# work-mesh-live-rebind.sh --session <sid>
|
|
6
|
+
# Read state file and rebind if project changed vs live-binding marker.
|
|
7
|
+
# work-mesh-live-rebind.sh --session <sid> \
|
|
8
|
+
# --old-company C --old-project P [--old-task T] \
|
|
9
|
+
# --company C2 --project P2 [--task T2]
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
ROOT="${HQ_ROOT:-${CLAUDE_PROJECT_DIR:-}}"
|
|
13
|
+
if [ -z "$ROOT" ]; then
|
|
14
|
+
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
15
|
+
fi
|
|
16
|
+
export HQ_ROOT="$ROOT"
|
|
17
|
+
|
|
18
|
+
# shellcheck source=lib/work-mesh-enqueue.sh
|
|
19
|
+
. "$ROOT/core/scripts/lib/work-mesh-enqueue.sh"
|
|
20
|
+
# shellcheck source=lib/work-mesh-live-hook.sh
|
|
21
|
+
. "$ROOT/core/scripts/lib/work-mesh-live-hook.sh" 2>/dev/null || true
|
|
22
|
+
# shellcheck source=lib/work-mesh-live-rebind.sh
|
|
23
|
+
. "$ROOT/core/scripts/lib/work-mesh-live-rebind.sh"
|
|
24
|
+
|
|
25
|
+
SID=""
|
|
26
|
+
OLD_CO="" OLD_PR="" OLD_TK=""
|
|
27
|
+
NEW_CO="" NEW_PR="" NEW_TK=""
|
|
28
|
+
FROM_STATE=0
|
|
29
|
+
|
|
30
|
+
while [ $# -gt 0 ]; do
|
|
31
|
+
case "$1" in
|
|
32
|
+
--session|--session-id) SID="${2:-}"; shift 2 ;;
|
|
33
|
+
--old-company) OLD_CO="${2:-}"; shift 2 ;;
|
|
34
|
+
--old-project) OLD_PR="${2:-}"; shift 2 ;;
|
|
35
|
+
--old-task) OLD_TK="${2:-}"; shift 2 ;;
|
|
36
|
+
--company|--company-slug) NEW_CO="${2:-}"; shift 2 ;;
|
|
37
|
+
--project) NEW_PR="${2:-}"; shift 2 ;;
|
|
38
|
+
--task) NEW_TK="${2:-}"; shift 2 ;;
|
|
39
|
+
--from-state) FROM_STATE=1; shift ;;
|
|
40
|
+
*) shift ;;
|
|
41
|
+
esac
|
|
42
|
+
done
|
|
43
|
+
|
|
44
|
+
[ -n "$SID" ] || { echo "usage: work-mesh-live-rebind.sh --session <sid> ..." >&2; exit 1; }
|
|
45
|
+
|
|
46
|
+
if [ "$FROM_STATE" -eq 1 ] || [ -z "$NEW_PR" ]; then
|
|
47
|
+
work_mesh_live_maybe_rebind_from_state "$SID"
|
|
48
|
+
else
|
|
49
|
+
if [ -z "$OLD_PR" ]; then
|
|
50
|
+
work_mesh_live_read_binding_marker "$SID"
|
|
51
|
+
old=$REPLY
|
|
52
|
+
OLD_CO="${old%%|*}"
|
|
53
|
+
rest="${old#*|}"
|
|
54
|
+
OLD_PR="${rest%%|*}"
|
|
55
|
+
OLD_TK="${rest#*|}"
|
|
56
|
+
fi
|
|
57
|
+
work_mesh_live_rebind "$SID" "$OLD_CO" "$OLD_PR" "$OLD_TK" "$NEW_CO" "$NEW_PR" "$NEW_TK"
|
|
58
|
+
fi
|
|
59
|
+
exit 0
|
|
@@ -3826,6 +3826,19 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
3826
3826
|
}];
|
|
3827
3827
|
readonly subcommands: readonly [];
|
|
3828
3828
|
}];
|
|
3829
|
+
}, {
|
|
3830
|
+
readonly name: "rename";
|
|
3831
|
+
readonly description: "Rename a cloud-backed company display name";
|
|
3832
|
+
readonly aliases: readonly [];
|
|
3833
|
+
readonly hidden: false;
|
|
3834
|
+
readonly usage: "[options] <new-name>";
|
|
3835
|
+
readonly arguments: readonly [{
|
|
3836
|
+
readonly name: "new-name";
|
|
3837
|
+
readonly required: true;
|
|
3838
|
+
readonly variadic: false;
|
|
3839
|
+
}];
|
|
3840
|
+
readonly options: readonly [];
|
|
3841
|
+
readonly subcommands: readonly [];
|
|
3829
3842
|
}, {
|
|
3830
3843
|
readonly name: "settings";
|
|
3831
3844
|
readonly description: "Per-company settings (owner-only)";
|
|
@@ -5867,6 +5880,58 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
5867
5880
|
}];
|
|
5868
5881
|
readonly options: readonly [];
|
|
5869
5882
|
readonly subcommands: readonly [];
|
|
5883
|
+
}, {
|
|
5884
|
+
readonly name: "eval-trigger";
|
|
5885
|
+
readonly description: "Evaluate policy trigger expressions";
|
|
5886
|
+
readonly aliases: readonly [];
|
|
5887
|
+
readonly hidden: false;
|
|
5888
|
+
readonly usage: "[args...]";
|
|
5889
|
+
readonly arguments: readonly [{
|
|
5890
|
+
readonly name: "args";
|
|
5891
|
+
readonly required: false;
|
|
5892
|
+
readonly variadic: true;
|
|
5893
|
+
}];
|
|
5894
|
+
readonly options: readonly [];
|
|
5895
|
+
readonly subcommands: readonly [];
|
|
5896
|
+
}, {
|
|
5897
|
+
readonly name: "migrate-policy-triggers";
|
|
5898
|
+
readonly description: "Backfill policy trigger frontmatter";
|
|
5899
|
+
readonly aliases: readonly [];
|
|
5900
|
+
readonly hidden: false;
|
|
5901
|
+
readonly usage: "[args...]";
|
|
5902
|
+
readonly arguments: readonly [{
|
|
5903
|
+
readonly name: "args";
|
|
5904
|
+
readonly required: false;
|
|
5905
|
+
readonly variadic: true;
|
|
5906
|
+
}];
|
|
5907
|
+
readonly options: readonly [];
|
|
5908
|
+
readonly subcommands: readonly [];
|
|
5909
|
+
}, {
|
|
5910
|
+
readonly name: "register-project";
|
|
5911
|
+
readonly description: "Register a project with Work Mesh";
|
|
5912
|
+
readonly aliases: readonly [];
|
|
5913
|
+
readonly hidden: false;
|
|
5914
|
+
readonly usage: "[args...]";
|
|
5915
|
+
readonly arguments: readonly [{
|
|
5916
|
+
readonly name: "args";
|
|
5917
|
+
readonly required: false;
|
|
5918
|
+
readonly variadic: true;
|
|
5919
|
+
}];
|
|
5920
|
+
readonly options: readonly [];
|
|
5921
|
+
readonly subcommands: readonly [];
|
|
5922
|
+
}, {
|
|
5923
|
+
readonly name: "work-mesh-live-rebind";
|
|
5924
|
+
readonly description: "Rebind a live Work Mesh session to its current project";
|
|
5925
|
+
readonly aliases: readonly [];
|
|
5926
|
+
readonly hidden: false;
|
|
5927
|
+
readonly usage: "[args...]";
|
|
5928
|
+
readonly arguments: readonly [{
|
|
5929
|
+
readonly name: "args";
|
|
5930
|
+
readonly required: false;
|
|
5931
|
+
readonly variadic: true;
|
|
5932
|
+
}];
|
|
5933
|
+
readonly options: readonly [];
|
|
5934
|
+
readonly subcommands: readonly [];
|
|
5870
5935
|
}, {
|
|
5871
5936
|
readonly name: "worktree-gc";
|
|
5872
5937
|
readonly description: "Safely collect old, preserved HQ worktrees";
|
|
@@ -4940,6 +4940,22 @@ export const COMMAND_CATALOG = [
|
|
|
4940
4940
|
}
|
|
4941
4941
|
]
|
|
4942
4942
|
},
|
|
4943
|
+
{
|
|
4944
|
+
"name": "rename",
|
|
4945
|
+
"description": "Rename a cloud-backed company display name",
|
|
4946
|
+
"aliases": [],
|
|
4947
|
+
"hidden": false,
|
|
4948
|
+
"usage": "[options] <new-name>",
|
|
4949
|
+
"arguments": [
|
|
4950
|
+
{
|
|
4951
|
+
"name": "new-name",
|
|
4952
|
+
"required": true,
|
|
4953
|
+
"variadic": false
|
|
4954
|
+
}
|
|
4955
|
+
],
|
|
4956
|
+
"options": [],
|
|
4957
|
+
"subcommands": []
|
|
4958
|
+
},
|
|
4943
4959
|
{
|
|
4944
4960
|
"name": "settings",
|
|
4945
4961
|
"description": "Per-company settings (owner-only)",
|
|
@@ -7553,6 +7569,70 @@ export const COMMAND_CATALOG = [
|
|
|
7553
7569
|
"options": [],
|
|
7554
7570
|
"subcommands": []
|
|
7555
7571
|
},
|
|
7572
|
+
{
|
|
7573
|
+
"name": "eval-trigger",
|
|
7574
|
+
"description": "Evaluate policy trigger expressions",
|
|
7575
|
+
"aliases": [],
|
|
7576
|
+
"hidden": false,
|
|
7577
|
+
"usage": "[args...]",
|
|
7578
|
+
"arguments": [
|
|
7579
|
+
{
|
|
7580
|
+
"name": "args",
|
|
7581
|
+
"required": false,
|
|
7582
|
+
"variadic": true
|
|
7583
|
+
}
|
|
7584
|
+
],
|
|
7585
|
+
"options": [],
|
|
7586
|
+
"subcommands": []
|
|
7587
|
+
},
|
|
7588
|
+
{
|
|
7589
|
+
"name": "migrate-policy-triggers",
|
|
7590
|
+
"description": "Backfill policy trigger frontmatter",
|
|
7591
|
+
"aliases": [],
|
|
7592
|
+
"hidden": false,
|
|
7593
|
+
"usage": "[args...]",
|
|
7594
|
+
"arguments": [
|
|
7595
|
+
{
|
|
7596
|
+
"name": "args",
|
|
7597
|
+
"required": false,
|
|
7598
|
+
"variadic": true
|
|
7599
|
+
}
|
|
7600
|
+
],
|
|
7601
|
+
"options": [],
|
|
7602
|
+
"subcommands": []
|
|
7603
|
+
},
|
|
7604
|
+
{
|
|
7605
|
+
"name": "register-project",
|
|
7606
|
+
"description": "Register a project with Work Mesh",
|
|
7607
|
+
"aliases": [],
|
|
7608
|
+
"hidden": false,
|
|
7609
|
+
"usage": "[args...]",
|
|
7610
|
+
"arguments": [
|
|
7611
|
+
{
|
|
7612
|
+
"name": "args",
|
|
7613
|
+
"required": false,
|
|
7614
|
+
"variadic": true
|
|
7615
|
+
}
|
|
7616
|
+
],
|
|
7617
|
+
"options": [],
|
|
7618
|
+
"subcommands": []
|
|
7619
|
+
},
|
|
7620
|
+
{
|
|
7621
|
+
"name": "work-mesh-live-rebind",
|
|
7622
|
+
"description": "Rebind a live Work Mesh session to its current project",
|
|
7623
|
+
"aliases": [],
|
|
7624
|
+
"hidden": false,
|
|
7625
|
+
"usage": "[args...]",
|
|
7626
|
+
"arguments": [
|
|
7627
|
+
{
|
|
7628
|
+
"name": "args",
|
|
7629
|
+
"required": false,
|
|
7630
|
+
"variadic": true
|
|
7631
|
+
}
|
|
7632
|
+
],
|
|
7633
|
+
"options": [],
|
|
7634
|
+
"subcommands": []
|
|
7635
|
+
},
|
|
7556
7636
|
{
|
|
7557
7637
|
"name": "worktree-gc",
|
|
7558
7638
|
"description": "Safely collect old, preserved HQ worktrees",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { resolveProcessFlagGate } from "../lib/flag-registry.js";
|
|
2
|
+
export const CLI_COMPANY_RENAME_FLAG = "cli.company-rename";
|
|
3
|
+
/** Company display-name updates stay unavailable until hq-flags enables them. */
|
|
4
|
+
export function companyRenameEnabled() {
|
|
5
|
+
return resolveProcessFlagGate(CLI_COMPANY_RENAME_FLAG, { fallback: false }, () => false);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=company-rename-flag.js.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import * as yaml from "js-yaml";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import { resolveDefaultHqRoot } from "../utils/hq-root-resolver.js";
|
|
6
|
+
import { parseUserYaml } from "../utils/user-yaml-error.js";
|
|
7
|
+
import { ensureCognitoToken } from "../utils/cognito-session.js";
|
|
8
|
+
import { getEntityUid, vaultApiFetch } from "../utils/vault-api.js";
|
|
9
|
+
import { companyRenameEnabled } from "./company-rename-flag.js";
|
|
10
|
+
function fail(message) {
|
|
11
|
+
console.error(chalk.red(message));
|
|
12
|
+
process.exit(1);
|
|
13
|
+
throw new Error(message);
|
|
14
|
+
}
|
|
15
|
+
function resolveManifestTarget(hqRoot, requestedSlug, companyUid) {
|
|
16
|
+
const manifestPath = path.join(hqRoot, "companies", "manifest.yaml");
|
|
17
|
+
if (!fs.existsSync(manifestPath)) {
|
|
18
|
+
throw new Error(`companies/manifest.yaml not found at ${manifestPath}`);
|
|
19
|
+
}
|
|
20
|
+
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
21
|
+
const parsed = parseUserYaml(raw, manifestPath);
|
|
22
|
+
if (!parsed || !parsed.companies || typeof parsed.companies !== "object") {
|
|
23
|
+
throw new Error("companies/manifest.yaml is malformed — missing top-level .companies map");
|
|
24
|
+
}
|
|
25
|
+
const slug = requestedSlug ?? Object.entries(parsed.companies).find(([, entry]) => entry && typeof entry === "object" && entry.cloud_uid === companyUid)?.[0];
|
|
26
|
+
if (!slug) {
|
|
27
|
+
throw new Error(`No local company manifest entry is bound to ${companyUid}; run from the HQ root or pass --company <slug>.`);
|
|
28
|
+
}
|
|
29
|
+
const value = parsed.companies[slug];
|
|
30
|
+
if (!value || typeof value !== "object") {
|
|
31
|
+
throw new Error(`Company '${slug}' is not present in companies/manifest.yaml.`);
|
|
32
|
+
}
|
|
33
|
+
if (requestedSlug && value.cloud_uid !== companyUid) {
|
|
34
|
+
throw new Error(`Company '${slug}' has no matching cloud_uid in companies/manifest.yaml.`);
|
|
35
|
+
}
|
|
36
|
+
return { slug, path: manifestPath, document: parsed, entry: value };
|
|
37
|
+
}
|
|
38
|
+
function writeManifestName(target, name) {
|
|
39
|
+
target.entry.name = name;
|
|
40
|
+
target.document.companies[target.slug] = target.entry;
|
|
41
|
+
const mode = fs.statSync(target.path).mode;
|
|
42
|
+
const temporaryPath = `${target.path}.tmp.${process.pid}`;
|
|
43
|
+
fs.writeFileSync(temporaryPath, yaml.dump(target.document, { lineWidth: -1, noRefs: true }), { mode });
|
|
44
|
+
fs.chmodSync(temporaryPath, mode);
|
|
45
|
+
fs.renameSync(temporaryPath, target.path);
|
|
46
|
+
}
|
|
47
|
+
/** Register `hq company rename <new name>` for the selected/current company. */
|
|
48
|
+
export function registerCompanyRenameCommand(company) {
|
|
49
|
+
company
|
|
50
|
+
.command("rename <new-name>")
|
|
51
|
+
.description("Rename a cloud-backed company display name")
|
|
52
|
+
.action(async (newName) => {
|
|
53
|
+
if (!companyRenameEnabled()) {
|
|
54
|
+
fail("Company rename is not available yet.");
|
|
55
|
+
}
|
|
56
|
+
const name = newName.trim();
|
|
57
|
+
if (!name)
|
|
58
|
+
fail("Company name cannot be empty.");
|
|
59
|
+
try {
|
|
60
|
+
const requestedSlug = company.opts().company;
|
|
61
|
+
const token = await ensureCognitoToken();
|
|
62
|
+
const companyUid = await getEntityUid(token, { companySlug: requestedSlug });
|
|
63
|
+
const hqRoot = resolveDefaultHqRoot({ onMissing: "throw" });
|
|
64
|
+
const manifestTarget = resolveManifestTarget(hqRoot, requestedSlug, companyUid);
|
|
65
|
+
const response = await vaultApiFetch({
|
|
66
|
+
token,
|
|
67
|
+
path: `/entity/${encodeURIComponent(companyUid)}`,
|
|
68
|
+
method: "PATCH",
|
|
69
|
+
body: { name },
|
|
70
|
+
});
|
|
71
|
+
if (!response.ok) {
|
|
72
|
+
if (response.status === 403) {
|
|
73
|
+
fail("Only a company owner can rename this company.");
|
|
74
|
+
}
|
|
75
|
+
if (response.status === 404) {
|
|
76
|
+
fail("Company not found in HQ Cloud.");
|
|
77
|
+
}
|
|
78
|
+
fail(`Could not rename company (HTTP ${response.status}).`);
|
|
79
|
+
}
|
|
80
|
+
writeManifestName(manifestTarget, name);
|
|
81
|
+
console.log(chalk.green(`Company renamed to ${name}.`));
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (error instanceof Error && error.message.startsWith("process.exit"))
|
|
85
|
+
throw error;
|
|
86
|
+
fail(error instanceof Error ? error.message : String(error));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=company-rename.js.map
|
package/dist/commands/company.js
CHANGED
|
@@ -2,6 +2,7 @@ import chalk from "chalk";
|
|
|
2
2
|
import { ensureCognitoToken } from "../utils/cognito-session.js";
|
|
3
3
|
import { vaultApiFetch, getEntityUid } from "../utils/vault-api.js";
|
|
4
4
|
import { registerCompanyTransferCommand } from "./company-transfer.js";
|
|
5
|
+
import { registerCompanyRenameCommand } from "./company-rename.js";
|
|
5
6
|
import { describeRefreshOutcome, refreshCheckpointGateSetting, } from "./core-checkpoint-gate-setting.js";
|
|
6
7
|
/**
|
|
7
8
|
* Parse a `--flag <true|false>` string into a boolean, or throw. Commander
|
|
@@ -23,6 +24,7 @@ export function registerCompanyCommand(program) {
|
|
|
23
24
|
.option("--company <slug>", "Company slug (resolves to companyUid)");
|
|
24
25
|
// `hq company transfer …` — ownership handover (client-service-pack US-010).
|
|
25
26
|
registerCompanyTransferCommand(company);
|
|
27
|
+
registerCompanyRenameCommand(company);
|
|
26
28
|
const settings = company
|
|
27
29
|
.command("settings")
|
|
28
30
|
.description("Per-company settings (owner-only)");
|
|
@@ -481,6 +481,11 @@ export function executeCheckpointStopGate(input, context, overrides = {}) {
|
|
|
481
481
|
return { code: 0, stdout: "", stderr: "" };
|
|
482
482
|
}
|
|
483
483
|
const evidence = payloadReplyEvidence(payload);
|
|
484
|
+
// The shell's jq-backed input_fields assignment exits successfully before
|
|
485
|
+
// any state work when jq is unavailable. Keep that early-exit ordering even
|
|
486
|
+
// though the native parser does not otherwise need jq.
|
|
487
|
+
if (!deps.commandExists("jq", env))
|
|
488
|
+
return { code: 0, stdout: "", stderr: "" };
|
|
484
489
|
const transcriptPath = toShellString(payload.transcript_path);
|
|
485
490
|
const sessionId = toShellString(payload.session_id);
|
|
486
491
|
if (env.HQ_CHECKPOINT_SIBLING === "1")
|
|
@@ -517,6 +522,13 @@ export function executeCheckpointStopGate(input, context, overrides = {}) {
|
|
|
517
522
|
else
|
|
518
523
|
return { code: 0, stdout: "", stderr };
|
|
519
524
|
const stateDir = path.join(root, "workspace", "orchestrator", "hook-state");
|
|
525
|
+
try {
|
|
526
|
+
deps.mkdir(stateDir);
|
|
527
|
+
}
|
|
528
|
+
catch {
|
|
529
|
+
// hook-lib.sh runs `mkdir -p ... 2>/dev/null || true`; the directory and
|
|
530
|
+
// write checks below determine whether this invocation can continue.
|
|
531
|
+
}
|
|
520
532
|
if (!deps.isDirectory(stateDir) || !deps.canWrite(stateDir))
|
|
521
533
|
return { code: 0, stdout: "", stderr };
|
|
522
534
|
const eligibilityFile = path.join(stateDir, `checkpoint-gate-eligible-${runtime}`);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { checkTriggerExpressions, evaluateTrigger } from "../utils/core-eval-trigger.js";
|
|
2
|
+
export declare const EVAL_TRIGGER_ASSET = "core/scripts/eval-trigger.sh";
|
|
3
|
+
export declare function runEvalTriggerFast(args: readonly string[], stdin: string, _cwd: string, _root: string | undefined): Promise<number>;
|
|
4
|
+
//# sourceMappingURL=core-eval-trigger-native.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Native implementation of core/scripts/eval-trigger.sh. */
|
|
2
|
+
import { checkTriggerExpressions, evaluateTrigger } from "../utils/core-eval-trigger.js";
|
|
3
|
+
export { checkTriggerExpressions, evaluateTrigger } from "../utils/core-eval-trigger.js";
|
|
4
|
+
export const EVAL_TRIGGER_ASSET = "core/scripts/eval-trigger.sh";
|
|
5
|
+
export async function runEvalTriggerFast(args, stdin, _cwd, _root) {
|
|
6
|
+
if (args[0] === "--check") {
|
|
7
|
+
process.stdout.write(checkTriggerExpressions(stdin));
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
return evaluateTrigger(args[0] ?? "", args[1] ?? "");
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=core-eval-trigger-native.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
export declare const MIGRATE_POLICY_TRIGGERS_ASSET = "core/scripts/migrate-policy-triggers.sh";
|
|
3
|
+
export type MigratePolicyDependencies = {
|
|
4
|
+
root: string;
|
|
5
|
+
cwd: string;
|
|
6
|
+
env: NodeJS.ProcessEnv;
|
|
7
|
+
now: () => Date;
|
|
8
|
+
fs: typeof fs;
|
|
9
|
+
evaluatorExists?: () => boolean;
|
|
10
|
+
runFlock?: (lockFd: number, cwd: string, pathValue: string) => {
|
|
11
|
+
status: number | null;
|
|
12
|
+
error?: Error;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function runMigratePolicyTriggers(args: readonly string[], deps: MigratePolicyDependencies): {
|
|
16
|
+
code: number;
|
|
17
|
+
stdout: string;
|
|
18
|
+
stderr: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function runMigratePolicyTriggersFast(args: readonly string[], _stdin: string, cwd: string, root?: string): Promise<number>;
|
|
21
|
+
//# sourceMappingURL=core-migrate-policy-triggers-native.d.ts.map
|