@stigmer/server 3.32.0 → 3.33.0

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 (62) hide show
  1. package/dist/boot/compose.d.ts.map +1 -1
  2. package/dist/boot/compose.js +8 -1
  3. package/dist/boot/compose.js.map +1 -1
  4. package/dist/domain/apikey/controller.d.ts.map +1 -1
  5. package/dist/domain/apikey/controller.js +7 -2
  6. package/dist/domain/apikey/controller.js.map +1 -1
  7. package/dist/domain/apikey/verifier.d.ts +5 -0
  8. package/dist/domain/apikey/verifier.d.ts.map +1 -1
  9. package/dist/domain/apikey/verifier.js +32 -3
  10. package/dist/domain/apikey/verifier.js.map +1 -1
  11. package/dist/domain/platformclient/mint.d.ts.map +1 -1
  12. package/dist/domain/platformclient/mint.js +28 -1
  13. package/dist/domain/platformclient/mint.js.map +1 -1
  14. package/dist/domain/platformclient/resource-store.d.ts.map +1 -1
  15. package/dist/domain/platformclient/resource-store.js +13 -0
  16. package/dist/domain/platformclient/resource-store.js.map +1 -1
  17. package/dist/domain/platformclient/store-contract.d.ts.map +1 -1
  18. package/dist/domain/platformclient/store-contract.js +59 -0
  19. package/dist/domain/platformclient/store-contract.js.map +1 -1
  20. package/dist/domain/platformclient/store.d.ts +20 -0
  21. package/dist/domain/platformclient/store.d.ts.map +1 -1
  22. package/dist/domain/platformclient/store.js.map +1 -1
  23. package/dist/identity/credential-use.d.ts +74 -0
  24. package/dist/identity/credential-use.d.ts.map +1 -0
  25. package/dist/identity/credential-use.js +59 -0
  26. package/dist/identity/credential-use.js.map +1 -0
  27. package/dist/pipeline/steps/defaults.d.ts +10 -0
  28. package/dist/pipeline/steps/defaults.d.ts.map +1 -1
  29. package/dist/pipeline/steps/defaults.js +25 -0
  30. package/dist/pipeline/steps/defaults.js.map +1 -1
  31. package/dist/temporal/schedule/activities.d.ts.map +1 -1
  32. package/dist/temporal/schedule/activities.js +2 -1
  33. package/dist/temporal/schedule/activities.js.map +1 -1
  34. package/dist/temporal/schedule/run-starter.d.ts.map +1 -1
  35. package/dist/temporal/schedule/run-starter.js +2 -1
  36. package/dist/temporal/schedule/run-starter.js.map +1 -1
  37. package/dist/temporal/schedule/status-writes.d.ts +0 -6
  38. package/dist/temporal/schedule/status-writes.d.ts.map +1 -1
  39. package/dist/temporal/schedule/status-writes.js +8 -27
  40. package/dist/temporal/schedule/status-writes.js.map +1 -1
  41. package/dist/temporal/schedule/syncer.d.ts.map +1 -1
  42. package/dist/temporal/schedule/syncer.js +2 -1
  43. package/dist/temporal/schedule/syncer.js.map +1 -1
  44. package/package.json +6 -6
  45. package/src/boot/compose.ts +8 -1
  46. package/src/domain/apikey/__tests__/apikey.test.ts +17 -2
  47. package/src/domain/apikey/__tests__/verifier.test.ts +86 -3
  48. package/src/domain/apikey/controller.ts +12 -2
  49. package/src/domain/apikey/verifier.ts +46 -3
  50. package/src/domain/platformclient/__tests__/mint.test.ts +97 -11
  51. package/src/domain/platformclient/__tests__/resource-store.test.ts +4 -0
  52. package/src/domain/platformclient/mint.ts +34 -1
  53. package/src/domain/platformclient/resource-store.ts +18 -0
  54. package/src/domain/platformclient/store-contract.ts +100 -0
  55. package/src/domain/platformclient/store.ts +23 -0
  56. package/src/identity/__tests__/credential-use.test.ts +186 -0
  57. package/src/identity/credential-use.ts +130 -0
  58. package/src/pipeline/steps/defaults.ts +27 -0
  59. package/src/temporal/schedule/activities.ts +2 -1
  60. package/src/temporal/schedule/run-starter.ts +2 -1
  61. package/src/temporal/schedule/status-writes.ts +8 -31
  62. package/src/temporal/schedule/syncer.ts +2 -1
@@ -1,26 +1,19 @@
1
1
  /**
2
- * The clock's status-write helpers — port the ensureStatus/bumpStatusAudit
3
- * pair of pkg/domain/schedule/temporal/syncer.go.
2
+ * The clock's status-write helper — ports ensureStatus of
3
+ * pkg/domain/schedule/temporal/syncer.go.
4
4
  *
5
- * bumpStatusAudit is DELIBERATELY narrower than the shared
6
- * setAuditFieldsForUpdate: Go's clock stamps only status-audit
7
- * updated_at + event ("the same two leaves every cloud runtime patch
8
- * bumps") and never an actor — the clock is the platform, not an operator.
9
- * Controller-side status writes (trigger's last_fire_at stamp, resume's
10
- * clear) use the FULL shared helper instead, exactly as Go splits
11
- * steps.SetAuditFieldsForUpdate from the clock's bump. Two flavors, two
12
- * writers, both wire-visible — keep them distinct.
5
+ * The clock's audit stamp is the shared `bumpStatusAudit`
6
+ * (pipeline/steps/defaults.ts): status-audit updated_at + event only, never
7
+ * an actor — the clock is the platform, not an operator. Controller-side
8
+ * status writes (trigger's last_fire_at stamp, resume's clear) use the FULL
9
+ * setAuditFieldsForUpdate instead, exactly as Go splits
10
+ * steps.SetAuditFieldsForUpdate from the clock's bump.
13
11
  */
14
12
  import { create } from "@bufbuild/protobuf";
15
- import { timestampNow } from "@bufbuild/protobuf/wkt";
16
13
 
17
14
  import type { Schedule } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/api_pb";
18
15
  import { ScheduleStatusSchema } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/status_pb";
19
16
  import type { ScheduleStatus } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/status_pb";
20
- import {
21
- ApiResourceAuditInfoSchema,
22
- ApiResourceAuditSchema,
23
- } from "@stigmer/protos/ai/stigmer/commons/apiresource/status_pb";
24
17
 
25
18
  /**
26
19
  * Returns the schedule's status, materializing the nested message a fresh
@@ -32,19 +25,3 @@ export function ensureStatus(schedule: Schedule): ScheduleStatus {
32
25
  }
33
26
  return schedule.status;
34
27
  }
35
-
36
- /**
37
- * Stamps the status-audit trail for a runtime write — updated_at + event
38
- * "updated", nothing else (Go bumpStatusAudit; see the module header for
39
- * why this is not setAuditFieldsForUpdate).
40
- */
41
- export function bumpStatusAudit(status: ScheduleStatus): void {
42
- if (status.audit === undefined) {
43
- status.audit = create(ApiResourceAuditSchema);
44
- }
45
- if (status.audit.statusAudit === undefined) {
46
- status.audit.statusAudit = create(ApiResourceAuditInfoSchema);
47
- }
48
- status.audit.statusAudit.updatedAt = timestampNow();
49
- status.audit.statusAudit.event = "updated";
50
- }
@@ -34,12 +34,13 @@ import type { Schedule } from "@stigmer/protos/ai/stigmer/agentic/schedule/v1/ap
34
34
  import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
35
35
 
36
36
  import type { Logger } from "../../boot/logger.js";
37
+ import { bumpStatusAudit } from "../../pipeline/steps/defaults.js";
37
38
  import { ResourceNotFoundError } from "../../store/interface.js";
38
39
  import type { Store } from "../../store/interface.js";
39
40
  import type { ScheduleArtifact } from "./artifact.js";
40
41
  import { desiredPaused, note } from "./artifact.js";
41
42
  import { artifactId } from "./names.js";
42
- import { bumpStatusAudit, ensureStatus } from "./status-writes.js";
43
+ import { ensureStatus } from "./status-writes.js";
43
44
 
44
45
  /**
45
46
  * The syncer's answer when no Temporal client exists right now (Go