@indigoai-us/hq-cloud 5.1.0 → 5.1.8
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/dist/bin/sync-runner.d.ts +111 -0
- package/dist/bin/sync-runner.d.ts.map +1 -0
- package/dist/bin/sync-runner.js +285 -0
- package/dist/bin/sync-runner.js.map +1 -0
- package/dist/bin/sync-runner.test.d.ts +10 -0
- package/dist/bin/sync-runner.test.d.ts.map +1 -0
- package/dist/bin/sync-runner.test.js +492 -0
- package/dist/bin/sync-runner.test.js.map +1 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/share.js +2 -2
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +9 -1
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync.d.ts +28 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +33 -10
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/sync.test.js +15 -4
- package/dist/cli/sync.test.js.map +1 -1
- package/dist/cognito-auth.d.ts.map +1 -1
- package/dist/cognito-auth.js +19 -1
- package/dist/cognito-auth.js.map +1 -1
- package/dist/cognito-auth.test.d.ts +9 -0
- package/dist/cognito-auth.test.d.ts.map +1 -0
- package/dist/cognito-auth.test.js +113 -0
- package/dist/cognito-auth.test.js.map +1 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -0
- package/dist/context.js.map +1 -1
- package/dist/daemon-worker.d.ts +6 -1
- package/dist/daemon-worker.d.ts.map +1 -1
- package/dist/daemon-worker.js +12 -16
- package/dist/daemon-worker.js.map +1 -1
- package/dist/daemon.d.ts +2 -0
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +2 -0
- package/dist/daemon.js.map +1 -1
- package/dist/ignore.d.ts +13 -2
- package/dist/ignore.d.ts.map +1 -1
- package/dist/ignore.js +69 -12
- package/dist/ignore.js.map +1 -1
- package/dist/index.d.ts +24 -28
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -134
- package/dist/index.js.map +1 -1
- package/dist/journal.d.ts +20 -4
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js +45 -8
- package/dist/journal.js.map +1 -1
- package/dist/journal.test.d.ts +9 -0
- package/dist/journal.test.d.ts.map +1 -0
- package/dist/journal.test.js +114 -0
- package/dist/journal.test.js.map +1 -0
- package/dist/s3.d.ts +18 -6
- package/dist/s3.d.ts.map +1 -1
- package/dist/s3.js +57 -56
- package/dist/s3.js.map +1 -1
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vault-client.d.ts +16 -0
- package/dist/vault-client.d.ts.map +1 -1
- package/dist/vault-client.js +19 -0
- package/dist/vault-client.js.map +1 -1
- package/dist/vault-client.test.js +25 -0
- package/dist/vault-client.test.js.map +1 -1
- package/dist/watcher.d.ts +7 -1
- package/dist/watcher.d.ts.map +1 -1
- package/dist/watcher.js +11 -5
- package/dist/watcher.js.map +1 -1
- package/package.json +15 -3
- package/src/bin/sync-runner.test.ts +617 -0
- package/src/bin/sync-runner.ts +390 -0
- package/src/cli/accept.ts +97 -0
- package/src/cli/conflict.ts +119 -0
- package/src/cli/index.ts +25 -0
- package/src/cli/invite.test.ts +247 -0
- package/src/cli/invite.ts +180 -0
- package/src/cli/promote.ts +123 -0
- package/src/cli/share.test.ts +155 -0
- package/src/cli/share.ts +212 -0
- package/src/cli/sync.test.ts +225 -0
- package/src/cli/sync.ts +225 -0
- package/src/cognito-auth.test.ts +156 -0
- package/src/cognito-auth.ts +18 -1
- package/src/context.test.ts +202 -0
- package/src/context.ts +178 -0
- package/src/daemon-worker.ts +13 -19
- package/src/daemon.ts +2 -0
- package/src/ignore.ts +76 -12
- package/src/index.ts +93 -165
- package/src/journal.test.ts +146 -0
- package/src/journal.ts +53 -11
- package/src/s3.ts +76 -66
- package/src/types.ts +37 -0
- package/src/vault-client.test.ts +390 -0
- package/src/vault-client.ts +400 -0
- package/src/watcher.ts +12 -5
- package/test/invite-flow.integration.test.ts +244 -0
- package/test/share-sync.integration.test.ts +210 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* hq-sync-runner — machine-targeted entrypoint for `@indigoai-us/hq-cloud`
|
|
4
|
+
* (ADR-0001).
|
|
5
|
+
*
|
|
6
|
+
* The AppBar Sync menubar (Tauri + Rust) spawns this binary as a subprocess
|
|
7
|
+
* and reads ndjson events from stdout. The protocol is intentionally narrow
|
|
8
|
+
* and versioned-by-shape, not by tooling — no chalk, no colors, no human
|
|
9
|
+
* prose. If you want to invoke sync as a human, use `hq sync` in
|
|
10
|
+
* `@indigoai-us/hq-cli`.
|
|
11
|
+
*
|
|
12
|
+
* Flags:
|
|
13
|
+
* --companies Fan out across every membership the caller has
|
|
14
|
+
* --company <slug-or-uid> Sync a single company (alternative to --companies)
|
|
15
|
+
* --on-conflict <strategy> abort | overwrite | keep (default: abort)
|
|
16
|
+
* --hq-root <path> Local HQ directory (default: $HOME/hq)
|
|
17
|
+
* --json Ignored — ndjson on stdout is the default and
|
|
18
|
+
* only output mode. Accepted for symmetry with the
|
|
19
|
+
* AppBar's argv in case someone passes it.
|
|
20
|
+
*
|
|
21
|
+
* Event protocol (one JSON object per line on stdout):
|
|
22
|
+
* setup-needed — caller signed in but has no person entity yet
|
|
23
|
+
* auth-error — no valid token available (interactive login disabled)
|
|
24
|
+
* fanout-plan — list of companies we're about to sync
|
|
25
|
+
* progress — per-file download
|
|
26
|
+
* error — per-file or per-company error
|
|
27
|
+
* complete — per-company summary
|
|
28
|
+
* all-complete — aggregate summary after fanout
|
|
29
|
+
*
|
|
30
|
+
* Exit code:
|
|
31
|
+
* 0 — event stream describes the outcome (including setup-needed)
|
|
32
|
+
* 1 — argv parse error or unrecoverable pre-sync failure
|
|
33
|
+
*/
|
|
34
|
+
import { type VaultServiceConfig, type Membership, type EntityInfo } from "../index.js";
|
|
35
|
+
import type { SyncOptions, SyncResult, SyncProgressEvent } from "../cli/sync.js";
|
|
36
|
+
/**
|
|
37
|
+
* Every event emitted on stdout. The `company` field is present on every
|
|
38
|
+
* event except `setup-needed` / `auth-error` / `fanout-plan` / `all-complete`
|
|
39
|
+
* (which describe the whole run) — consumers should treat its absence as
|
|
40
|
+
* "meta-event, not tied to a specific company".
|
|
41
|
+
*/
|
|
42
|
+
export type RunnerEvent = {
|
|
43
|
+
type: "setup-needed";
|
|
44
|
+
} | {
|
|
45
|
+
type: "auth-error";
|
|
46
|
+
message: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: "fanout-plan";
|
|
49
|
+
companies: Array<{
|
|
50
|
+
uid: string;
|
|
51
|
+
slug: string;
|
|
52
|
+
}>;
|
|
53
|
+
} | ({
|
|
54
|
+
type: "progress";
|
|
55
|
+
company: string;
|
|
56
|
+
} & Omit<Extract<SyncProgressEvent, {
|
|
57
|
+
type: "progress";
|
|
58
|
+
}>, "type">) | ({
|
|
59
|
+
type: "error";
|
|
60
|
+
company?: string;
|
|
61
|
+
} & Omit<Extract<SyncProgressEvent, {
|
|
62
|
+
type: "error";
|
|
63
|
+
}>, "type">) | ({
|
|
64
|
+
type: "complete";
|
|
65
|
+
company: string;
|
|
66
|
+
} & SyncResult) | {
|
|
67
|
+
type: "all-complete";
|
|
68
|
+
companiesAttempted: number;
|
|
69
|
+
filesDownloaded: number;
|
|
70
|
+
bytesDownloaded: number;
|
|
71
|
+
errors: Array<{
|
|
72
|
+
company: string;
|
|
73
|
+
message: string;
|
|
74
|
+
}>;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The narrow VaultClient surface the runner actually uses. Declared here (not
|
|
78
|
+
* `Pick<VaultClient, ...>`) because `Pick` preserves the *entire* `entity`
|
|
79
|
+
* accessor object — but the runner only needs `entity.get`, and forcing test
|
|
80
|
+
* stubs to also implement `findBySlug`/`create` would be dishonest about the
|
|
81
|
+
* real dependency. Keep this interface in sync with the real VaultClient
|
|
82
|
+
* method signatures (both return types come straight from the SDK).
|
|
83
|
+
*/
|
|
84
|
+
export interface VaultClientSurface {
|
|
85
|
+
listMyMemberships: () => Promise<Membership[]>;
|
|
86
|
+
entity: {
|
|
87
|
+
get: (uid: string) => Promise<EntityInfo>;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export interface RunnerDeps {
|
|
91
|
+
/** Where to write ndjson events. Defaults to `process.stdout`. */
|
|
92
|
+
stdout?: {
|
|
93
|
+
write: (chunk: string) => boolean | void;
|
|
94
|
+
};
|
|
95
|
+
/** Where to write diagnostics. Defaults to `process.stderr`. */
|
|
96
|
+
stderr?: {
|
|
97
|
+
write: (chunk: string) => boolean | void;
|
|
98
|
+
};
|
|
99
|
+
/** Resolve a valid access token. Defaults to `getValidAccessToken` non-interactive. */
|
|
100
|
+
getAccessToken?: () => Promise<string>;
|
|
101
|
+
/**
|
|
102
|
+
* Produce a VaultClient-like object. Defaults to `new VaultClient(config)`.
|
|
103
|
+
* Tests inject a stub here — only `listMyMemberships` and `entity.get` are
|
|
104
|
+
* called by the runner, so stubs only need to implement those.
|
|
105
|
+
*/
|
|
106
|
+
createVaultClient?: (config: VaultServiceConfig) => VaultClientSurface;
|
|
107
|
+
/** Sync function. Defaults to `cli/sync.sync`. */
|
|
108
|
+
sync?: (options: SyncOptions) => Promise<SyncResult>;
|
|
109
|
+
}
|
|
110
|
+
export declare function runRunner(argv: string[], deps?: RunnerDeps): Promise<number>;
|
|
111
|
+
//# sourceMappingURL=sync-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-runner.d.ts","sourceRoot":"","sources":["../../src/bin/sync-runner.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAMH,OAAO,EAKL,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EACV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E,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;KAC3C,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB,kEAAkE;IAClE,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC;IACtD,gEAAgE;IAChE,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC;IACtD,uFAAuF;IACvF,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACvC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,kBAAkB,CAAC;IACvE,kDAAkD;IAClD,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACtD;AAiED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,GAAE,UAAe,GACpB,OAAO,CAAC,MAAM,CAAC,CAqJjB"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* hq-sync-runner — machine-targeted entrypoint for `@indigoai-us/hq-cloud`
|
|
4
|
+
* (ADR-0001).
|
|
5
|
+
*
|
|
6
|
+
* The AppBar Sync menubar (Tauri + Rust) spawns this binary as a subprocess
|
|
7
|
+
* and reads ndjson events from stdout. The protocol is intentionally narrow
|
|
8
|
+
* and versioned-by-shape, not by tooling — no chalk, no colors, no human
|
|
9
|
+
* prose. If you want to invoke sync as a human, use `hq sync` in
|
|
10
|
+
* `@indigoai-us/hq-cli`.
|
|
11
|
+
*
|
|
12
|
+
* Flags:
|
|
13
|
+
* --companies Fan out across every membership the caller has
|
|
14
|
+
* --company <slug-or-uid> Sync a single company (alternative to --companies)
|
|
15
|
+
* --on-conflict <strategy> abort | overwrite | keep (default: abort)
|
|
16
|
+
* --hq-root <path> Local HQ directory (default: $HOME/hq)
|
|
17
|
+
* --json Ignored — ndjson on stdout is the default and
|
|
18
|
+
* only output mode. Accepted for symmetry with the
|
|
19
|
+
* AppBar's argv in case someone passes it.
|
|
20
|
+
*
|
|
21
|
+
* Event protocol (one JSON object per line on stdout):
|
|
22
|
+
* setup-needed — caller signed in but has no person entity yet
|
|
23
|
+
* auth-error — no valid token available (interactive login disabled)
|
|
24
|
+
* fanout-plan — list of companies we're about to sync
|
|
25
|
+
* progress — per-file download
|
|
26
|
+
* error — per-file or per-company error
|
|
27
|
+
* complete — per-company summary
|
|
28
|
+
* all-complete — aggregate summary after fanout
|
|
29
|
+
*
|
|
30
|
+
* Exit code:
|
|
31
|
+
* 0 — event stream describes the outcome (including setup-needed)
|
|
32
|
+
* 1 — argv parse error or unrecoverable pre-sync failure
|
|
33
|
+
*/
|
|
34
|
+
import * as os from "os";
|
|
35
|
+
import * as path from "path";
|
|
36
|
+
import * as fs from "fs";
|
|
37
|
+
import { fileURLToPath } from "url";
|
|
38
|
+
import { getValidAccessToken, VaultClient, VaultAuthError, } from "../index.js";
|
|
39
|
+
import { sync as defaultSync } from "../cli/sync.js";
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Defaults — mirror `hq-cli/src/utils/cognito-session.ts`. Inlined (not
|
|
42
|
+
// imported) to avoid a circular dep between hq-cli and hq-cloud. If these
|
|
43
|
+
// drift, the symptom is "runner talks to a different stage than hq sync"
|
|
44
|
+
// — keep both files lined up.
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
const DEFAULT_COGNITO = {
|
|
47
|
+
region: process.env.AWS_REGION ?? "us-east-1",
|
|
48
|
+
userPoolDomain: process.env.HQ_COGNITO_DOMAIN ?? "hq-vault-dev",
|
|
49
|
+
clientId: process.env.HQ_COGNITO_CLIENT_ID ?? "4mmujmjq3srakdueg656b9m0mp",
|
|
50
|
+
port: process.env.HQ_COGNITO_CALLBACK_PORT
|
|
51
|
+
? Number(process.env.HQ_COGNITO_CALLBACK_PORT)
|
|
52
|
+
: 8765,
|
|
53
|
+
};
|
|
54
|
+
const DEFAULT_VAULT_API_URL = process.env.HQ_VAULT_API_URL ??
|
|
55
|
+
"https://tqdwdqxv75.execute-api.us-east-1.amazonaws.com";
|
|
56
|
+
const DEFAULT_HQ_ROOT = path.join(os.homedir(), "hq");
|
|
57
|
+
function parseArgs(argv) {
|
|
58
|
+
let companies = false;
|
|
59
|
+
let company;
|
|
60
|
+
let onConflict = "abort";
|
|
61
|
+
let hqRoot = DEFAULT_HQ_ROOT;
|
|
62
|
+
for (let i = 0; i < argv.length; i++) {
|
|
63
|
+
const arg = argv[i];
|
|
64
|
+
switch (arg) {
|
|
65
|
+
case "--companies":
|
|
66
|
+
companies = true;
|
|
67
|
+
break;
|
|
68
|
+
case "--company":
|
|
69
|
+
company = argv[++i];
|
|
70
|
+
if (!company)
|
|
71
|
+
return { error: "--company requires a value" };
|
|
72
|
+
break;
|
|
73
|
+
case "--on-conflict": {
|
|
74
|
+
const val = argv[++i];
|
|
75
|
+
if (val !== "abort" && val !== "overwrite" && val !== "keep") {
|
|
76
|
+
return {
|
|
77
|
+
error: `--on-conflict must be one of abort|overwrite|keep, got: ${val ?? "(missing)"}`,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
onConflict = val;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case "--hq-root":
|
|
84
|
+
hqRoot = argv[++i];
|
|
85
|
+
if (!hqRoot)
|
|
86
|
+
return { error: "--hq-root requires a value" };
|
|
87
|
+
break;
|
|
88
|
+
case "--json":
|
|
89
|
+
// Accepted but ignored — ndjson is the only output mode.
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
return { error: `Unknown argument: ${arg}` };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (companies && company) {
|
|
96
|
+
return { error: "Pass --companies OR --company <slug>, not both" };
|
|
97
|
+
}
|
|
98
|
+
if (!companies && !company) {
|
|
99
|
+
return { error: "Pass --companies or --company <slug>" };
|
|
100
|
+
}
|
|
101
|
+
return { companies, company, onConflict, hqRoot };
|
|
102
|
+
}
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// runRunner — testable entrypoint
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
export async function runRunner(argv, deps = {}) {
|
|
107
|
+
const stdout = deps.stdout ?? process.stdout;
|
|
108
|
+
const stderr = deps.stderr ?? process.stderr;
|
|
109
|
+
const emit = (event) => {
|
|
110
|
+
stdout.write(`${JSON.stringify(event)}\n`);
|
|
111
|
+
};
|
|
112
|
+
// ---- argv -------------------------------------------------------------
|
|
113
|
+
const parsed = parseArgs(argv);
|
|
114
|
+
if ("error" in parsed) {
|
|
115
|
+
stderr.write(`hq-sync-runner: ${parsed.error}\n`);
|
|
116
|
+
return 1;
|
|
117
|
+
}
|
|
118
|
+
// ---- auth -------------------------------------------------------------
|
|
119
|
+
let accessToken;
|
|
120
|
+
try {
|
|
121
|
+
const getAccessToken = deps.getAccessToken ??
|
|
122
|
+
(() => getValidAccessToken(DEFAULT_COGNITO, { interactive: false }));
|
|
123
|
+
accessToken = await getAccessToken();
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
emit({
|
|
127
|
+
type: "auth-error",
|
|
128
|
+
message: err instanceof Error ? err.message : String(err),
|
|
129
|
+
});
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
132
|
+
// ---- vault client -----------------------------------------------------
|
|
133
|
+
const vaultConfig = {
|
|
134
|
+
apiUrl: DEFAULT_VAULT_API_URL,
|
|
135
|
+
authToken: accessToken,
|
|
136
|
+
region: DEFAULT_COGNITO.region,
|
|
137
|
+
};
|
|
138
|
+
const client = deps.createVaultClient?.(vaultConfig) ?? new VaultClient(vaultConfig);
|
|
139
|
+
// ---- resolve targets --------------------------------------------------
|
|
140
|
+
let memberships;
|
|
141
|
+
try {
|
|
142
|
+
if (parsed.companies) {
|
|
143
|
+
memberships = await client.listMyMemberships();
|
|
144
|
+
if (memberships.length === 0) {
|
|
145
|
+
emit({ type: "setup-needed" });
|
|
146
|
+
return 0;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
// Single-company mode: fabricate a minimal membership so the fanout
|
|
151
|
+
// loop below treats it uniformly. We don't need to hit
|
|
152
|
+
// /membership/me — the caller already told us which company.
|
|
153
|
+
memberships = [{ companyUid: parsed.company }];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch (err) {
|
|
157
|
+
if (err instanceof VaultAuthError) {
|
|
158
|
+
emit({
|
|
159
|
+
type: "auth-error",
|
|
160
|
+
message: err.message,
|
|
161
|
+
});
|
|
162
|
+
return 0;
|
|
163
|
+
}
|
|
164
|
+
// Any other failure is unrecoverable — surface as an error event and
|
|
165
|
+
// exit non-zero so the spawner knows the runner didn't get far enough
|
|
166
|
+
// to emit a useful protocol stream.
|
|
167
|
+
emit({
|
|
168
|
+
type: "error",
|
|
169
|
+
message: err instanceof Error ? err.message : String(err),
|
|
170
|
+
path: "(discovery)",
|
|
171
|
+
});
|
|
172
|
+
return 1;
|
|
173
|
+
}
|
|
174
|
+
// ---- resolve slugs for the fanout plan --------------------------------
|
|
175
|
+
// The menubar wants "Syncing indigo" in its UI, not the raw cmp_* ULID.
|
|
176
|
+
// If the entity fetch fails for some row (entity deleted, scoping issue),
|
|
177
|
+
// degrade to using the UID as the slug rather than aborting the run.
|
|
178
|
+
const plan = [];
|
|
179
|
+
for (const m of memberships) {
|
|
180
|
+
let slug = m.companyUid;
|
|
181
|
+
try {
|
|
182
|
+
const info = await client.entity.get(m.companyUid);
|
|
183
|
+
slug = info.slug || m.companyUid;
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// Best-effort — keep UID as the display identifier.
|
|
187
|
+
}
|
|
188
|
+
plan.push({ uid: m.companyUid, slug });
|
|
189
|
+
}
|
|
190
|
+
emit({ type: "fanout-plan", companies: plan });
|
|
191
|
+
// ---- fanout -----------------------------------------------------------
|
|
192
|
+
const syncFn = deps.sync ?? defaultSync;
|
|
193
|
+
let totalFiles = 0;
|
|
194
|
+
let totalBytes = 0;
|
|
195
|
+
const errors = [];
|
|
196
|
+
for (const target of plan) {
|
|
197
|
+
const companyLabel = target.slug;
|
|
198
|
+
try {
|
|
199
|
+
const result = await syncFn({
|
|
200
|
+
company: target.uid,
|
|
201
|
+
vaultConfig,
|
|
202
|
+
hqRoot: parsed.hqRoot,
|
|
203
|
+
onConflict: parsed.onConflict,
|
|
204
|
+
onEvent: (event) => {
|
|
205
|
+
// Tag per-file events with the company they belong to so the
|
|
206
|
+
// menubar can route them to the right company's progress bar.
|
|
207
|
+
if (event.type === "progress") {
|
|
208
|
+
emit({
|
|
209
|
+
type: "progress",
|
|
210
|
+
company: companyLabel,
|
|
211
|
+
path: event.path,
|
|
212
|
+
bytes: event.bytes,
|
|
213
|
+
...(event.message ? { message: event.message } : {}),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
emit({
|
|
218
|
+
type: "error",
|
|
219
|
+
company: companyLabel,
|
|
220
|
+
path: event.path,
|
|
221
|
+
message: event.message,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
});
|
|
226
|
+
emit({ type: "complete", company: companyLabel, ...result });
|
|
227
|
+
totalFiles += result.filesDownloaded;
|
|
228
|
+
totalBytes += result.bytesDownloaded;
|
|
229
|
+
}
|
|
230
|
+
catch (err) {
|
|
231
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
232
|
+
errors.push({ company: companyLabel, message });
|
|
233
|
+
emit({
|
|
234
|
+
type: "error",
|
|
235
|
+
company: companyLabel,
|
|
236
|
+
path: "(company)",
|
|
237
|
+
message,
|
|
238
|
+
});
|
|
239
|
+
// Continue — one company's failure shouldn't abort the whole fanout.
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
emit({
|
|
243
|
+
type: "all-complete",
|
|
244
|
+
companiesAttempted: plan.length,
|
|
245
|
+
filesDownloaded: totalFiles,
|
|
246
|
+
bytesDownloaded: totalBytes,
|
|
247
|
+
errors,
|
|
248
|
+
});
|
|
249
|
+
return 0;
|
|
250
|
+
}
|
|
251
|
+
// ---------------------------------------------------------------------------
|
|
252
|
+
// Entrypoint — only runs when invoked directly, not when imported for tests
|
|
253
|
+
// ---------------------------------------------------------------------------
|
|
254
|
+
// Detect whether this module is the entry point. The obvious check
|
|
255
|
+
// (`import.meta.url === file://${argv[1]}`) breaks for every real-world
|
|
256
|
+
// install shape: npm-link'd binaries, global installs via Homebrew, and
|
|
257
|
+
// pnpm's `node_modules/.bin` shims all leave `process.argv[1]` pointing
|
|
258
|
+
// at a symlink named `hq-sync-runner` (no `.js` suffix) while
|
|
259
|
+
// `import.meta.url` always resolves to the underlying `sync-runner.js`.
|
|
260
|
+
//
|
|
261
|
+
// Resolve both sides through realpath before comparing — that's the only
|
|
262
|
+
// way to handle all symlink layouts without false negatives. If realpath
|
|
263
|
+
// fails (argv[1] gone, permissions), fall through to `false` so we
|
|
264
|
+
// don't run twice when imported as a library.
|
|
265
|
+
const isDirectInvocation = (() => {
|
|
266
|
+
if (!process.argv[1])
|
|
267
|
+
return false;
|
|
268
|
+
try {
|
|
269
|
+
const modulePath = fs.realpathSync(fileURLToPath(import.meta.url));
|
|
270
|
+
const argvPath = fs.realpathSync(process.argv[1]);
|
|
271
|
+
return modulePath === argvPath;
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
})();
|
|
277
|
+
if (isDirectInvocation) {
|
|
278
|
+
runRunner(process.argv.slice(2))
|
|
279
|
+
.then((code) => process.exit(code))
|
|
280
|
+
.catch((err) => {
|
|
281
|
+
process.stderr.write(`hq-sync-runner: uncaught error — ${err instanceof Error ? err.stack ?? err.message : String(err)}\n`);
|
|
282
|
+
process.exit(1);
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=sync-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-runner.js","sourceRoot":"","sources":["../../src/bin/sync-runner.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,cAAc,GAKf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQrD,8EAA8E;AAC9E,wEAAwE;AACxE,0EAA0E;AAC1E,yEAAyE;AACzE,8BAA8B;AAC9B,8EAA8E;AAE9E,MAAM,eAAe,GAAsB;IACzC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,WAAW;IAC7C,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,cAAc;IAC/D,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,4BAA4B;IAC1E,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB;QACxC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;QAC9C,CAAC,CAAC,IAAI;CACT,CAAC;AAEF,MAAM,qBAAqB,GACzB,OAAO,CAAC,GAAG,CAAC,gBAAgB;IAC5B,wDAAwD,CAAC;AAE3D,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;AAyEtD,SAAS,SAAS,CAAC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,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CACtG,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for hq-sync-runner (ADR-0001).
|
|
3
|
+
*
|
|
4
|
+
* The runner is designed around `RunnerDeps` — every side effect is
|
|
5
|
+
* injectable, so tests assert on captured ndjson output rather than mocking
|
|
6
|
+
* modules. That keeps each test honest about what the runner does vs what
|
|
7
|
+
* its collaborators do.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=sync-runner.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-runner.test.d.ts","sourceRoot":"","sources":["../../src/bin/sync-runner.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|