@finalai/final-agent-provider 0.10.1 → 0.11.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 (159) hide show
  1. package/HOSTING.md +334 -245
  2. package/README.md +126 -40
  3. package/WORKSPACE-EGRESS.md +11 -11
  4. package/dist/modules/catalog.d.mts +9 -0
  5. package/dist/modules/catalog.mjs +21 -0
  6. package/dist/modules/catalog.mjs.map +7 -0
  7. package/dist/modules/harnesses/acp-agent.d.mts +4 -0
  8. package/dist/modules/harnesses/acp-agent.mjs +35 -0
  9. package/dist/modules/harnesses/acp-agent.mjs.map +7 -0
  10. package/dist/modules/harnesses/adapters.d.mts +7 -0
  11. package/dist/modules/harnesses/adapters.mjs +74 -0
  12. package/dist/modules/harnesses/adapters.mjs.map +7 -0
  13. package/dist/modules/harnesses/claude-code.d.mts +14 -0
  14. package/dist/modules/harnesses/claude-code.mjs +79 -0
  15. package/dist/modules/harnesses/claude-code.mjs.map +7 -0
  16. package/dist/modules/harnesses/codex.d.mts +12 -0
  17. package/dist/modules/harnesses/codex.mjs +90 -0
  18. package/dist/modules/harnesses/codex.mjs.map +7 -0
  19. package/dist/modules/harnesses/config-fields.d.mts +98 -57
  20. package/dist/modules/harnesses/config-fields.mjs +58 -35
  21. package/dist/modules/harnesses/config-fields.mjs.map +3 -3
  22. package/dist/modules/harnesses/definitions.d.mts +3 -0
  23. package/dist/modules/harnesses/definitions.mjs +21 -0
  24. package/dist/modules/harnesses/definitions.mjs.map +7 -0
  25. package/dist/modules/harnesses/fidelity.d.mts +1 -1
  26. package/dist/modules/harnesses/fidelity.mjs +17 -14
  27. package/dist/modules/harnesses/fidelity.mjs.map +2 -2
  28. package/dist/modules/harnesses/final.d.mts +12 -0
  29. package/dist/modules/harnesses/final.mjs +70 -0
  30. package/dist/modules/harnesses/final.mjs.map +7 -0
  31. package/dist/modules/harnesses/index.d.mts +13 -12
  32. package/dist/modules/harnesses/index.mjs +86 -45
  33. package/dist/modules/harnesses/index.mjs.map +3 -3
  34. package/dist/modules/harnesses/names.d.mts +43 -0
  35. package/dist/modules/harnesses/names.mjs +59 -0
  36. package/dist/modules/harnesses/names.mjs.map +7 -0
  37. package/dist/modules/harnesses/nanocode-claude.d.mts +18 -0
  38. package/dist/modules/harnesses/nanocode-claude.mjs +101 -0
  39. package/dist/modules/harnesses/nanocode-claude.mjs.map +7 -0
  40. package/dist/modules/harnesses/nanocode-codex.d.mts +13 -0
  41. package/dist/modules/harnesses/nanocode-codex.mjs +64 -0
  42. package/dist/modules/harnesses/nanocode-codex.mjs.map +7 -0
  43. package/dist/modules/harnesses/pi.d.mts +12 -0
  44. package/dist/modules/harnesses/pi.mjs +71 -0
  45. package/dist/modules/harnesses/pi.mjs.map +7 -0
  46. package/dist/modules/integrations.d.mts +9 -0
  47. package/dist/modules/integrations.mjs +29 -0
  48. package/dist/modules/integrations.mjs.map +7 -0
  49. package/dist/modules/provider/general.bundle.d.mts +1 -0
  50. package/dist/modules/provider/general.bundle.mjs +5 -0
  51. package/dist/modules/provider/general.bundle.mjs.map +7 -0
  52. package/dist/modules/provider/general.d.mts +11 -0
  53. package/dist/modules/provider/general.mjs +130 -0
  54. package/dist/modules/provider/general.mjs.map +7 -0
  55. package/dist/modules/provider/index.d.mts +3 -0
  56. package/dist/modules/provider/index.mjs +13 -0
  57. package/dist/modules/provider/index.mjs.map +7 -0
  58. package/dist/modules/sandboxes/access.d.mts +34 -0
  59. package/dist/modules/sandboxes/access.mjs +15 -0
  60. package/dist/modules/sandboxes/access.mjs.map +7 -0
  61. package/dist/modules/sandboxes/computer.d.mts +24 -51
  62. package/dist/modules/sandboxes/computer.mjs +523 -888
  63. package/dist/modules/sandboxes/computer.mjs.map +3 -3
  64. package/dist/modules/sandboxes/computers-api.d.mts +3 -2
  65. package/dist/modules/sandboxes/computers-api.mjs +2 -4
  66. package/dist/modules/sandboxes/computers-api.mjs.map +2 -2
  67. package/dist/modules/sandboxes/device-api.d.mts +4 -3
  68. package/dist/modules/sandboxes/device-api.mjs +2 -4
  69. package/dist/modules/sandboxes/device-api.mjs.map +2 -2
  70. package/dist/modules/sandboxes/device.d.mts +6 -6
  71. package/dist/modules/sandboxes/device.mjs +126 -121
  72. package/dist/modules/sandboxes/device.mjs.map +3 -3
  73. package/dist/modules/sandboxes/egress.d.mts +10 -9
  74. package/dist/modules/sandboxes/egress.mjs +73 -56
  75. package/dist/modules/sandboxes/egress.mjs.map +2 -2
  76. package/dist/modules/sandboxes/environment.d.mts +35 -269
  77. package/dist/modules/sandboxes/environment.mjs +27 -104
  78. package/dist/modules/sandboxes/environment.mjs.map +3 -3
  79. package/dist/modules/sandboxes/index.d.mts +9 -69
  80. package/dist/modules/sandboxes/index.mjs +35 -95
  81. package/dist/modules/sandboxes/index.mjs.map +3 -3
  82. package/dist/modules/sandboxes/local.d.mts +28 -0
  83. package/dist/modules/sandboxes/local.mjs +499 -0
  84. package/dist/modules/sandboxes/local.mjs.map +7 -0
  85. package/dist/modules/sandboxes/session.d.mts +0 -3
  86. package/dist/modules/sandboxes/session.mjs +2 -22
  87. package/dist/modules/sandboxes/session.mjs.map +2 -2
  88. package/dist/modules/sandboxes/testing/fake-machine.mjs +0 -28
  89. package/dist/modules/sandboxes/testing/fake-machine.mjs.map +2 -2
  90. package/package.json +76 -104
  91. package/dist/modules/connections.d.mts +0 -11
  92. package/dist/modules/connections.mjs +0 -16
  93. package/dist/modules/connections.mjs.map +0 -7
  94. package/dist/modules/harnesses/acp-describe.d.mts +0 -20
  95. package/dist/modules/harnesses/acp-describe.mjs +0 -110
  96. package/dist/modules/harnesses/acp-describe.mjs.map +0 -7
  97. package/dist/modules/harnesses/local-stdio.d.mts +0 -47
  98. package/dist/modules/harnesses/local-stdio.mjs +0 -41
  99. package/dist/modules/harnesses/local-stdio.mjs.map +0 -7
  100. package/dist/modules/harnesses/remote-acp.d.mts +0 -76
  101. package/dist/modules/harnesses/remote-acp.mjs +0 -83
  102. package/dist/modules/harnesses/remote-acp.mjs.map +0 -7
  103. package/dist/modules/harnesses/remote-claude-code.d.mts +0 -88
  104. package/dist/modules/harnesses/remote-claude-code.mjs +0 -113
  105. package/dist/modules/harnesses/remote-claude-code.mjs.map +0 -7
  106. package/dist/modules/harnesses/remote-client-tls.d.mts +0 -35
  107. package/dist/modules/harnesses/remote-client-tls.mjs +0 -37
  108. package/dist/modules/harnesses/remote-client-tls.mjs.map +0 -7
  109. package/dist/modules/harnesses/remote-codex.d.mts +0 -98
  110. package/dist/modules/harnesses/remote-codex.mjs +0 -128
  111. package/dist/modules/harnesses/remote-codex.mjs.map +0 -7
  112. package/dist/modules/harnesses/remote-pi.d.mts +0 -78
  113. package/dist/modules/harnesses/remote-pi.mjs +0 -104
  114. package/dist/modules/harnesses/remote-pi.mjs.map +0 -7
  115. package/dist/modules/harnesses/remote-url.d.mts +0 -5
  116. package/dist/modules/harnesses/remote-url.mjs +0 -19
  117. package/dist/modules/harnesses/remote-url.mjs.map +0 -7
  118. package/dist/modules/harnesses/serverless-final.d.mts +0 -63
  119. package/dist/modules/harnesses/serverless-final.mjs +0 -88
  120. package/dist/modules/harnesses/serverless-final.mjs.map +0 -7
  121. package/dist/modules/harnesses/serverless-nanocode-claude.d.mts +0 -64
  122. package/dist/modules/harnesses/serverless-nanocode-claude.mjs +0 -105
  123. package/dist/modules/harnesses/serverless-nanocode-claude.mjs.map +0 -7
  124. package/dist/modules/harnesses/serverless-nanocode-codex.d.mts +0 -66
  125. package/dist/modules/harnesses/serverless-nanocode-codex.mjs +0 -113
  126. package/dist/modules/harnesses/serverless-nanocode-codex.mjs.map +0 -7
  127. package/dist/modules/harnesses/serverless-pi.d.mts +0 -64
  128. package/dist/modules/harnesses/serverless-pi.mjs +0 -98
  129. package/dist/modules/harnesses/serverless-pi.mjs.map +0 -7
  130. package/dist/modules/runtime/index.d.mts +0 -7
  131. package/dist/modules/runtime/index.mjs +0 -18
  132. package/dist/modules/runtime/index.mjs.map +0 -7
  133. package/dist/modules/runtime/local-stdio.d.mts +0 -10
  134. package/dist/modules/runtime/local-stdio.mjs +0 -106
  135. package/dist/modules/runtime/local-stdio.mjs.map +0 -7
  136. package/dist/modules/runtime/remote-acp.d.mts +0 -16
  137. package/dist/modules/runtime/remote-acp.mjs +0 -152
  138. package/dist/modules/runtime/remote-acp.mjs.map +0 -7
  139. package/dist/modules/runtime/remote-claude-code.d.mts +0 -5
  140. package/dist/modules/runtime/remote-claude-code.mjs +0 -47
  141. package/dist/modules/runtime/remote-claude-code.mjs.map +0 -7
  142. package/dist/modules/runtime/remote-codex.d.mts +0 -5
  143. package/dist/modules/runtime/remote-codex.mjs +0 -47
  144. package/dist/modules/runtime/remote-codex.mjs.map +0 -7
  145. package/dist/modules/runtime/remote-host.d.mts +0 -127
  146. package/dist/modules/runtime/remote-host.mjs +0 -387
  147. package/dist/modules/runtime/remote-host.mjs.map +0 -7
  148. package/dist/modules/runtime/remote-pi.d.mts +0 -5
  149. package/dist/modules/runtime/remote-pi.mjs +0 -44
  150. package/dist/modules/runtime/remote-pi.mjs.map +0 -7
  151. package/dist/modules/sandboxes/guide.d.mts +0 -35
  152. package/dist/modules/sandboxes/guide.mjs +0 -119
  153. package/dist/modules/sandboxes/guide.mjs.map +0 -7
  154. package/dist/modules/sandboxes/workspace-setup.d.mts +0 -42
  155. package/dist/modules/sandboxes/workspace-setup.mjs +0 -242
  156. package/dist/modules/sandboxes/workspace-setup.mjs.map +0 -7
  157. package/dist/modules/testing/harness.d.mts +0 -9
  158. package/dist/modules/testing/harness.mjs +0 -123
  159. package/dist/modules/testing/harness.mjs.map +0 -7
@@ -1,284 +1,50 @@
1
- import { NetworkPolicy, SandboxAccess, SandboxAttach } from '@finalai/agent-provider';
2
1
  import * as z from 'zod';
3
- export declare const COMPUTER_SANDBOX_SPECIFIER = "@finalai/final-agent-provider/sandboxes/computer";
4
- export declare const DEVICE_SANDBOX_SPECIFIER = "@finalai/final-agent-provider/sandboxes/device";
2
+ export declare const COMPUTER_PROVIDER = "computer";
3
+ export declare const DEVICE_PROVIDER = "device";
5
4
  export declare const DEVICE_API_ACTING_USER_HEADER = "Final-Acting-User-Id";
6
- export declare enum ComputerWorkspacePolicy {
7
- Session = "session",
8
- Conversation = "conversation",
9
- Ephemeral = "ephemeral"
10
- }
11
- export declare enum TemplateWhenMissing {
12
- Skip = "skip",
13
- Fail = "fail"
14
- }
15
- export declare const repositoryAliasSchema: z.ZodString;
16
- export declare const computerRepositorySchema: z.ZodObject<{
17
- alias: z.ZodString;
18
- repository: z.ZodString;
19
- ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
20
- }, z.core.$strip>;
21
- export declare const computerNetworkPolicySchema: z.ZodUnion<readonly [z.ZodEnum<typeof NetworkPolicy>, z.ZodObject<{
22
- mode: z.ZodEnum<typeof NetworkPolicy>;
23
- allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
24
- }, z.core.$strip>]>;
25
- export declare const computerParametersSchema: z.ZodObject<{
26
- repositories: z.ZodOptional<z.ZodArray<z.ZodObject<{
27
- alias: z.ZodString;
28
- repository: z.ZodString;
29
- ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
30
- }, z.core.$strip>>>;
31
- variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
32
- workspace: z.ZodOptional<z.ZodEnum<typeof ComputerWorkspacePolicy>>;
33
- networkPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof NetworkPolicy>, z.ZodObject<{
34
- mode: z.ZodEnum<typeof NetworkPolicy>;
35
- allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
36
- }, z.core.$strip>]>>;
37
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
38
- }, z.core.$strip>;
39
- export declare const computerTemplateSchema: z.ZodObject<{
40
- version: z.ZodDefault<z.ZodLiteral<2>>;
41
- build: z.ZodPrefault<z.ZodObject<{
42
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
43
- steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
44
- run: z.ZodString;
45
- cwd: z.ZodDefault<z.ZodString>;
46
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
47
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
48
- required: z.ZodDefault<z.ZodBoolean>;
49
- }, z.core.$strip>>>;
50
- verify: z.ZodDefault<z.ZodArray<z.ZodObject<{
51
- run: z.ZodString;
52
- cwd: z.ZodDefault<z.ZodString>;
53
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
54
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
55
- required: z.ZodDefault<z.ZodBoolean>;
56
- }, z.core.$strip>>>;
57
- }, z.core.$strip>>;
58
- workspace: z.ZodPrefault<z.ZodObject<{
59
- setup: z.ZodDefault<z.ZodArray<z.ZodObject<{
60
- run: z.ZodString;
61
- cwd: z.ZodDefault<z.ZodString>;
62
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
63
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
64
- required: z.ZodDefault<z.ZodBoolean>;
65
- }, z.core.$strip>>>;
66
- }, z.core.$strip>>;
67
- services: z.ZodDefault<z.ZodArray<z.ZodObject<{
5
+ export declare const DEFAULT_COMPUTER_IMAGE = "lineage:sandbox";
6
+ export declare const computerBuildSchema: z.ZodObject<{
7
+ steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
68
8
  run: z.ZodString;
69
- cwd: z.ZodDefault<z.ZodString>;
70
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
71
9
  timeoutMinutes: z.ZodDefault<z.ZodNumber>;
72
- required: z.ZodDefault<z.ZodBoolean>;
73
- name: z.ZodString;
74
- ready: z.ZodDefault<z.ZodNullable<z.ZodObject<{
75
- url: z.ZodString;
76
- timeoutSeconds: z.ZodDefault<z.ZodNumber>;
77
- }, z.core.$strip>>>;
78
- }, z.core.$strip>>>;
79
- commands: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
10
+ }, z.core.$strict>>>;
11
+ verify: z.ZodDefault<z.ZodArray<z.ZodObject<{
80
12
  run: z.ZodString;
81
- description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
82
- cwd: z.ZodDefault<z.ZodString>;
83
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
84
13
  timeoutMinutes: z.ZodDefault<z.ZodNumber>;
85
- }, z.core.$strip>>>;
86
- }, z.core.$strip>;
87
- export declare const computerInlineGuideSchema: z.ZodObject<{
88
- image: z.ZodString;
89
- template: z.ZodPrefault<z.ZodObject<{
90
- version: z.ZodDefault<z.ZodLiteral<2>>;
91
- build: z.ZodPrefault<z.ZodObject<{
92
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
93
- steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
94
- run: z.ZodString;
95
- cwd: z.ZodDefault<z.ZodString>;
96
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
97
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
98
- required: z.ZodDefault<z.ZodBoolean>;
99
- }, z.core.$strip>>>;
100
- verify: z.ZodDefault<z.ZodArray<z.ZodObject<{
101
- run: z.ZodString;
102
- cwd: z.ZodDefault<z.ZodString>;
103
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
104
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
105
- required: z.ZodDefault<z.ZodBoolean>;
106
- }, z.core.$strip>>>;
107
- }, z.core.$strip>>;
108
- workspace: z.ZodPrefault<z.ZodObject<{
109
- setup: z.ZodDefault<z.ZodArray<z.ZodObject<{
110
- run: z.ZodString;
111
- cwd: z.ZodDefault<z.ZodString>;
112
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
113
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
114
- required: z.ZodDefault<z.ZodBoolean>;
115
- }, z.core.$strip>>>;
116
- }, z.core.$strip>>;
117
- services: z.ZodDefault<z.ZodArray<z.ZodObject<{
14
+ }, z.core.$strict>>>;
15
+ }, z.core.$strict>;
16
+ export declare const computerMachineSchema: z.ZodObject<{
17
+ vcpu: z.ZodOptional<z.ZodNumber>;
18
+ memoryMb: z.ZodOptional<z.ZodNumber>;
19
+ diskGb: z.ZodOptional<z.ZodNumber>;
20
+ }, z.core.$strict>;
21
+ export declare const computerEnvironmentSchema: z.ZodObject<{
22
+ image: z.ZodOptional<z.ZodString>;
23
+ build: z.ZodOptional<z.ZodObject<{
24
+ steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
118
25
  run: z.ZodString;
119
- cwd: z.ZodDefault<z.ZodString>;
120
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
121
26
  timeoutMinutes: z.ZodDefault<z.ZodNumber>;
122
- required: z.ZodDefault<z.ZodBoolean>;
123
- name: z.ZodString;
124
- ready: z.ZodDefault<z.ZodNullable<z.ZodObject<{
125
- url: z.ZodString;
126
- timeoutSeconds: z.ZodDefault<z.ZodNumber>;
127
- }, z.core.$strip>>>;
128
- }, z.core.$strip>>>;
129
- commands: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
27
+ }, z.core.$strict>>>;
28
+ verify: z.ZodDefault<z.ZodArray<z.ZodObject<{
130
29
  run: z.ZodString;
131
- description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
132
- cwd: z.ZodDefault<z.ZodString>;
133
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
134
30
  timeoutMinutes: z.ZodDefault<z.ZodNumber>;
135
- }, z.core.$strip>>>;
136
- }, z.core.$strip>>;
137
- repositories: z.ZodDefault<z.ZodArray<z.ZodObject<{
138
- alias: z.ZodString;
139
- repository: z.ZodString;
140
- ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
141
- }, z.core.$strip>>>;
142
- variables: z.ZodDefault<z.ZodArray<z.ZodString>>;
143
- }, z.core.$strip>;
144
- export declare const computerEnvironmentSchema: z.ZodUnion<readonly [z.ZodObject<{
145
- guide: z.ZodObject<{
146
- ref: z.ZodString;
147
- version: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"latest">, z.ZodNumber]>>;
148
- }, z.core.$strict>;
149
- parameters: z.ZodPrefault<z.ZodObject<{
150
- repositories: z.ZodOptional<z.ZodArray<z.ZodObject<{
151
- alias: z.ZodString;
152
- repository: z.ZodString;
153
- ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
154
- }, z.core.$strip>>>;
155
- variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
156
- workspace: z.ZodOptional<z.ZodEnum<typeof ComputerWorkspacePolicy>>;
157
- networkPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof NetworkPolicy>, z.ZodObject<{
158
- mode: z.ZodEnum<typeof NetworkPolicy>;
159
- allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
160
- }, z.core.$strip>]>>;
161
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
162
- }, z.core.$strip>>;
163
- }, z.core.$strict>, z.ZodObject<{
164
- inline: z.ZodObject<{
165
- image: z.ZodString;
166
- template: z.ZodPrefault<z.ZodObject<{
167
- version: z.ZodDefault<z.ZodLiteral<2>>;
168
- build: z.ZodPrefault<z.ZodObject<{
169
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
170
- steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
171
- run: z.ZodString;
172
- cwd: z.ZodDefault<z.ZodString>;
173
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
174
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
175
- required: z.ZodDefault<z.ZodBoolean>;
176
- }, z.core.$strip>>>;
177
- verify: z.ZodDefault<z.ZodArray<z.ZodObject<{
178
- run: z.ZodString;
179
- cwd: z.ZodDefault<z.ZodString>;
180
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
181
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
182
- required: z.ZodDefault<z.ZodBoolean>;
183
- }, z.core.$strip>>>;
184
- }, z.core.$strip>>;
185
- workspace: z.ZodPrefault<z.ZodObject<{
186
- setup: z.ZodDefault<z.ZodArray<z.ZodObject<{
187
- run: z.ZodString;
188
- cwd: z.ZodDefault<z.ZodString>;
189
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
190
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
191
- required: z.ZodDefault<z.ZodBoolean>;
192
- }, z.core.$strip>>>;
193
- }, z.core.$strip>>;
194
- services: z.ZodDefault<z.ZodArray<z.ZodObject<{
195
- run: z.ZodString;
196
- cwd: z.ZodDefault<z.ZodString>;
197
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
198
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
199
- required: z.ZodDefault<z.ZodBoolean>;
200
- name: z.ZodString;
201
- ready: z.ZodDefault<z.ZodNullable<z.ZodObject<{
202
- url: z.ZodString;
203
- timeoutSeconds: z.ZodDefault<z.ZodNumber>;
204
- }, z.core.$strip>>>;
205
- }, z.core.$strip>>>;
206
- commands: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
207
- run: z.ZodString;
208
- description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
209
- cwd: z.ZodDefault<z.ZodString>;
210
- whenMissing: z.ZodDefault<z.ZodNullable<z.ZodEnum<typeof TemplateWhenMissing>>>;
211
- timeoutMinutes: z.ZodDefault<z.ZodNumber>;
212
- }, z.core.$strip>>>;
213
- }, z.core.$strip>>;
214
- repositories: z.ZodDefault<z.ZodArray<z.ZodObject<{
215
- alias: z.ZodString;
216
- repository: z.ZodString;
217
- ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
218
- }, z.core.$strip>>>;
219
- variables: z.ZodDefault<z.ZodArray<z.ZodString>>;
220
- }, z.core.$strip>;
221
- parameters: z.ZodPrefault<z.ZodObject<{
222
- repositories: z.ZodOptional<z.ZodArray<z.ZodObject<{
223
- alias: z.ZodString;
224
- repository: z.ZodString;
225
- ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
226
- }, z.core.$strip>>>;
227
- variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
228
- workspace: z.ZodOptional<z.ZodEnum<typeof ComputerWorkspacePolicy>>;
229
- networkPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof NetworkPolicy>, z.ZodObject<{
230
- mode: z.ZodEnum<typeof NetworkPolicy>;
231
- allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
232
- }, z.core.$strip>]>>;
233
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
234
- }, z.core.$strip>>;
235
- }, z.core.$strict>, z.ZodObject<{
236
- image: z.ZodString;
237
- parameters: z.ZodPrefault<z.ZodObject<{
238
- repositories: z.ZodOptional<z.ZodArray<z.ZodObject<{
239
- alias: z.ZodString;
240
- repository: z.ZodString;
241
- ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
242
- }, z.core.$strip>>>;
243
- variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
244
- workspace: z.ZodOptional<z.ZodEnum<typeof ComputerWorkspacePolicy>>;
245
- networkPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof NetworkPolicy>, z.ZodObject<{
246
- mode: z.ZodEnum<typeof NetworkPolicy>;
247
- allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
248
- }, z.core.$strip>]>>;
249
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
250
- }, z.core.$strip>>;
251
- }, z.core.$strict>, z.ZodObject<{
252
- parameters: z.ZodPrefault<z.ZodObject<{
253
- repositories: z.ZodOptional<z.ZodArray<z.ZodObject<{
254
- alias: z.ZodString;
255
- repository: z.ZodString;
256
- ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
257
- }, z.core.$strip>>>;
258
- variables: z.ZodOptional<z.ZodArray<z.ZodString>>;
259
- workspace: z.ZodOptional<z.ZodEnum<typeof ComputerWorkspacePolicy>>;
260
- networkPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof NetworkPolicy>, z.ZodObject<{
261
- mode: z.ZodEnum<typeof NetworkPolicy>;
262
- allow: z.ZodDefault<z.ZodArray<z.ZodString>>;
263
- }, z.core.$strip>]>>;
264
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
265
- }, z.core.$strip>>;
266
- }, z.core.$strict>]>;
267
- export declare const computerOpenOptionsSchema: z.ZodObject<{
268
- access: z.ZodDefault<z.ZodEnum<typeof SandboxAccess>>;
269
- attach: z.ZodOptional<z.ZodEnum<typeof SandboxAttach>>;
31
+ }, z.core.$strict>>>;
32
+ }, z.core.$strict>>;
33
+ machine: z.ZodOptional<z.ZodObject<{
34
+ vcpu: z.ZodOptional<z.ZodNumber>;
35
+ memoryMb: z.ZodOptional<z.ZodNumber>;
36
+ diskGb: z.ZodOptional<z.ZodNumber>;
37
+ }, z.core.$strict>>;
38
+ region: z.ZodOptional<z.ZodString>;
39
+ idleTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
270
40
  }, z.core.$strict>;
271
41
  export declare const deviceEnvironmentSchema: z.ZodUnion<readonly [z.ZodObject<{
272
42
  deviceId: z.ZodString;
273
43
  }, z.core.$strict>, z.ZodObject<{
274
44
  pairing: z.ZodString;
275
- }, z.core.$strict>, z.ZodObject<{}, z.core.$strict>]>;
276
- export type ComputerRepositoryIface = z.infer<typeof computerRepositorySchema>;
277
- export type ComputerParametersIface = z.infer<typeof computerParametersSchema>;
278
- export type ComputerTemplateIface = z.infer<typeof computerTemplateSchema>;
279
- export type ComputerTemplateInputIface = z.input<typeof computerTemplateSchema>;
280
- export type ComputerInlineGuideIface = z.infer<typeof computerInlineGuideSchema>;
281
- export type ComputerEnvironmentOptions = z.infer<typeof computerEnvironmentSchema>;
282
- export type ComputerOpenOptionsIface = z.infer<typeof computerOpenOptionsSchema>;
283
- export type ComputerNetworkPolicyOption = z.infer<typeof computerNetworkPolicySchema>;
284
- export type DeviceEnvironmentOptions = z.infer<typeof deviceEnvironmentSchema>;
45
+ }, z.core.$strict>]>;
46
+ export type ComputerBuildIface = z.output<typeof computerBuildSchema>;
47
+ export type ComputerEnvironmentIface = z.output<typeof computerEnvironmentSchema>;
48
+ export type ComputerEnvironmentInputIface = z.input<typeof computerEnvironmentSchema>;
49
+ export type DeviceEnvironmentIface = z.output<typeof deviceEnvironmentSchema>;
50
+ export type DeviceEnvironmentInputIface = z.input<typeof deviceEnvironmentSchema>;
@@ -1,121 +1,44 @@
1
- import { NetworkPolicy, SandboxAccess, SandboxAttach } from "@finalai/agent-provider";
2
1
  import * as z from "zod";
3
- const COMPUTER_SANDBOX_SPECIFIER = "@finalai/final-agent-provider/sandboxes/computer";
4
- const DEVICE_SANDBOX_SPECIFIER = "@finalai/final-agent-provider/sandboxes/device";
2
+ const COMPUTER_PROVIDER = "computer";
3
+ const DEVICE_PROVIDER = "device";
5
4
  const DEVICE_API_ACTING_USER_HEADER = "Final-Acting-User-Id";
6
- var ComputerWorkspacePolicy = /* @__PURE__ */ ((ComputerWorkspacePolicy2) => {
7
- ComputerWorkspacePolicy2["Session"] = "session";
8
- ComputerWorkspacePolicy2["Conversation"] = "conversation";
9
- ComputerWorkspacePolicy2["Ephemeral"] = "ephemeral";
10
- return ComputerWorkspacePolicy2;
11
- })(ComputerWorkspacePolicy || {});
12
- var TemplateWhenMissing = /* @__PURE__ */ ((TemplateWhenMissing2) => {
13
- TemplateWhenMissing2["Skip"] = "skip";
14
- TemplateWhenMissing2["Fail"] = "fail";
15
- return TemplateWhenMissing2;
16
- })(TemplateWhenMissing || {});
17
- const repositoryAliasSchema = z.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/).max(120);
18
- const variableNameSchema = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(256);
19
- const computerRepositorySchema = z.object({
20
- alias: repositoryAliasSchema,
21
- // A repository the organization can reach, named as the host's repository
22
- // resolver accepts it (a GitHub 'final/app', a Final repository id), or a git URL.
23
- repository: z.string().min(1),
24
- ref: z.string().min(1).nullable().default(null)
25
- });
26
- const computerNetworkPolicySchema = z.union([
27
- z.nativeEnum(NetworkPolicy),
28
- z.object({ mode: z.nativeEnum(NetworkPolicy), allow: z.array(z.string()).default([]) })
29
- ]);
30
- const computerParametersSchema = z.object({
31
- repositories: z.array(computerRepositorySchema).optional(),
32
- // Names of variables (secrets); values are injected at start, never stored here.
33
- variables: z.array(variableNameSchema).optional(),
34
- workspace: z.nativeEnum(ComputerWorkspacePolicy).optional(),
35
- networkPolicy: computerNetworkPolicySchema.optional(),
36
- // Plain, non-secret environment values.
37
- env: z.record(variableNameSchema, z.string().max(16 * 1024)).optional()
38
- });
39
- const templateStepSchema = z.object({
5
+ const DEFAULT_COMPUTER_IMAGE = "lineage:sandbox";
6
+ const buildStepSchema = z.strictObject({
40
7
  run: z.string().min(1).max(10 * 1024),
41
- cwd: z.string().min(1).default("."),
42
- whenMissing: z.nativeEnum(TemplateWhenMissing).nullable().default(null),
43
- timeoutMinutes: z.number().int().min(1).max(120).default(20),
44
- required: z.boolean().default(true)
45
- });
46
- const templateServiceSchema = templateStepSchema.extend({
47
- name: z.string().regex(/^[a-z0-9][a-z0-9-]*$/).max(64),
48
- ready: z.object({ url: z.string().url(), timeoutSeconds: z.number().int().min(1).max(600).default(90) }).nullable().default(null)
49
- });
50
- const templateCommandSchema = z.object({
51
- run: z.string().min(1).max(10 * 1024),
52
- description: z.string().min(1).max(500).nullable().default(null),
53
- cwd: z.string().min(1).default("."),
54
- whenMissing: z.nativeEnum(TemplateWhenMissing).nullable().default(null),
55
8
  timeoutMinutes: z.number().int().min(1).max(120).default(20)
56
9
  });
57
- const computerTemplateSchema = z.object({
58
- version: z.literal(2).default(2),
59
- build: z.object({
60
- timeoutMinutes: z.number().int().min(1).max(120).default(30),
61
- steps: z.array(templateStepSchema).max(30).default([]),
62
- verify: z.array(templateStepSchema).max(30).default([])
63
- }).prefault({}),
64
- workspace: z.object({ setup: z.array(templateStepSchema).max(30).default([]) }).prefault({}),
65
- services: z.array(templateServiceSchema).max(20).default([]),
66
- commands: z.record(
67
- z.string().regex(/^[a-z0-9][a-z0-9-]*$/).max(64),
68
- templateCommandSchema
69
- ).default({})
10
+ const computerBuildSchema = z.strictObject({
11
+ steps: z.array(buildStepSchema).max(30).default([]),
12
+ // Checks that the built base works; a failing one fails the build.
13
+ verify: z.array(buildStepSchema).max(30).default([])
70
14
  });
71
- const computerInlineGuideSchema = z.object({
72
- // An OCI image reference, or `lineage:<name>` for a platform image lineage.
73
- image: z.string().min(1),
74
- template: computerTemplateSchema.prefault({}),
75
- repositories: z.array(computerRepositorySchema).default([]),
76
- variables: z.array(variableNameSchema).default([])
15
+ const computerMachineSchema = z.strictObject({
16
+ vcpu: z.number().int().min(1).max(64).optional(),
17
+ memoryMb: z.number().int().min(512).max(262144).optional(),
18
+ diskGb: z.number().int().min(1).max(2048).optional()
77
19
  });
78
- const computerEnvironmentSchema = z.union([
79
- z.strictObject({
80
- guide: z.strictObject({
81
- ref: z.string().min(1),
82
- version: z.union([z.literal("latest"), z.number().int().min(1)]).default("latest")
83
- }),
84
- parameters: computerParametersSchema.prefault({})
85
- }),
86
- z.strictObject({
87
- inline: computerInlineGuideSchema,
88
- parameters: computerParametersSchema.prefault({})
89
- }),
90
- z.strictObject({ image: z.string().min(1), parameters: computerParametersSchema.prefault({}) }),
91
- // The organization's default guide.
92
- z.strictObject({ parameters: computerParametersSchema.prefault({}) })
93
- ]);
94
- const computerOpenOptionsSchema = z.strictObject({
95
- access: z.nativeEnum(SandboxAccess).default(SandboxAccess.Write),
96
- attach: z.nativeEnum(SandboxAttach).optional()
20
+ const computerEnvironmentSchema = z.strictObject({
21
+ // An OCI image reference, or `lineage:<name>` for a platform image lineage.
22
+ image: z.string().min(1).max(512).optional(),
23
+ build: computerBuildSchema.optional(),
24
+ machine: computerMachineSchema.optional(),
25
+ region: z.string().min(1).max(64).optional(),
26
+ // Idle time before the computer pauses (its disk and processes kept).
27
+ idleTimeoutSeconds: z.number().int().min(60).max(7 * 24 * 60 * 60).optional()
97
28
  });
98
29
  const deviceEnvironmentSchema = z.union([
99
30
  z.strictObject({ deviceId: z.string().uuid() }),
100
31
  // A pairing code the owner approved; resolved to a device at prepare.
101
- z.strictObject({ pairing: z.string().min(1) }),
102
- // The only Device of the user the session acts for.
103
- z.strictObject({})
32
+ z.strictObject({ pairing: z.string().min(1) })
104
33
  ]);
105
34
  export {
106
- COMPUTER_SANDBOX_SPECIFIER,
107
- ComputerWorkspacePolicy,
35
+ COMPUTER_PROVIDER,
36
+ DEFAULT_COMPUTER_IMAGE,
108
37
  DEVICE_API_ACTING_USER_HEADER,
109
- DEVICE_SANDBOX_SPECIFIER,
110
- TemplateWhenMissing,
38
+ DEVICE_PROVIDER,
39
+ computerBuildSchema,
111
40
  computerEnvironmentSchema,
112
- computerInlineGuideSchema,
113
- computerNetworkPolicySchema,
114
- computerOpenOptionsSchema,
115
- computerParametersSchema,
116
- computerRepositorySchema,
117
- computerTemplateSchema,
118
- deviceEnvironmentSchema,
119
- repositoryAliasSchema
41
+ computerMachineSchema,
42
+ deviceEnvironmentSchema
120
43
  };
121
44
  //# sourceMappingURL=environment.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/sandboxes/environment.ts"],
4
- "sourcesContent": ["import { NetworkPolicy, SandboxAccess, SandboxAttach } from '@finalai/agent-provider';\nimport * as z from 'zod';\n\n// Environment options of the `computer` and `device` sandboxes: the JSON a manifest's\n// sandbox binding carries as `environment`, validated by the provider. Pure (no\n// I/O) so authored definitions can import it.\n\nexport const COMPUTER_SANDBOX_SPECIFIER = '@finalai/final-agent-provider/sandboxes/computer';\nexport const DEVICE_SANDBOX_SPECIFIER = '@finalai/final-agent-provider/sandboxes/device';\n\n// The `computer` and `device` sandboxes read no secrets: they authenticate with\n// the context's `credentials.computersAccess` and `credentials.deviceAccess`.\nexport const DEVICE_API_ACTING_USER_HEADER = 'Final-Acting-User-Id';\n\nexport enum ComputerWorkspacePolicy {\n // The disk lives as long as the agent's session.\n Session = 'session',\n // The disk belongs to the conversation: every agent in it shares it and a session reset keeps it.\n Conversation = 'conversation',\n // The disk is discarded when the sandbox is released.\n Ephemeral = 'ephemeral',\n}\n\nexport enum TemplateWhenMissing {\n Skip = 'skip',\n Fail = 'fail',\n}\n\n// Repository aliases mount at /workspaces/<alias>.\nexport const repositoryAliasSchema = z\n .string()\n .regex(/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/)\n .max(120);\nconst variableNameSchema = z\n .string()\n .regex(/^[A-Za-z_][A-Za-z0-9_]*$/)\n .max(256);\n\nexport const computerRepositorySchema = z.object({\n alias: repositoryAliasSchema,\n // A repository the organization can reach, named as the host's repository\n // resolver accepts it (a GitHub 'final/app', a Final repository id), or a git URL.\n repository: z.string().min(1),\n ref: z.string().min(1).nullable().default(null),\n});\n\nexport const computerNetworkPolicySchema = z.union([\n z.nativeEnum(NetworkPolicy),\n z.object({ mode: z.nativeEnum(NetworkPolicy), allow: z.array(z.string()).default([]) }),\n]);\n\n// Start-time parameters; everything optional so a guide reference can override any subset.\nexport const computerParametersSchema = z.object({\n repositories: z.array(computerRepositorySchema).optional(),\n // Names of variables (secrets); values are injected at start, never stored here.\n variables: z.array(variableNameSchema).optional(),\n workspace: z.nativeEnum(ComputerWorkspacePolicy).optional(),\n networkPolicy: computerNetworkPolicySchema.optional(),\n // Plain, non-secret environment values.\n env: z.record(variableNameSchema, z.string().max(16 * 1024)).optional(),\n});\n\n// The subset of `.final/sandbox-template.yaml` v2 the computer sandbox reads.\nconst templateStepSchema = z.object({\n run: z\n .string()\n .min(1)\n .max(10 * 1024),\n cwd: z.string().min(1).default('.'),\n whenMissing: z.nativeEnum(TemplateWhenMissing).nullable().default(null),\n timeoutMinutes: z.number().int().min(1).max(120).default(20),\n required: z.boolean().default(true),\n});\nconst templateServiceSchema = templateStepSchema.extend({\n name: z\n .string()\n .regex(/^[a-z0-9][a-z0-9-]*$/)\n .max(64),\n ready: z\n .object({ url: z.string().url(), timeoutSeconds: z.number().int().min(1).max(600).default(90) })\n .nullable()\n .default(null),\n});\nconst templateCommandSchema = z.object({\n run: z\n .string()\n .min(1)\n .max(10 * 1024),\n description: z.string().min(1).max(500).nullable().default(null),\n cwd: z.string().min(1).default('.'),\n whenMissing: z.nativeEnum(TemplateWhenMissing).nullable().default(null),\n timeoutMinutes: z.number().int().min(1).max(120).default(20),\n});\n\nexport const computerTemplateSchema = z.object({\n version: z.literal(2).default(2),\n build: z\n .object({\n timeoutMinutes: z.number().int().min(1).max(120).default(30),\n steps: z.array(templateStepSchema).max(30).default([]),\n verify: z.array(templateStepSchema).max(30).default([]),\n })\n .prefault({}),\n workspace: z.object({ setup: z.array(templateStepSchema).max(30).default([]) }).prefault({}),\n services: z.array(templateServiceSchema).max(20).default([]),\n commands: z\n .record(\n z\n .string()\n .regex(/^[a-z0-9][a-z0-9-]*$/)\n .max(64),\n templateCommandSchema,\n )\n .default({}),\n});\n\nexport const computerInlineGuideSchema = z.object({\n // An OCI image reference, or `lineage:<name>` for a platform image lineage.\n image: z.string().min(1),\n template: computerTemplateSchema.prefault({}),\n repositories: z.array(computerRepositorySchema).default([]),\n variables: z.array(variableNameSchema).default([]),\n});\n\nexport const computerEnvironmentSchema = z.union([\n z.strictObject({\n guide: z.strictObject({\n ref: z.string().min(1),\n version: z.union([z.literal('latest'), z.number().int().min(1)]).default('latest'),\n }),\n parameters: computerParametersSchema.prefault({}),\n }),\n z.strictObject({\n inline: computerInlineGuideSchema,\n parameters: computerParametersSchema.prefault({}),\n }),\n z.strictObject({ image: z.string().min(1), parameters: computerParametersSchema.prefault({}) }),\n // The organization's default guide.\n z.strictObject({ parameters: computerParametersSchema.prefault({}) }),\n]);\n\n// `.open({ access, attach })` of the `computer` and `device` sandboxes. `attach`\n// is the host's (lazy unless `on-prompt`); the provider reads only `access`.\nexport const computerOpenOptionsSchema = z.strictObject({\n access: z.nativeEnum(SandboxAccess).default(SandboxAccess.Write),\n attach: z.nativeEnum(SandboxAttach).optional(),\n});\n\nexport const deviceEnvironmentSchema = z.union([\n z.strictObject({ deviceId: z.string().uuid() }),\n // A pairing code the owner approved; resolved to a device at prepare.\n z.strictObject({ pairing: z.string().min(1) }),\n // The only Device of the user the session acts for.\n z.strictObject({}),\n]);\n\nexport type ComputerRepositoryIface = z.infer<typeof computerRepositorySchema>;\nexport type ComputerParametersIface = z.infer<typeof computerParametersSchema>;\nexport type ComputerTemplateIface = z.infer<typeof computerTemplateSchema>;\nexport type ComputerTemplateInputIface = z.input<typeof computerTemplateSchema>;\nexport type ComputerInlineGuideIface = z.infer<typeof computerInlineGuideSchema>;\nexport type ComputerEnvironmentOptions = z.infer<typeof computerEnvironmentSchema>;\nexport type ComputerOpenOptionsIface = z.infer<typeof computerOpenOptionsSchema>;\nexport type ComputerNetworkPolicyOption = z.infer<typeof computerNetworkPolicySchema>;\nexport type DeviceEnvironmentOptions = z.infer<typeof deviceEnvironmentSchema>;\n"],
5
- "mappings": "AAAA,SAAS,eAAe,eAAe,qBAAqB;AAC5D,YAAY,OAAO;AAMZ,MAAM,6BAA6B;AACnC,MAAM,2BAA2B;AAIjC,MAAM,gCAAgC;AAEtC,IAAK,0BAAL,kBAAKA,6BAAL;AAEL,EAAAA,yBAAA,aAAU;AAEV,EAAAA,yBAAA,kBAAe;AAEf,EAAAA,yBAAA,eAAY;AANF,SAAAA;AAAA,GAAA;AASL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,U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AAG,YAAY,yBAAyB,SAAS,CAAC,CAAC,EAAE,CAAC;AAAA;AAAA,EAE9F,EAAE,aAAa,EAAE,YAAY,yBAAyB,SAAS,CAAC,CAAC,EAAE,CAAC;AACtE,CAAC;AAIM,MAAM,4BAA4B,EAAE,aAAa;AAAA,EACtD,QAAQ,EAAE,WAAW,aAAa,EAAE,QAAQ,cAAc,KAAK;AAAA,EAC/D,QAAQ,EAAE,WAAW,aAAa,EAAE,SAAS;AAC/C,CAAC;AAEM,MAAM,0BAA0B,EAAE,MAAM;AAAA,EAC7C,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAAA;AAAA,EAE9C,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;AAAA;AAAA,EAE7C,EAAE,aAAa,CAAC,CAAC;AACnB,CAAC;",
6
- "names": ["ComputerWorkspacePolicy", "TemplateWhenMissing"]
4
+ "sourcesContent": ["import * as z from 'zod';\n\n// Environment options of the `computer` and `device` providers: what a\n// `project.sandboxes.create(computer({...}))` call carries as the environment,\n// validated by the provider. Only what the provider itself controls lives\n// here (image, build, machine, region, idle policy); what should be on the\n// machine is the provider-neutral sandbox setup, which the platform applies.\n// Pure (no I/O) so callers can import it anywhere.\n\nexport const COMPUTER_PROVIDER = 'computer';\nexport const DEVICE_PROVIDER = 'device';\n\n// The Device API's header naming the user a request acts for.\nexport const DEVICE_API_ACTING_USER_HEADER = 'Final-Acting-User-Id';\n\n// The platform's image lineage computers start from when none is named.\nexport const DEFAULT_COMPUTER_IMAGE = 'lineage:sandbox';\n\nconst buildStepSchema = z.strictObject({\n run: z\n .string()\n .min(1)\n .max(10 * 1024),\n timeoutMinutes: z.number().int().min(1).max(120).default(20),\n});\n\n// Steps baked into a base once (the provider's preparation), never run per sandbox.\nexport const computerBuildSchema = z.strictObject({\n steps: z.array(buildStepSchema).max(30).default([]),\n // Checks that the built base works; a failing one fails the build.\n verify: z.array(buildStepSchema).max(30).default([]),\n});\n\nexport const computerMachineSchema = z.strictObject({\n vcpu: z.number().int().min(1).max(64).optional(),\n memoryMb: z.number().int().min(512).max(262_144).optional(),\n diskGb: z.number().int().min(1).max(2048).optional(),\n});\n\nexport const computerEnvironmentSchema = z.strictObject({\n // An OCI image reference, or `lineage:<name>` for a platform image lineage.\n image: z.string().min(1).max(512).optional(),\n build: computerBuildSchema.optional(),\n machine: computerMachineSchema.optional(),\n region: z.string().min(1).max(64).optional(),\n // Idle time before the computer pauses (its disk and processes kept).\n idleTimeoutSeconds: z\n .number()\n .int()\n .min(60)\n .max(7 * 24 * 60 * 60)\n .optional(),\n});\n\nexport const deviceEnvironmentSchema = z.union([\n z.strictObject({ deviceId: z.string().uuid() }),\n // A pairing code the owner approved; resolved to a device at prepare.\n z.strictObject({ pairing: z.string().min(1) }),\n]);\n\nexport type ComputerBuildIface = z.output<typeof computerBuildSchema>;\nexport type ComputerEnvironmentIface = z.output<typeof computerEnvironmentSchema>;\nexport type ComputerEnvironmentInputIface = z.input<typeof computerEnvironmentSchema>;\nexport type DeviceEnvironmentIface = z.output<typeof deviceEnvironmentSchema>;\nexport type DeviceEnvironmentInputIface = z.input<typeof deviceEnvironmentSchema>;\n"],
5
+ "mappings": "AAAA,YAAY,OAAO;AASZ,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AAGxB,MAAM,gCAAgC;AAGtC,MAAM,yBAAyB;AAEtC,MAAM,kBAAkB,EAAE,aAAa;AAAA,EACrC,KAAK,EACF,OAAO,EACP,IAAI,CAAC,EACL,IAAI,KAAK,IAAI;AAAA,EAChB,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,QAAQ,EAAE;AAC7D,CAAC;AAGM,MAAM,sBAAsB,EAAE,aAAa;AAAA,EAChD,OAAO,EAAE,MAAM,eAAe,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;AAAA;AAAA,EAElD,QAAQ,EAAE,MAAM,eAAe,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC;AAEM,MAAM,wBAAwB,EAAE,aAAa;AAAA,EAClD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,EAC/C,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,IAAI,MAAO,EAAE,SAAS;AAAA,EAC1D,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,EAAE,SAAS;AACrD,CAAC;AAEM,MAAM,4BAA4B,EAAE,aAAa;AAAA;AAAA,EAEtD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EAC3C,OAAO,oBAAoB,SAAS;AAAA,EACpC,SAAS,sBAAsB,SAAS;AAAA,EACxC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA;AAAA,EAE3C,oBAAoB,EACjB,OAAO,EACP,IAAI,EACJ,IAAI,EAAE,EACN,IAAI,IAAI,KAAK,KAAK,EAAE,EACpB,SAAS;AACd,CAAC;AAEM,MAAM,0BAA0B,EAAE,MAAM;AAAA,EAC7C,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAAA;AAAA,EAE9C,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;AAC/C,CAAC;",
6
+ "names": []
7
7
  }
@@ -1,69 +1,9 @@
1
- import { type JsonObject, type NetworkPolicy, type NetworkSandboxSessionIface, type PackageProviderRefIface, type SandboxAccess, type SandboxAttach, type SandboxEnvironmentIface, type SandboxOpenRequestIface } from '@finalai/agent-provider';
2
- import { type ComputerTemplateInputIface, type ComputerWorkspacePolicy } from "./environment.mjs";
3
- export { COMPUTER_SANDBOX_SPECIFIER, computerEnvironmentSchema, ComputerWorkspacePolicy, DEVICE_API_ACTING_USER_HEADER, DEVICE_SANDBOX_SPECIFIER, deviceEnvironmentSchema, TemplateWhenMissing, } from "./environment.mjs";
4
- export type { ComputerEnvironmentOptions, ComputerRepositoryIface, ComputerTemplateIface, ComputerTemplateInputIface, DeviceEnvironmentOptions, } from "./environment.mjs";
5
- type EnumInput<E extends string> = E | `${E}`;
6
- export interface SandboxOpenInputIface {
7
- access?: EnumInput<SandboxAccess>;
8
- attach?: EnumInput<SandboxAttach>;
9
- }
10
- export interface InstalledSandboxOpenRequestIface extends SandboxOpenRequestIface<JsonObject, JsonObject> {
11
- readonly provider: PackageProviderRefIface;
12
- readonly providerRef: PackageProviderRefIface;
13
- }
14
- export interface InstalledSandboxEnvironmentIface extends SandboxEnvironmentIface<JsonObject, SandboxOpenInputIface> {
15
- readonly provider: PackageProviderRefIface;
16
- readonly providerRef: PackageProviderRefIface;
17
- open(options?: SandboxOpenInputIface): InstalledSandboxOpenRequestIface & PromiseLike<NetworkSandboxSessionIface>;
18
- }
19
- export interface ComputerRepositoryInputIface {
20
- alias: string;
21
- repository: string;
22
- ref?: string | null;
23
- }
24
- export interface ComputerParametersInputIface {
25
- repositories?: ComputerRepositoryInputIface[];
26
- variables?: string[];
27
- workspace?: EnumInput<ComputerWorkspacePolicy>;
28
- networkPolicy?: EnumInput<NetworkPolicy> | {
29
- mode: EnumInput<NetworkPolicy>;
30
- allow?: string[];
31
- };
32
- env?: Record<string, string>;
33
- }
34
- export interface ComputerSetupGuideInputIface extends ComputerParametersInputIface {
35
- ref: string;
36
- version?: number | 'latest';
37
- }
38
- export interface ComputerInlineGuideInputIface {
39
- image: string;
40
- template: ComputerTemplateInputIface;
41
- repositories?: ComputerRepositoryInputIface[];
42
- variables?: string[];
43
- }
44
- export interface ComputerInputIface extends ComputerParametersInputIface {
45
- image?: string;
46
- }
47
- export interface DeviceInputIface {
48
- deviceId?: string;
49
- pairing?: string;
50
- }
51
- export declare const computerSetupGuide: ((input: ComputerSetupGuideInputIface) => InstalledSandboxEnvironmentIface) & {
52
- define: (input: ComputerInlineGuideInputIface) => InstalledSandboxEnvironmentIface;
53
- providerRef: {
54
- kind: import("@finalai/agent-provider").ProviderRefKind.Package;
55
- specifier: string;
56
- };
57
- };
58
- export declare const computer: ((input?: ComputerInputIface) => InstalledSandboxEnvironmentIface) & {
59
- providerRef: {
60
- kind: import("@finalai/agent-provider").ProviderRefKind.Package;
61
- specifier: string;
62
- };
63
- };
64
- export declare const device: ((input?: DeviceInputIface) => InstalledSandboxEnvironmentIface) & {
65
- providerRef: {
66
- kind: import("@finalai/agent-provider").ProviderRefKind.Package;
67
- specifier: string;
68
- };
69
- };
1
+ import { type JsonObject, type SandboxEnvironmentValueIface } from '@finalai/agent-provider';
2
+ import { type ComputerEnvironmentInputIface, type DeviceEnvironmentInputIface } from "./environment.mjs";
3
+ export declare const WORKERS_PROVIDER = "workers";
4
+ export { COMPUTER_PROVIDER, computerEnvironmentSchema, DEFAULT_COMPUTER_IMAGE, DEVICE_API_ACTING_USER_HEADER, DEVICE_PROVIDER, deviceEnvironmentSchema, type ComputerBuildIface, type ComputerEnvironmentIface, type ComputerEnvironmentInputIface, type DeviceEnvironmentIface, type DeviceEnvironmentInputIface, } from "./environment.mjs";
5
+ export { defineSandboxSetup, describeSandbox, LATEST_SANDBOX_SETUP_VERSION, type SandboxDescriptionIface, type SandboxSetupIface, type SandboxSetupInputIface, } from '@finalai/agent-provider/sandbox/setup';
6
+ export type { SandboxEnvironmentValueIface } from '@finalai/agent-provider';
7
+ export declare const computer: (options?: ComputerEnvironmentInputIface) => SandboxEnvironmentValueIface<JsonObject>;
8
+ export declare const device: (options: DeviceEnvironmentInputIface) => SandboxEnvironmentValueIface<JsonObject>;
9
+ export declare const workers: () => SandboxEnvironmentValueIface<null>;