@indigoai-us/hq-cli 5.345.149 → 5.345.150

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.
@@ -20,7 +20,7 @@ export { LANE_STORY_LEDGER_FLAG, buildLaneStatusSnapshot, formatLaneStatusHuman,
20
20
  export type { LaneStatusSnapshot, ProjectStoryLedger, StoryLedgerWriteDeps } from "./story-ledger.js";
21
21
  export { buildOutpostPickupCommand, parseOutpostPickupPayload, } from "./outpost-dispatch.js";
22
22
  export type { OutpostDispatchResult, OutpostPickupPayload, } from "./outpost-dispatch.js";
23
- export { LANES_STORE_REL, LANE_RECORDS_DIR, PENDING_INDEX_DIR, QUESTION_RECORDS_DIR, appendCappedHistory, appendLaneAttribution, appendLaneSeniorHistory, appendQuestionRouting, createLane, createQuestion, isConflictSidecarName, laneRecordPath, lanesStoreRoot, listLaneIds, listQuestionIds, mergeLaneRecords, mergeQuestionRecords, mintLaneId, mintQuestionId, parseLaneRecord, parseQuestionRecord, pendingMarkerPath, questionRecordPath, readAllLanes, readLane, readQuestion, resolveStoreHqRoot, sanitizeHostComponent, tryReadLane, tryReadQuestion, retryUpdateLane, retryUpdateQuestion, syncLaneRecordFromOwner, updateLane, updateQuestion, withLaneHireLocks, } from "./store.js";
23
+ export { LANES_STORE_REL, LANE_RECORDS_DIR, PENDING_INDEX_DIR, QUESTION_RECORDS_DIR, appendCappedHistory, appendLaneAttribution, appendLaneSeniorHistory, appendQuestionRouting, createLane, createQuestion, isConflictSidecarName, laneRecordPath, lanesStoreRoot, listLaneIds, expandLocalLaneIdPrefix, LANE_ID_PREFIX_MIN, listQuestionIds, mergeLaneRecords, mergeQuestionRecords, mintLaneId, mintQuestionId, parseLaneRecord, parseQuestionRecord, pendingMarkerPath, questionRecordPath, readAllLanes, readLane, readQuestion, resolveStoreHqRoot, sanitizeHostComponent, tryReadLane, tryReadQuestion, retryUpdateLane, retryUpdateQuestion, syncLaneRecordFromOwner, updateLane, updateQuestion, withLaneHireLocks, } from "./store.js";
24
24
  export type { StoreDeps } from "./store.js";
25
25
  export { DEFAULT_LANE_WATCH_INTERVAL_MS, MAX_LANE_WATCH_INTERVAL_MS, MAX_WATCHED_LANES, MAX_WATCH_OUTPUT_LINES, runLaneWatch, } from "./watch.js";
26
26
  export type { LaneWatchDeps, LaneWatchResult } from "./watch.js";
@@ -12,7 +12,7 @@ export { DEFAULT_ACCOUNT_HOMES, DEFAULT_AUTO_COMPACT_TOKENS, DEFAULT_COMPACT_AFT
12
12
  export { resolveLanesHqRoot } from "./hq-root.js";
13
13
  export { LANE_STORY_LEDGER_FLAG, buildLaneStatusSnapshot, formatLaneStatusHuman, laneStoryLedgerEnabled, resolveProjectStoryLedger, syncLaneToProjectStoryLedger, removeLaneFromProjectStoryLedger, validateProjectStories, } from "./story-ledger.js";
14
14
  export { buildOutpostPickupCommand, parseOutpostPickupPayload, } from "./outpost-dispatch.js";
15
- export { LANES_STORE_REL, LANE_RECORDS_DIR, PENDING_INDEX_DIR, QUESTION_RECORDS_DIR, appendCappedHistory, appendLaneAttribution, appendLaneSeniorHistory, appendQuestionRouting, createLane, createQuestion, isConflictSidecarName, laneRecordPath, lanesStoreRoot, listLaneIds, listQuestionIds, mergeLaneRecords, mergeQuestionRecords, mintLaneId, mintQuestionId, parseLaneRecord, parseQuestionRecord, pendingMarkerPath, questionRecordPath, readAllLanes, readLane, readQuestion, resolveStoreHqRoot, sanitizeHostComponent, tryReadLane, tryReadQuestion, retryUpdateLane, retryUpdateQuestion, syncLaneRecordFromOwner, updateLane, updateQuestion, withLaneHireLocks, } from "./store.js";
15
+ export { LANES_STORE_REL, LANE_RECORDS_DIR, PENDING_INDEX_DIR, QUESTION_RECORDS_DIR, appendCappedHistory, appendLaneAttribution, appendLaneSeniorHistory, appendQuestionRouting, createLane, createQuestion, isConflictSidecarName, laneRecordPath, lanesStoreRoot, listLaneIds, expandLocalLaneIdPrefix, LANE_ID_PREFIX_MIN, listQuestionIds, mergeLaneRecords, mergeQuestionRecords, mintLaneId, mintQuestionId, parseLaneRecord, parseQuestionRecord, pendingMarkerPath, questionRecordPath, readAllLanes, readLane, readQuestion, resolveStoreHqRoot, sanitizeHostComponent, tryReadLane, tryReadQuestion, retryUpdateLane, retryUpdateQuestion, syncLaneRecordFromOwner, updateLane, updateQuestion, withLaneHireLocks, } from "./store.js";
16
16
  export { DEFAULT_LANE_WATCH_INTERVAL_MS, MAX_LANE_WATCH_INTERVAL_MS, MAX_WATCHED_LANES, MAX_WATCH_OUTPUT_LINES, runLaneWatch, } from "./watch.js";
17
17
  export { MONITOR_ERROR_EXIT_CODE, MONITOR_ENGINES, MONITOR_MAX_TIMEOUT_MS, MONITOR_TASK_OUTPUT_MAX_BYTES, MONITOR_TRANSCRIPT_MAX_BYTES, MONITOR_UNCOVERED_EXIT_CODE, coveredLaneIds, isMonitorTaskLive, monitorReminderText, parseCanonicalWatchCommand, parseMonitorTranscript, readLiveMonitorEvidence, } from "./monitor.js";
18
18
  export { IMDS_HOST, IMDS_INSTANCE_ID_URL, IMDS_TIMEOUT_MS, IMDS_TOKEN_URL, defaultReadImdsInstanceId, resolveMachineIdentity, } from "./machine-identity.js";
@@ -87,5 +87,16 @@ export declare function createQuestion(hqRoot: string, init: Omit<QuestionRecord
87
87
  export declare function updateQuestion(hqRoot: string, questionId: string, expectedVersion: number, updater: (current: QuestionRecord) => QuestionRecord, deps?: StoreDeps): QuestionRecord;
88
88
  export declare function appendQuestionRouting(hqRoot: string, questionId: string, expectedVersion: number, entry: RoutingHistoryEntry, deps?: StoreDeps): QuestionRecord;
89
89
  export declare function listLaneIds(hqRoot: string, deps?: StoreDeps): string[];
90
+ /** Shortest lane-id prefix a command expands to a full local lane id. */
91
+ export declare const LANE_ID_PREFIX_MIN = 8;
92
+ /**
93
+ * Expand a short lane-id prefix (at least `LANE_ID_PREFIX_MIN` ULID chars,
94
+ * no host suffix) to the one local lane id it starts. Returns `undefined`
95
+ * when the input is not such a prefix or matches no local lane, and throws
96
+ * `lane_id_ambiguous` listing every candidate when it matches more than one.
97
+ * Lane records, questions, run dirs and envelopes are always keyed by the
98
+ * full lane id; a prefix is only ever a lookup convenience.
99
+ */
100
+ export declare function expandLocalLaneIdPrefix(hqRoot: string, input: string, deps?: StoreDeps): string | undefined;
90
101
  export declare function listQuestionIds(hqRoot: string, deps?: StoreDeps): string[];
91
102
  //# sourceMappingURL=store.d.ts.map
@@ -2072,6 +2072,26 @@ function listRecordIds(dir, label, deps) {
2072
2072
  export function listLaneIds(hqRoot, deps = defaultStoreDeps()) {
2073
2073
  return listRecordIds(path.join(lanesStoreRoot(hqRoot), LANE_RECORDS_DIR), "lane", deps);
2074
2074
  }
2075
+ /** Shortest lane-id prefix a command expands to a full local lane id. */
2076
+ export const LANE_ID_PREFIX_MIN = 8;
2077
+ /**
2078
+ * Expand a short lane-id prefix (at least `LANE_ID_PREFIX_MIN` ULID chars,
2079
+ * no host suffix) to the one local lane id it starts. Returns `undefined`
2080
+ * when the input is not such a prefix or matches no local lane, and throws
2081
+ * `lane_id_ambiguous` listing every candidate when it matches more than one.
2082
+ * Lane records, questions, run dirs and envelopes are always keyed by the
2083
+ * full lane id; a prefix is only ever a lookup convenience.
2084
+ */
2085
+ export function expandLocalLaneIdPrefix(hqRoot, input, deps = defaultStoreDeps()) {
2086
+ if (!new RegExp(`^[0-9A-HJKMNP-TV-Z]{${LANE_ID_PREFIX_MIN},26}$`, "i").test(input))
2087
+ return undefined;
2088
+ const prefix = input.toUpperCase();
2089
+ const matches = listLaneIds(hqRoot, deps).filter((laneId) => laneId.toUpperCase().startsWith(prefix)).sort();
2090
+ if (matches.length > 1) {
2091
+ throw new LanesError("lane_id_ambiguous", `Lane id prefix ${input} matches ${matches.length} lanes: ${matches.join(", ")}. Pass the full lane id.`, { lane_id: input, matches });
2092
+ }
2093
+ return matches[0];
2094
+ }
2075
2095
  export function listQuestionIds(hqRoot, deps = defaultStoreDeps()) {
2076
2096
  return listRecordIds(path.join(lanesStoreRoot(hqRoot), QUESTION_RECORDS_DIR), "question", deps);
2077
2097
  }
@@ -1,4 +1,4 @@
1
- import { listQuestionIds, readLane, readQuestion, } from "./store.js";
1
+ import { expandLocalLaneIdPrefix, listQuestionIds, readLane, readQuestion, } from "./store.js";
2
2
  import { LaneNotFoundError, LanesError } from "./errors.js";
3
3
  import { providerSupportsSessionResume } from "./delivery.js";
4
4
  import { canResumeDoneKeepAliveLane, hasPendingKeepAliveWork, keepAliveNextCheckAtMs, LEAD_LANE_KEEP_ALIVE_MAX_RESUMES, } from "./keep-alive.js";
@@ -62,7 +62,9 @@ function canResumeKeepAliveLane(hqRoot, lane, nowMs = Date.now()) {
62
62
  return false;
63
63
  }
64
64
  export async function runLaneWatch(hqRoot, laneIds, deps = {}) {
65
- const watchedIds = validateLaneIds(laneIds);
65
+ // Watch by full lane id: a short prefix expands only when it names exactly
66
+ // one local lane, and an ambiguous prefix is refused with its candidates.
67
+ const watchedIds = [...new Set(validateLaneIds(laneIds).map((laneId) => expandLocalLaneIdPrefix(hqRoot, laneId) ?? laneId))];
66
68
  const readLaneRecord = deps.readLane ?? readLane;
67
69
  const listQuestions = deps.listQuestionIds ?? listQuestionIds;
68
70
  const readQuestionRecord = deps.readQuestion ?? readQuestion;
@@ -130,7 +132,7 @@ export async function runLaneWatch(hqRoot, laneIds, deps = {}) {
130
132
  }
131
133
  records.push(record);
132
134
  if (previousStates.get(laneId) !== record.state) {
133
- emit(`lane ${laneId}: state=${record.state}${isTerminalLaneState(record.state) ? " (terminal)" : ""}`);
135
+ emit(`lane ${record.lane_id}: state=${record.state}${isTerminalLaneState(record.state) ? " (terminal)" : ""}`);
134
136
  previousStates.set(laneId, record.state);
135
137
  }
136
138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.345.149",
3
+ "version": "5.345.150",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -52,7 +52,7 @@
52
52
  "@aws-sdk/client-iot-data-plane": "^3.1096.0",
53
53
  "@aws-sdk/client-s3": "^3.1049.0",
54
54
  "@aws-sdk/dsql-signer": "^3.1146.0",
55
- "@indigoai-us/hq-cloud": "~6.18.88",
55
+ "@indigoai-us/hq-cloud": "~6.18.90",
56
56
  "@indigoai-us/hq-flags-client": "^0.1.2",
57
57
  "@modelcontextprotocol/sdk": "1.29.0",
58
58
  "@sentry/node": "^10.49.0",
@@ -114,11 +114,11 @@
114
114
  "*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
115
115
  },
116
116
  "optionalDependencies": {
117
- "@indigoai-us/hq-hook-win32-x64": "5.345.149",
118
- "@indigoai-us/hq-hook-win32-arm64": "5.345.149",
119
- "@indigoai-us/hq-hook-darwin-x64": "5.345.149",
120
- "@indigoai-us/hq-hook-darwin-arm64": "5.345.149",
121
- "@indigoai-us/hq-hook-linux-x64": "5.345.149",
122
- "@indigoai-us/hq-hook-linux-arm64": "5.345.149"
117
+ "@indigoai-us/hq-hook-win32-x64": "5.345.150",
118
+ "@indigoai-us/hq-hook-win32-arm64": "5.345.150",
119
+ "@indigoai-us/hq-hook-darwin-x64": "5.345.150",
120
+ "@indigoai-us/hq-hook-darwin-arm64": "5.345.150",
121
+ "@indigoai-us/hq-hook-linux-x64": "5.345.150",
122
+ "@indigoai-us/hq-hook-linux-arm64": "5.345.150"
123
123
  }
124
124
  }