@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.
Files changed (69) hide show
  1. package/dist/bin/sync-runner-watch-loop.d.ts +7 -2
  2. package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
  3. package/dist/bin/sync-runner-watch-loop.js +104 -34
  4. package/dist/bin/sync-runner-watch-loop.js.map +1 -1
  5. package/dist/bin/sync-runner.d.ts.map +1 -1
  6. package/dist/bin/sync-runner.js +3 -4
  7. package/dist/bin/sync-runner.js.map +1 -1
  8. package/dist/bin/sync-runner.test.js +9 -0
  9. package/dist/bin/sync-runner.test.js.map +1 -1
  10. package/dist/cli/share.d.ts.map +1 -1
  11. package/dist/cli/share.js +30 -7
  12. package/dist/cli/share.js.map +1 -1
  13. package/dist/cli/share.test.js +47 -1
  14. package/dist/cli/share.test.js.map +1 -1
  15. package/dist/cli/sync.d.ts +4 -1
  16. package/dist/cli/sync.d.ts.map +1 -1
  17. package/dist/cli/sync.js.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/outposts/self-deploy.d.ts.map +1 -1
  23. package/dist/outposts/self-deploy.js +7 -5
  24. package/dist/outposts/self-deploy.js.map +1 -1
  25. package/dist/outposts/self-deploy.test.js +3 -2
  26. package/dist/outposts/self-deploy.test.js.map +1 -1
  27. package/dist/sync/area-ledger-auto-migration.d.ts +55 -0
  28. package/dist/sync/area-ledger-auto-migration.d.ts.map +1 -0
  29. package/dist/sync/area-ledger-auto-migration.js +167 -0
  30. package/dist/sync/area-ledger-auto-migration.js.map +1 -0
  31. package/dist/sync/area-ledger-auto-migration.test.d.ts +2 -0
  32. package/dist/sync/area-ledger-auto-migration.test.d.ts.map +1 -0
  33. package/dist/sync/area-ledger-auto-migration.test.js +229 -0
  34. package/dist/sync/area-ledger-auto-migration.test.js.map +1 -0
  35. package/dist/sync/event-sync.d.ts +11 -3
  36. package/dist/sync/event-sync.d.ts.map +1 -1
  37. package/dist/sync/event-sync.js +189 -101
  38. package/dist/sync/event-sync.js.map +1 -1
  39. package/dist/sync/event-sync.test.js +140 -0
  40. package/dist/sync/event-sync.test.js.map +1 -1
  41. package/dist/sync/feature-flags.d.ts +68 -15
  42. package/dist/sync/feature-flags.d.ts.map +1 -1
  43. package/dist/sync/feature-flags.js +98 -21
  44. package/dist/sync/feature-flags.js.map +1 -1
  45. package/dist/sync/feature-flags.test.js +145 -4
  46. package/dist/sync/feature-flags.test.js.map +1 -1
  47. package/dist/sync/index.d.ts +2 -2
  48. package/dist/sync/index.d.ts.map +1 -1
  49. package/dist/sync/index.js +1 -1
  50. package/dist/sync/index.js.map +1 -1
  51. package/dist/sync/push-transport.d.ts +18 -0
  52. package/dist/sync/push-transport.d.ts.map +1 -1
  53. package/dist/sync/push-transport.js +40 -0
  54. package/dist/sync/push-transport.js.map +1 -1
  55. package/dist/sync/state-store.d.ts +2 -2
  56. package/dist/sync/state-store.d.ts.map +1 -1
  57. package/dist/sync/state-store.js +186 -68
  58. package/dist/sync/state-store.js.map +1 -1
  59. package/dist/sync/state-store.test.js +72 -1
  60. package/dist/sync/state-store.test.js.map +1 -1
  61. package/dist/sync/sync-work.d.ts +1 -1
  62. package/dist/sync/sync-work.d.ts.map +1 -1
  63. package/dist/watcher.d.ts +4 -0
  64. package/dist/watcher.d.ts.map +1 -1
  65. package/dist/watcher.js +31 -6
  66. package/dist/watcher.js.map +1 -1
  67. package/dist/watcher.test.js +53 -0
  68. package/dist/watcher.test.js.map +1 -1
  69. package/package.json +1 -1
@@ -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";