@fungi.computer/braid 0.0.0-stage → 0.1.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 (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +260 -2
  3. package/dist/cloudflare/graph-engine.d.ts +25 -0
  4. package/dist/cloudflare/graph-engine.js +46 -0
  5. package/dist/cloudflare/graph-program.d.ts +6 -0
  6. package/dist/cloudflare/graph-program.js +550 -0
  7. package/dist/cloudflare/index.d.ts +1 -0
  8. package/dist/cloudflare/index.js +1 -0
  9. package/dist/code-execution.d.ts +16 -0
  10. package/dist/code-execution.js +50 -0
  11. package/dist/code-result.d.ts +11 -0
  12. package/dist/code-result.js +19 -0
  13. package/dist/code-sandbox.d.ts +9 -0
  14. package/dist/code-sandbox.js +13 -0
  15. package/dist/compile.d.ts +43 -0
  16. package/dist/compile.js +248 -0
  17. package/dist/execution.d.ts +194 -0
  18. package/dist/execution.js +130 -0
  19. package/dist/expressions.d.ts +16 -0
  20. package/dist/expressions.js +322 -0
  21. package/dist/git-access.d.ts +59 -0
  22. package/dist/git-access.js +106 -0
  23. package/dist/index.d.ts +9 -0
  24. package/dist/index.js +9 -0
  25. package/dist/ports.d.ts +58 -0
  26. package/dist/ports.js +256 -0
  27. package/dist/review-text.d.ts +15 -0
  28. package/dist/review-text.js +40 -0
  29. package/dist/runtime/arming-authority.d.ts +83 -0
  30. package/dist/runtime/arming-authority.js +90 -0
  31. package/dist/runtime/bindings.d.ts +25 -0
  32. package/dist/runtime/bindings.js +41 -0
  33. package/dist/runtime/capture.d.ts +18 -0
  34. package/dist/runtime/capture.js +99 -0
  35. package/dist/runtime/git-pass-contract.d.ts +63 -0
  36. package/dist/runtime/git-pass-contract.js +36 -0
  37. package/dist/runtime/git-pass-store.d.ts +32 -0
  38. package/dist/runtime/git-pass-store.js +82 -0
  39. package/dist/runtime/git-pass.d.ts +41 -0
  40. package/dist/runtime/git-pass.js +72 -0
  41. package/dist/runtime/graph-contract.d.ts +788 -0
  42. package/dist/runtime/graph-contract.js +122 -0
  43. package/dist/runtime/graph-dispatch.d.ts +31 -0
  44. package/dist/runtime/graph-dispatch.js +111 -0
  45. package/dist/runtime/graph-run-store.d.ts +79 -0
  46. package/dist/runtime/graph-run-store.js +267 -0
  47. package/dist/runtime/graph-start.d.ts +90 -0
  48. package/dist/runtime/graph-start.js +124 -0
  49. package/dist/runtime/index.d.ts +20 -0
  50. package/dist/runtime/index.js +20 -0
  51. package/dist/runtime/ports.d.ts +156 -0
  52. package/dist/runtime/ports.js +1 -0
  53. package/dist/runtime/run-authority.d.ts +60 -0
  54. package/dist/runtime/run-authority.js +145 -0
  55. package/dist/runtime/run-ceiling.d.ts +106 -0
  56. package/dist/runtime/run-ceiling.js +23 -0
  57. package/dist/runtime/run-member.d.ts +3 -0
  58. package/dist/runtime/run-member.js +12 -0
  59. package/dist/runtime/run-owner.d.ts +1650 -0
  60. package/dist/runtime/run-owner.js +513 -0
  61. package/dist/runtime/run-report.d.ts +14 -0
  62. package/dist/runtime/run-report.js +23 -0
  63. package/dist/runtime/schedules.d.ts +39 -0
  64. package/dist/runtime/schedules.js +149 -0
  65. package/dist/runtime/stored-trigger-rows.d.ts +12 -0
  66. package/dist/runtime/stored-trigger-rows.js +17 -0
  67. package/dist/runtime/trigger-owner.d.ts +594 -0
  68. package/dist/runtime/trigger-owner.js +280 -0
  69. package/dist/runtime/trigger-plans.d.ts +774 -0
  70. package/dist/runtime/trigger-plans.js +62 -0
  71. package/dist/runtime/trigger-router.d.ts +34 -0
  72. package/dist/runtime/trigger-router.js +143 -0
  73. package/dist/runtime/trigger-run-reservations.d.ts +28 -0
  74. package/dist/runtime/trigger-run-reservations.js +114 -0
  75. package/dist/schema.d.ts +1183 -0
  76. package/dist/schema.js +239 -0
  77. package/dist/triggers.d.ts +46 -0
  78. package/dist/triggers.js +75 -0
  79. package/dist/validate.d.ts +25 -0
  80. package/dist/validate.js +686 -0
  81. package/dist/workflow-id.d.ts +3 -0
  82. package/dist/workflow-id.js +3 -0
  83. package/package.json +96 -3
@@ -0,0 +1,106 @@
1
+ import * as S from "effect/Schema";
2
+ export declare const nodeGitAccessListSchema: S.$Array<S.Struct<{
3
+ readonly graphId: S.optionalKey<S.String>;
4
+ readonly nodeId: S.String;
5
+ readonly gitAccess: S.declare<{
6
+ repository: {
7
+ kind: "installation";
8
+ installationId: string;
9
+ repository: string;
10
+ } | {
11
+ kind: "team-source";
12
+ repository: string;
13
+ };
14
+ branches: string[];
15
+ } | {
16
+ repository: {
17
+ kind: "installation";
18
+ installationId: string;
19
+ repository: string;
20
+ } | {
21
+ kind: "team-source";
22
+ repository: string;
23
+ };
24
+ access: "read";
25
+ }, {
26
+ repository: {
27
+ kind: "installation";
28
+ installationId: string;
29
+ repository: string;
30
+ } | {
31
+ kind: "team-source";
32
+ repository: string;
33
+ };
34
+ branches: string[];
35
+ } | {
36
+ repository: {
37
+ kind: "installation";
38
+ installationId: string;
39
+ repository: string;
40
+ } | {
41
+ kind: "team-source";
42
+ repository: string;
43
+ };
44
+ access: "read";
45
+ }>;
46
+ }>>;
47
+ export type NodeGitAccessList = typeof nodeGitAccessListSchema.Type;
48
+ /** At most the graph's existing total of 64 nodes. Missing authority never means write. */
49
+ export declare const runCeilingSchema: S.Struct<{
50
+ readonly nodes: S.$Array<S.Struct<{
51
+ readonly graphId: S.optionalKey<S.String>;
52
+ readonly nodeId: S.String;
53
+ readonly level: S.Literals<readonly ["read", "write"]>;
54
+ readonly capabilities: S.$Array<S.Literals<readonly ["agent.list", "agent.manage", "agent.rename", "agent.avatar", "agent.toolPolicy", "agent.read", "agent.send", "computer.list", "computer.readFile", "computer.writeFile", "computer.execute", "llm.generation", "media.generation", "games:servers", "git.repository", "apps.open", "apps.call", "app.storage", "app.events.emit", "team.workbenchHost", "marketplace.browse", "marketplace.purchase", "workflow.run", "workflow.publish", "workflow.arm", "world", "channels.read", "channels.personal.manage"]>>;
55
+ readonly bindings: S.$Array<S.Union<S.Struct<{
56
+ readonly name: S.Literal<"BACKGROUND" | "GIT" | "EVENTS" | "APPS" | "WORKFLOWS" | "APP_STORAGE" | "MEDIA" | "COMPUTER" | "INBOX" | "AGENTS">;
57
+ readonly operations: S.$Array<S.Literals<string[]>>;
58
+ }>[]>>;
59
+ }>>;
60
+ readonly nodeGitAccess: S.$Array<S.Struct<{
61
+ readonly graphId: S.optionalKey<S.String>;
62
+ readonly nodeId: S.String;
63
+ readonly gitAccess: S.declare<{
64
+ repository: {
65
+ kind: "installation";
66
+ installationId: string;
67
+ repository: string;
68
+ } | {
69
+ kind: "team-source";
70
+ repository: string;
71
+ };
72
+ branches: string[];
73
+ } | {
74
+ repository: {
75
+ kind: "installation";
76
+ installationId: string;
77
+ repository: string;
78
+ } | {
79
+ kind: "team-source";
80
+ repository: string;
81
+ };
82
+ access: "read";
83
+ }, {
84
+ repository: {
85
+ kind: "installation";
86
+ installationId: string;
87
+ repository: string;
88
+ } | {
89
+ kind: "team-source";
90
+ repository: string;
91
+ };
92
+ branches: string[];
93
+ } | {
94
+ repository: {
95
+ kind: "installation";
96
+ installationId: string;
97
+ repository: string;
98
+ } | {
99
+ kind: "team-source";
100
+ repository: string;
101
+ };
102
+ access: "read";
103
+ }>;
104
+ }>>;
105
+ }>;
106
+ export type RunCeiling = typeof runCeilingSchema.Type;
@@ -0,0 +1,23 @@
1
+ import * as S from "effect/Schema";
2
+ import { appBackendBindingsSchema, appCapabilityIdSchema, } from "@fungi.computer/puffball/app";
3
+ import { resolvedGitAccessSchema, } from "../git-access.js";
4
+ const id = S.String.pipe(S.check(S.isMinLength(1)), S.check(S.isMaxLength(256)));
5
+ const resolvedGitAccess = S.declare((value) => resolvedGitAccessSchema.safeParse(value).success);
6
+ export const nodeGitAccessListSchema = S.Array(S.Struct({
7
+ graphId: S.optionalKey(id),
8
+ nodeId: id,
9
+ gitAccess: resolvedGitAccess,
10
+ })).pipe(S.check(S.isMaxLength(64)));
11
+ /** Captured host admission for one frozen App node, never a live host object or role. */
12
+ const nodeCeilingSchema = S.Struct({
13
+ graphId: S.optionalKey(id),
14
+ nodeId: id,
15
+ level: S.Literals(["read", "write"]),
16
+ capabilities: S.Array(appCapabilityIdSchema).pipe(S.check(S.isMaxLength(64))),
17
+ bindings: appBackendBindingsSchema,
18
+ });
19
+ /** At most the graph's existing total of 64 nodes. Missing authority never means write. */
20
+ export const runCeilingSchema = S.Struct({
21
+ nodes: S.Array(nodeCeilingSchema).pipe(S.check(S.isMaxLength(64)), S.check(S.makeFilter((nodes) => new Set(nodes.map((node) => JSON.stringify([node.graphId ?? null, node.nodeId]))).size === nodes.length))),
22
+ nodeGitAccess: nodeGitAccessListSchema,
23
+ });
@@ -0,0 +1,3 @@
1
+ import type { WorkflowRunMember } from "./run-authority.js";
2
+ /** The existing strict member readback, shared by run and arming authority. */
3
+ export declare function decodeWorkflowRunMember(value: unknown): WorkflowRunMember | null;
@@ -0,0 +1,12 @@
1
+ import * as S from "effect/Schema";
2
+ import * as Result from "effect/Result";
3
+ const memberSchema = S.Struct({
4
+ membershipVersion: S.Number.pipe(S.check(S.isInt()), S.check(S.isGreaterThanOrEqualTo(0))),
5
+ });
6
+ /** The existing strict member readback, shared by run and arming authority. */
7
+ export function decodeWorkflowRunMember(value) {
8
+ const decoded = S.decodeUnknownResult(memberSchema, {
9
+ onExcessProperty: "error",
10
+ })(value);
11
+ return Result.isSuccess(decoded) ? decoded.success : null;
12
+ }