@indigoai-us/hq-cloud 6.15.95 → 6.15.97
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-watch-loop.d.ts +7 -2
- package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
- package/dist/bin/sync-runner-watch-loop.js +104 -34
- package/dist/bin/sync-runner-watch-loop.js.map +1 -1
- package/dist/bin/sync-runner.d.ts.map +1 -1
- package/dist/bin/sync-runner.js +3 -4
- package/dist/bin/sync-runner.js.map +1 -1
- package/dist/bin/sync-runner.test.js +9 -0
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +30 -7
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +47 -1
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync.d.ts +4 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/outposts/self-deploy.d.ts.map +1 -1
- package/dist/outposts/self-deploy.js +7 -5
- package/dist/outposts/self-deploy.js.map +1 -1
- package/dist/outposts/self-deploy.test.js +3 -2
- package/dist/outposts/self-deploy.test.js.map +1 -1
- package/dist/sync/area-ledger-auto-migration.d.ts +55 -0
- package/dist/sync/area-ledger-auto-migration.d.ts.map +1 -0
- package/dist/sync/area-ledger-auto-migration.js +167 -0
- package/dist/sync/area-ledger-auto-migration.js.map +1 -0
- package/dist/sync/area-ledger-auto-migration.test.d.ts +2 -0
- package/dist/sync/area-ledger-auto-migration.test.d.ts.map +1 -0
- package/dist/sync/area-ledger-auto-migration.test.js +229 -0
- package/dist/sync/area-ledger-auto-migration.test.js.map +1 -0
- package/dist/sync/event-sync.d.ts +11 -3
- package/dist/sync/event-sync.d.ts.map +1 -1
- package/dist/sync/event-sync.js +189 -101
- package/dist/sync/event-sync.js.map +1 -1
- package/dist/sync/event-sync.test.js +140 -0
- package/dist/sync/event-sync.test.js.map +1 -1
- package/dist/sync/feature-flags.d.ts +68 -15
- package/dist/sync/feature-flags.d.ts.map +1 -1
- package/dist/sync/feature-flags.js +98 -21
- package/dist/sync/feature-flags.js.map +1 -1
- package/dist/sync/feature-flags.test.js +145 -4
- package/dist/sync/feature-flags.test.js.map +1 -1
- package/dist/sync/index.d.ts +2 -2
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +1 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/push-transport.d.ts +18 -0
- package/dist/sync/push-transport.d.ts.map +1 -1
- package/dist/sync/push-transport.js +40 -0
- package/dist/sync/push-transport.js.map +1 -1
- package/dist/sync/state-store.d.ts +2 -2
- package/dist/sync/state-store.d.ts.map +1 -1
- package/dist/sync/state-store.js +186 -68
- package/dist/sync/state-store.js.map +1 -1
- package/dist/sync/state-store.test.js +72 -1
- package/dist/sync/state-store.test.js.map +1 -1
- package/dist/sync/sync-work.d.ts +1 -1
- package/dist/sync/sync-work.d.ts.map +1 -1
- package/dist/watcher.d.ts +4 -0
- package/dist/watcher.d.ts.map +1 -1
- package/dist/watcher.js +31 -6
- package/dist/watcher.js.map +1 -1
- package/dist/watcher.test.js +53 -0
- package/dist/watcher.test.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/share.test.js
CHANGED
|
@@ -64,7 +64,7 @@ vi.mock("readline", () => ({
|
|
|
64
64
|
import * as readline from "readline";
|
|
65
65
|
import { share, ServerOwnedPushPathsError, UnreachablePushPathsError, UnregisteredCompanySkillError, currentUploadBytes, parseRegisteredCompanySkillUid, _testing as shareTesting, } from "./share.js";
|
|
66
66
|
import { deleteRemoteFile, downloadFile, headRemoteFile, primeObjectTransport, primeUploads, uploadFile, uploadSymlink, WindowsSymlinkPrivilegeError, } from "../s3.js";
|
|
67
|
-
import { VaultAuthError, } from "../vault-client.js";
|
|
67
|
+
import { VaultAuthError, VaultPermissionDeniedError } from "../vault-client.js";
|
|
68
68
|
import { AreaLedgerMigration, closeCachedAreaJournalMigration, hashFile, openJournalStateStoreForMigration, readJournal, readJournalScoped, setAreaLedgerMigrationTestHooksForTest, writeJournal, } from "../journal.js";
|
|
69
69
|
import { ReconcileCursorStore } from "../sync/reconcile-cursor.js";
|
|
70
70
|
import { AreaResolver } from "../sync/area-resolver.js";
|
|
@@ -219,14 +219,59 @@ describe("company skill identity preflight", () => {
|
|
|
219
219
|
expect(uploadFile).not.toHaveBeenCalled();
|
|
220
220
|
expect(parseRegisteredCompanySkillUid(fs.readFileSync(file, "utf8"))).toBeUndefined();
|
|
221
221
|
});
|
|
222
|
+
it("skips unstamped skills when registration is denied and uploads other files", async () => {
|
|
223
|
+
const skill = createSkill("outpost-only", "---\nname: Outpost Only\ndescription: Missing id\n---\n");
|
|
224
|
+
const other = path.join(hqRoot, "companies", "acme", "policies", "keep.md");
|
|
225
|
+
fs.mkdirSync(path.dirname(other), { recursive: true });
|
|
226
|
+
fs.writeFileSync(other, "keep syncing");
|
|
227
|
+
const events = [];
|
|
228
|
+
const registrar = vi.fn(async () => {
|
|
229
|
+
throw new VaultPermissionDeniedError("Outpost machine principals cannot register skills");
|
|
230
|
+
});
|
|
231
|
+
const result = await share({
|
|
232
|
+
paths: [skill, other],
|
|
233
|
+
hqRoot,
|
|
234
|
+
entityContext: makeEntityContext(),
|
|
235
|
+
registerCompanySkill: registrar,
|
|
236
|
+
onEvent: (event) => events.push(event),
|
|
237
|
+
});
|
|
238
|
+
expect(result.filesUploaded).toBe(1);
|
|
239
|
+
expect(registrar).toHaveBeenCalledOnce();
|
|
240
|
+
expect(uploadFile).toHaveBeenCalledWith(expect.anything(), other, "policies/keep.md", undefined, expect.anything());
|
|
241
|
+
expect(uploadFile).not.toHaveBeenCalledWith(expect.anything(), skill, "skills/outpost-only/SKILL.md", undefined, expect.anything());
|
|
242
|
+
expect(events).toContainEqual({
|
|
243
|
+
type: "not-shipped",
|
|
244
|
+
reason: "skill-registration-denied",
|
|
245
|
+
count: 1,
|
|
246
|
+
samplePaths: ["skills/outpost-only/SKILL.md"],
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
it.each([
|
|
250
|
+
["a registration failure", new Error("registry unavailable")],
|
|
251
|
+
["an authentication failure", new VaultAuthError("session expired")],
|
|
252
|
+
])("propagates %s during company-skill registration", async (_description, error) => {
|
|
253
|
+
const skill = createSkill("must-register", "---\nname: Must Register\ndescription: Missing id\n---\n");
|
|
254
|
+
const registrar = vi.fn(async () => {
|
|
255
|
+
throw error;
|
|
256
|
+
});
|
|
257
|
+
await expect(share({
|
|
258
|
+
paths: [skill],
|
|
259
|
+
hqRoot,
|
|
260
|
+
entityContext: makeEntityContext(),
|
|
261
|
+
registerCompanySkill: registrar,
|
|
262
|
+
})).rejects.toBe(error);
|
|
263
|
+
expect(uploadFile).not.toHaveBeenCalled();
|
|
264
|
+
});
|
|
222
265
|
it("reconciles an already stamped canonical skill after upload", async () => {
|
|
223
266
|
const file = createSkill("existing", "---\nname: Existing\ndescription: Ready\nskill_uid: skl_EXISTING1\n---\n");
|
|
224
267
|
const registrar = vi.fn(async (input) => registered(input, "skl_EXISTING1"));
|
|
268
|
+
const events = [];
|
|
225
269
|
const result = await share({
|
|
226
270
|
paths: [file],
|
|
227
271
|
hqRoot,
|
|
228
272
|
entityContext: makeEntityContext(),
|
|
229
273
|
registerCompanySkill: registrar,
|
|
274
|
+
onEvent: (event) => events.push(event),
|
|
230
275
|
});
|
|
231
276
|
expect(registrar).toHaveBeenCalledOnce();
|
|
232
277
|
expect(registrar).toHaveBeenCalledWith({
|
|
@@ -236,6 +281,7 @@ describe("company skill identity preflight", () => {
|
|
|
236
281
|
landed: true,
|
|
237
282
|
});
|
|
238
283
|
expect(result.filesUploaded).toBe(1);
|
|
284
|
+
expect(events.some((event) => event.type === "not-shipped")).toBe(false);
|
|
239
285
|
});
|
|
240
286
|
it("does not reconcile bytes edited while the upload is in flight", async () => {
|
|
241
287
|
const original = "---\nname: Existing\ndescription: Ready\nskill_uid: skl_EXISTING1\ntags: [sales]\n---\n";
|