@fungi.computer/oyster 0.56.2 → 0.57.1

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/agent-computer-source.js +4 -1
  2. package/dist/auth.d.ts +12 -4
  3. package/dist/auth.js +85 -24
  4. package/dist/boot-capability-route.js +5 -1
  5. package/dist/boot-gate.d.ts +5 -0
  6. package/dist/boot-gate.js +12 -2
  7. package/dist/boot-host-script.js +1 -1
  8. package/dist/boot-mount.d.ts +7 -1
  9. package/dist/boot-mount.js +11 -5
  10. package/dist/credential-migration-002.js +6 -1
  11. package/dist/embed-metafiles.js +2 -2
  12. package/dist/embed-scripts.js +2 -2
  13. package/dist/git.d.ts +8 -2
  14. package/dist/git.js +12 -3
  15. package/dist/hello-app-script.js +1 -1
  16. package/dist/host-page-assets.js +1 -1
  17. package/dist/host-page-lazy.d.ts +2 -0
  18. package/dist/host-page-lazy.js +8 -0
  19. package/dist/host-page.d.ts +22 -1
  20. package/dist/host-page.js +91 -12
  21. package/dist/host.d.ts +8 -0
  22. package/dist/host.js +60 -7
  23. package/dist/owner-sessions.d.ts +25 -0
  24. package/dist/owner-sessions.js +50 -0
  25. package/dist/page/boot-host.js +20 -2
  26. package/dist/page/port-preview.d.ts +1 -0
  27. package/dist/page/port-preview.js +33 -0
  28. package/dist/page-script.js +3 -3
  29. package/dist/platform-skills.generated.d.ts +1 -1
  30. package/dist/platform-skills.generated.js +1 -1
  31. package/dist/port-preview-entry.d.ts +84 -0
  32. package/dist/port-preview-entry.js +86 -0
  33. package/dist/standalone/agents.js +1 -0
  34. package/dist/standalone/builds.js +5 -0
  35. package/dist/standalone/candidate-preview.d.ts +25 -0
  36. package/dist/standalone/candidate-preview.js +265 -0
  37. package/dist/standalone/computer.d.ts +2 -3
  38. package/dist/standalone/computer.js +13 -9
  39. package/dist/standalone/preview.d.ts +9 -4
  40. package/dist/standalone/preview.js +35 -44
  41. package/dist/standalone/tenancy.d.ts +1 -1
  42. package/dist/standalone/tenancy.js +9 -1
  43. package/dist/standalone/worker.js +15 -2
  44. package/dist/starter-agent.js +5 -2
  45. package/dist/storage-frame.d.ts +3 -3
  46. package/dist/tenancy/owner-key.d.ts +4 -1
  47. package/dist/tenancy/owner-key.js +27 -2
  48. package/dist/upgrade/old-worker-http.js +2 -6
  49. package/dist/webhook-delivery.d.ts +1 -0
  50. package/dist/webhook-delivery.js +1 -1
  51. package/dist/workers-git.d.ts +19 -0
  52. package/dist/workers-git.js +108 -7
  53. package/dist/workers.d.ts +11 -0
  54. package/dist/workers.js +33 -1
  55. package/docs/api/README.md +14 -3
  56. package/docs/api/auth.md +96 -8
  57. package/docs/api/git.md +13 -7
  58. package/docs/api/host.md +2 -0
  59. package/docs/api/tenancy/owner-key.md +1 -0
  60. package/docs/api/workers-git.md +50 -0
  61. package/docs/api/workers.md +98 -16
  62. package/package.json +18 -18
package/dist/git.d.ts CHANGED
@@ -20,8 +20,14 @@ export declare function lsRefsRequest(): Uint8Array;
20
20
  export declare function parseLsRefs(response: Uint8Array): Awaited<ReturnType<GitBinding["refs"]>>;
21
21
  /** The Standard Webhooks `webhook-signature` value for one delivery. */
22
22
  export declare function signStandardWebhook(secret: string, id: string, timestamp: number, body: string): Promise<string>;
23
- /** Headers for one signed delivery: Standard Webhooks plus `X-Hub-Signature-256`. */
24
- export declare function webhookHeaders(secret: string, id: string, type: string, timestamp: number, body: string): Promise<Record<string, string>>;
23
+ /**
24
+ * Headers for one signed delivery: Standard Webhooks plus `X-Hub-Signature-256`.
25
+ * While a rotated-out secret is still honoured, `previousSecret` adds its
26
+ * signature after the current one, space-separated as Standard Webhooks
27
+ * allows, so a receiver holding either secret verifies the delivery.
28
+ * `X-Hub-Signature-256` uses only the current secret and switches at rotation.
29
+ */
30
+ export declare function webhookHeaders(secret: string, id: string, type: string, timestamp: number, body: string, previousSecret?: string): Promise<Record<string, string>>;
25
31
  export { createGitDoor, gitDoorRoute, smartHttpExchange } from "./git-door.js";
26
32
  export type { GitDoor, GitDoorHost, GitDoorTarget } from "./git-door.js";
27
33
  export { createAdmittedGit, createInstallationGitAdmission, } from "./git-admission.js";
package/dist/git.js CHANGED
@@ -43,14 +43,23 @@ export async function signStandardWebhook(secret, id, timestamp, body) {
43
43
  const signature = await hmac(secretBytes(secret), `${id}.${String(timestamp)}.${body}`);
44
44
  return `v1,${btoa(String.fromCharCode(...signature))}`;
45
45
  }
46
- /** Headers for one signed delivery: Standard Webhooks plus `X-Hub-Signature-256`. */
47
- export async function webhookHeaders(secret, id, type, timestamp, body) {
46
+ /**
47
+ * Headers for one signed delivery: Standard Webhooks plus `X-Hub-Signature-256`.
48
+ * While a rotated-out secret is still honoured, `previousSecret` adds its
49
+ * signature after the current one, space-separated as Standard Webhooks
50
+ * allows, so a receiver holding either secret verifies the delivery.
51
+ * `X-Hub-Signature-256` uses only the current secret and switches at rotation.
52
+ */
53
+ export async function webhookHeaders(secret, id, type, timestamp, body, previousSecret) {
54
+ const signatures = [await signStandardWebhook(secret, id, timestamp, body)];
55
+ if (previousSecret !== undefined)
56
+ signatures.push(await signStandardWebhook(previousSecret, id, timestamp, body));
48
57
  return {
49
58
  "content-type": "application/json",
50
59
  "user-agent": "Oyster-Webhooks/1",
51
60
  "webhook-id": id,
52
61
  "webhook-timestamp": String(timestamp),
53
- "webhook-signature": await signStandardWebhook(secret, id, timestamp, body),
62
+ "webhook-signature": signatures.join(" "),
54
63
  // The headers receivers built for git hosts check.
55
64
  "x-hub-signature-256": `sha256=${hex(await hmac(encoder.encode(secret), body))}`,
56
65
  "x-github-delivery": id,