@powerhousedao/switchboard 6.2.3-dev.8 → 6.2.3-staging.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 (108) hide show
  1. package/.tsbuild/test/attachments/byte-grants.test.d.ts +2 -0
  2. package/.tsbuild/test/attachments/byte-grants.test.d.ts.map +1 -0
  3. package/.tsbuild/test/attachments/byte-routes-read-gate.integration.test.d.ts +2 -0
  4. package/.tsbuild/test/attachments/byte-routes-read-gate.integration.test.d.ts.map +1 -0
  5. package/.tsbuild/test/attachments/url-signer.test.d.ts +2 -0
  6. package/.tsbuild/test/attachments/url-signer.test.d.ts.map +1 -0
  7. package/.tsbuild/test/boot-create-signature-policy.test.d.ts +2 -0
  8. package/.tsbuild/test/boot-create-signature-policy.test.d.ts.map +1 -0
  9. package/.tsbuild/test/boot-mcp-enabled.test.d.ts +2 -0
  10. package/.tsbuild/test/boot-mcp-enabled.test.d.ts.map +1 -0
  11. package/.tsbuild/test/boot-unsupported-stored-documents.test.d.ts +2 -0
  12. package/.tsbuild/test/boot-unsupported-stored-documents.test.d.ts.map +1 -0
  13. package/.tsbuild/test/boot-without-renown.test.d.ts +2 -0
  14. package/.tsbuild/test/boot-without-renown.test.d.ts.map +1 -0
  15. package/.tsbuild/test/boot-without-require-signatures.test.d.ts +2 -0
  16. package/.tsbuild/test/boot-without-require-signatures.test.d.ts.map +1 -0
  17. package/.tsbuild/test/boot-worker-trust-policy.test.d.ts +2 -0
  18. package/.tsbuild/test/boot-worker-trust-policy.test.d.ts.map +1 -0
  19. package/.tsbuild/test/builder-defaults.test.d.ts +2 -0
  20. package/.tsbuild/test/builder-defaults.test.d.ts.map +1 -0
  21. package/.tsbuild/test/create-signature-policy.test.d.ts +2 -0
  22. package/.tsbuild/test/create-signature-policy.test.d.ts.map +1 -0
  23. package/.tsbuild/test/fatal-shutdown.test.d.ts +2 -0
  24. package/.tsbuild/test/fatal-shutdown.test.d.ts.map +1 -0
  25. package/.tsbuild/test/mcp-flag.test.d.ts +2 -0
  26. package/.tsbuild/test/mcp-flag.test.d.ts.map +1 -0
  27. package/.tsbuild/test/renown-trust-policy.test.d.ts +2 -0
  28. package/.tsbuild/test/renown-trust-policy.test.d.ts.map +1 -0
  29. package/.tsbuild/test/unsupported-stored-documents.test.d.ts +2 -0
  30. package/.tsbuild/test/unsupported-stored-documents.test.d.ts.map +1 -0
  31. package/.tsbuild/test/workflow/harness.d.ts +56 -0
  32. package/.tsbuild/test/workflow/harness.d.ts.map +1 -0
  33. package/.tsbuild/test/workflow/oauth.test.d.ts +2 -0
  34. package/.tsbuild/test/workflow/oauth.test.d.ts.map +1 -0
  35. package/.tsbuild/test/workflow/resolvers.test.d.ts +2 -0
  36. package/.tsbuild/test/workflow/resolvers.test.d.ts.map +1 -0
  37. package/.tsbuild/test/workflow/webhook-dedupe.test.d.ts +2 -0
  38. package/.tsbuild/test/workflow/webhook-dedupe.test.d.ts.map +1 -0
  39. package/.tsbuild/test/workflow/webhook-signed.test.d.ts +2 -0
  40. package/.tsbuild/test/workflow/webhook-signed.test.d.ts.map +1 -0
  41. package/.tsbuild/test/workflow/webhook-trigger-test.test.d.ts +2 -0
  42. package/.tsbuild/test/workflow/webhook-trigger-test.test.d.ts.map +1 -0
  43. package/.tsbuild/test/workflow/webhook-unsigned.test.d.ts +2 -0
  44. package/.tsbuild/test/workflow/webhook-unsigned.test.d.ts.map +1 -0
  45. package/.tsbuild/test/workflow-read-gate.test.d.ts +2 -0
  46. package/.tsbuild/test/workflow-read-gate.test.d.ts.map +1 -0
  47. package/.tsbuild/test/workflow-runtime.test.d.ts +2 -0
  48. package/.tsbuild/test/workflow-runtime.test.d.ts.map +1 -0
  49. package/.tsbuild/tsconfig.tsbuildinfo +1 -1
  50. package/.tsbuild/tsdown.config.d.ts.map +1 -1
  51. package/.tsbuild/vitest.config.d.ts.map +1 -1
  52. package/Auth.md +94 -0
  53. package/CHANGELOG.md +302 -0
  54. package/README.md +35 -0
  55. package/dist/index.d.mts +2 -1
  56. package/dist/index.mjs +10 -8
  57. package/dist/index.mjs.map +1 -1
  58. package/dist/install-packages.d.mts +2 -1
  59. package/dist/install-packages.mjs +2 -2
  60. package/dist/install-packages.mjs.map +1 -1
  61. package/dist/migrate.d.mts +2 -1
  62. package/dist/migrate.mjs +4 -3
  63. package/dist/migrate.mjs.map +1 -1
  64. package/dist/{server-CiKkVE6g.mjs → server-sQoWp21G.mjs} +1454 -70
  65. package/dist/server-sQoWp21G.mjs.map +1 -0
  66. package/dist/server.d.mts +103 -29
  67. package/dist/server.d.mts.map +1 -1
  68. package/dist/server.mjs +4 -5
  69. package/dist/{utils-Baw7rThP.mjs → utils-uaBlzyjS.mjs} +15 -9
  70. package/dist/utils-uaBlzyjS.mjs.map +1 -0
  71. package/dist/utils.d.mts +4 -5
  72. package/dist/utils.d.mts.map +1 -1
  73. package/dist/utils.mjs +3 -3
  74. package/package.json +21 -17
  75. package/test/attachments/auth.test.ts +85 -0
  76. package/test/attachments/byte-grants.test.ts +287 -0
  77. package/test/attachments/byte-routes-read-gate.integration.test.ts +314 -0
  78. package/test/attachments/download-target.test.ts +194 -31
  79. package/test/attachments/index.test.ts +34 -3
  80. package/test/attachments/routes-integration.test.ts +59 -4
  81. package/test/attachments/routes.test.ts +165 -23
  82. package/test/attachments/service-config.test.ts +13 -3
  83. package/test/attachments/url-signer.test.ts +105 -0
  84. package/test/boot-create-signature-policy.test.ts +108 -0
  85. package/test/boot-mcp-enabled.test.ts +121 -0
  86. package/test/boot-unsupported-stored-documents.test.ts +210 -0
  87. package/test/boot-without-renown.test.ts +81 -0
  88. package/test/boot-without-require-signatures.test.ts +74 -0
  89. package/test/boot-worker-trust-policy.test.ts +90 -0
  90. package/test/builder-defaults.test.ts +80 -0
  91. package/test/create-signature-policy.test.ts +69 -0
  92. package/test/fatal-shutdown.test.ts +102 -0
  93. package/test/mcp-flag.test.ts +56 -0
  94. package/test/renown-trust-policy.test.ts +315 -0
  95. package/test/unsupported-stored-documents.test.ts +72 -0
  96. package/test/workflow/harness.ts +289 -0
  97. package/test/workflow/oauth.test.ts +214 -0
  98. package/test/workflow/resolvers.test.ts +296 -0
  99. package/test/workflow/webhook-dedupe.test.ts +295 -0
  100. package/test/workflow/webhook-signed.test.ts +509 -0
  101. package/test/workflow/webhook-trigger-test.test.ts +82 -0
  102. package/test/workflow/webhook-unsigned.test.ts +345 -0
  103. package/test/workflow-read-gate.test.ts +145 -0
  104. package/test/workflow-runtime.test.ts +486 -0
  105. package/tsconfig.json +6 -0
  106. package/tsdown.config.ts +3 -1
  107. package/dist/server-CiKkVE6g.mjs.map +0 -1
  108. package/dist/utils-Baw7rThP.mjs.map +0 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=byte-grants.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byte-grants.test.d.ts","sourceRoot":"","sources":["../../../test/attachments/byte-grants.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=byte-routes-read-gate.integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byte-routes-read-gate.integration.test.d.ts","sourceRoot":"","sources":["../../../test/attachments/byte-routes-read-gate.integration.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=url-signer.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-signer.test.d.ts","sourceRoot":"","sources":["../../../test/attachments/url-signer.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=boot-create-signature-policy.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-create-signature-policy.test.d.ts","sourceRoot":"","sources":["../../test/boot-create-signature-policy.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=boot-mcp-enabled.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-mcp-enabled.test.d.ts","sourceRoot":"","sources":["../../test/boot-mcp-enabled.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=boot-unsupported-stored-documents.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-unsupported-stored-documents.test.d.ts","sourceRoot":"","sources":["../../test/boot-unsupported-stored-documents.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=boot-without-renown.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-without-renown.test.d.ts","sourceRoot":"","sources":["../../test/boot-without-renown.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=boot-without-require-signatures.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-without-require-signatures.test.d.ts","sourceRoot":"","sources":["../../test/boot-without-require-signatures.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=boot-worker-trust-policy.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-worker-trust-policy.test.d.ts","sourceRoot":"","sources":["../../test/boot-worker-trust-policy.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=builder-defaults.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder-defaults.test.d.ts","sourceRoot":"","sources":["../../test/builder-defaults.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=create-signature-policy.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-signature-policy.test.d.ts","sourceRoot":"","sources":["../../test/create-signature-policy.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fatal-shutdown.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fatal-shutdown.test.d.ts","sourceRoot":"","sources":["../../test/fatal-shutdown.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mcp-flag.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-flag.test.d.ts","sourceRoot":"","sources":["../../test/mcp-flag.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=renown-trust-policy.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renown-trust-policy.test.d.ts","sourceRoot":"","sources":["../../test/renown-trust-policy.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=unsupported-stored-documents.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsupported-stored-documents.test.d.ts","sourceRoot":"","sources":["../../test/unsupported-stored-documents.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,56 @@
1
+ import { type WorkflowRuntimeService } from "@powerhousedao/reactor-workflow";
2
+ import type { OperationWithContext } from "document-model";
3
+ export declare const WORKFLOW_TYPE = "powerhouse/workflow";
4
+ export declare const PACKAGE_NAME = "@powerhousedao/workflow";
5
+ /** A ref the harness's secret store resolves; anything else rejects. */
6
+ export declare const SECRET_REF = "secret://v1:00112233445566778899aabbccddeeff";
7
+ export declare const SECRET = "s3cret";
8
+ export interface FiredRun {
9
+ workflowId: string;
10
+ payload: unknown;
11
+ kind: string;
12
+ }
13
+ export interface TriggerFields {
14
+ pieceName: string;
15
+ pieceVersion: string;
16
+ triggerName: string;
17
+ }
18
+ export declare const WEBHOOK_TRIGGER: TriggerFields;
19
+ export interface WebhookHost {
20
+ /** Origin the endpoint is served from, e.g. `http://127.0.0.1:53124`. */
21
+ readonly url: string;
22
+ /** Runs the trigger started, in order. Cleared by `arm`. */
23
+ readonly fired: FiredRun[];
24
+ readonly service: WorkflowRuntimeService;
25
+ /** Publishes an ENABLED workflow with `config`; returns its endpoint. */
26
+ arm(config: Record<string, unknown>, options?: {
27
+ trigger?: TriggerFields;
28
+ workflowId?: string;
29
+ }): Promise<{
30
+ token: string;
31
+ url: string;
32
+ }>;
33
+ /** Publishes the same workflow as DISABLED, keeping its endpoint row. */
34
+ disarm(workflowId?: string): Promise<void>;
35
+ /** Deletes the workflow document, as the reactor reports it. */
36
+ remove(workflowId?: string): Promise<void>;
37
+ /** Whether the reactor's webhook store still holds this token. */
38
+ hasToken(token: string): Promise<boolean>;
39
+ /** The policy the service hands the reactor for one endpoint. */
40
+ policyFor(workflowId?: string): Promise<unknown>;
41
+ deliver(token: string, init?: {
42
+ method?: string;
43
+ headers?: Record<string, string>;
44
+ body?: string;
45
+ query?: Record<string, string>;
46
+ }): Promise<Response>;
47
+ stop(): Promise<void>;
48
+ }
49
+ export declare const DEFAULT_WORKFLOW = "wf-integration";
50
+ export declare function workflowOperation(state: Record<string, unknown>, workflowId?: string): OperationWithContext;
51
+ export declare function startWebhookHost(options?: {
52
+ fire?: (run: FiredRun) => unknown;
53
+ reactorClient?: unknown;
54
+ }): Promise<WebhookHost>;
55
+ export declare function waitForRuns(host: WebhookHost, count: number, timeoutMs?: number): Promise<FiredRun[]>;
56
+ //# sourceMappingURL=harness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../../test/workflow/harness.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAKzC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAQ3D,eAAO,MAAM,aAAa,wBAAwB,CAAC;AACnD,eAAO,MAAM,YAAY,4BAA4B,CAAC;AACtD,wEAAwE;AACxE,eAAO,MAAM,UAAU,iDAAiD,CAAC;AACzE,eAAO,MAAM,MAAM,WAAW,CAAC;AAI/B,MAA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AAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAChC,GACA,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAMjD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,UAAU,SAAmB,GAC5B,oBAAoB,CAiBtB;AAID,wBAAsB,gBAAgB,CACpC,OAAO,GAAE;IACP,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC;IAElC,aAAa,CAAC,EAAE,OAAO,CAAC;CACpB,GACL,OAAO,CAAC,WAAW,CAAC,CAsJtB;AAID,wBAAsB,WAAW,CAC/B,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,EACb,SAAS,SAAO,GACf,OAAO,CAAC,QAAQ,EAAE,CAAC,CAWrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=oauth.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.test.d.ts","sourceRoot":"","sources":["../../../test/workflow/oauth.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resolvers.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolvers.test.d.ts","sourceRoot":"","sources":["../../../test/workflow/resolvers.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=webhook-dedupe.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-dedupe.test.d.ts","sourceRoot":"","sources":["../../../test/workflow/webhook-dedupe.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=webhook-signed.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-signed.test.d.ts","sourceRoot":"","sources":["../../../test/workflow/webhook-signed.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=webhook-trigger-test.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-trigger-test.test.d.ts","sourceRoot":"","sources":["../../../test/workflow/webhook-trigger-test.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=webhook-unsigned.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-unsigned.test.d.ts","sourceRoot":"","sources":["../../../test/workflow/webhook-unsigned.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=workflow-read-gate.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-read-gate.test.d.ts","sourceRoot":"","sources":["../../test/workflow-read-gate.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=workflow-runtime.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-runtime.test.d.ts","sourceRoot":"","sources":["../../test/workflow-runtime.test.ts"],"names":[],"mappings":""}