@orchestraworks/cli 0.5.5 → 0.5.7

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 (606) hide show
  1. package/README.md +1 -1
  2. package/dist/artifacts/prelude.js +10 -1
  3. package/dist/cli/api/execute.js +7 -7
  4. package/dist/cli/core/profile.d.ts +2 -2
  5. package/dist/cli/factory/apply-preview.d.ts +23 -6
  6. package/dist/cli/factory/apply-preview.js +70 -43
  7. package/dist/cli/factory/apply-render.js +12 -4
  8. package/dist/cli/factory/apply.d.ts +7 -2
  9. package/dist/cli/factory/apply.js +86 -29
  10. package/dist/cli/factory/diff.js +20 -12
  11. package/dist/cli/factory/image-upload.d.ts +90 -0
  12. package/dist/cli/factory/image-upload.js +489 -0
  13. package/dist/cli/factory/synth.d.ts +7 -0
  14. package/dist/cli/factory/synth.js +35 -0
  15. package/dist/cli/firstRun.d.ts +2 -2
  16. package/dist/cli/firstRun.js +12 -13
  17. package/dist/cli/main.d.ts +1 -1
  18. package/dist/cli/main.js +4 -3
  19. package/dist/cli/upload.d.ts +3 -1
  20. package/dist/cli/upload.js +9 -2
  21. package/dist/constructs/agent.d.ts +9 -1
  22. package/dist/constructs/agent.js +7 -0
  23. package/dist/constructs/compute-provider.js +2 -2
  24. package/dist/constructs/connection.d.ts +22 -16
  25. package/dist/constructs/connection.js +29 -92
  26. package/dist/constructs/connector.d.ts +3 -1
  27. package/dist/constructs/connector.js +2 -0
  28. package/dist/constructs/egress-preset.d.ts +7 -52
  29. package/dist/constructs/egress-preset.js +7 -91
  30. package/dist/constructs/environment.d.ts +47 -70
  31. package/dist/constructs/environment.js +103 -213
  32. package/dist/constructs/gateway-key.d.ts +4 -1
  33. package/dist/constructs/gateway-key.js +4 -3
  34. package/dist/constructs/interfaces.d.ts +10 -2
  35. package/dist/constructs/model-provider-key.js +2 -3
  36. package/dist/constructs/pipeline.d.ts +5 -2
  37. package/dist/constructs/pipeline.js +4 -0
  38. package/dist/constructs/references.d.ts +4 -0
  39. package/dist/constructs/references.js +20 -0
  40. package/dist/constructs/role.d.ts +32 -0
  41. package/dist/constructs/role.js +77 -0
  42. package/dist/constructs/rules.d.ts +4 -4
  43. package/dist/constructs/rules.js +3 -3
  44. package/dist/constructs/secret.d.ts +36 -13
  45. package/dist/constructs/secret.js +110 -14
  46. package/dist/constructs/service-account.d.ts +12 -0
  47. package/dist/constructs/service-account.js +23 -0
  48. package/dist/constructs/skill.d.ts +3 -1
  49. package/dist/constructs/skill.js +2 -0
  50. package/dist/constructs/team-membership.d.ts +43 -0
  51. package/dist/constructs/team-membership.js +59 -0
  52. package/dist/constructs/team.d.ts +40 -0
  53. package/dist/constructs/team.js +107 -0
  54. package/dist/constructs/trigger.d.ts +7 -4
  55. package/dist/constructs/trigger.js +4 -0
  56. package/dist/constructs/workflow.d.ts +1 -1
  57. package/dist/core/factory.d.ts +0 -7
  58. package/dist/core/factory.js +15 -53
  59. package/dist/core/gateway-key-recipe.js +23 -2
  60. package/dist/core/host-pattern.d.ts +5 -0
  61. package/dist/core/host-pattern.js +14 -0
  62. package/dist/core/labels.d.ts +1 -1
  63. package/dist/core/labels.js +1 -1
  64. package/dist/core/outbound-warning.d.ts +2 -2
  65. package/dist/core/outbound-warning.js +52 -41
  66. package/dist/core/plan.d.ts +14 -11
  67. package/dist/core/plan.js +12 -11
  68. package/dist/engine/apply-core.d.ts +71 -67
  69. package/dist/engine/apply-core.js +120 -95
  70. package/dist/engine/client.d.ts +12 -4
  71. package/dist/engine/client.js +8 -3
  72. package/dist/engine/compute-provider-reconcile.js +1 -1
  73. package/dist/engine/condition-references.d.ts +2 -2
  74. package/dist/engine/condition-references.js +6 -6
  75. package/dist/engine/connection-install-link-reconcile.d.ts +4 -3
  76. package/dist/engine/connection-install-link-reconcile.js +35 -28
  77. package/dist/engine/diff.d.ts +12 -14
  78. package/dist/engine/diff.js +247 -113
  79. package/dist/engine/gateway-key-reconcile.d.ts +12 -9
  80. package/dist/engine/gateway-key-reconcile.js +43 -36
  81. package/dist/engine/model-provider-key-reconcile.js +2 -2
  82. package/dist/engine/pipeline-reconcile.d.ts +8 -9
  83. package/dist/engine/pipeline-reconcile.js +14 -10
  84. package/dist/engine/reconcile.d.ts +7 -21
  85. package/dist/engine/reconcile.js +115 -215
  86. package/dist/engine/refusals.d.ts +14 -31
  87. package/dist/engine/refusals.js +32 -81
  88. package/dist/engine/role-membership-reconcile.d.ts +19 -0
  89. package/dist/engine/role-membership-reconcile.js +276 -0
  90. package/dist/engine/secrets-apply.d.ts +18 -4
  91. package/dist/engine/secrets-apply.js +39 -4
  92. package/dist/engine/trigger-reconcile.d.ts +22 -23
  93. package/dist/engine/trigger-reconcile.js +43 -65
  94. package/dist/engine/workflow-reconcile.d.ts +2 -2
  95. package/dist/engine/workflow-reconcile.js +5 -5
  96. package/dist/generated/cli-commands.json +15398 -11771
  97. package/dist/generated/cli-dispatch.d.ts +4 -3
  98. package/dist/generated/cli-dispatch.js +76 -62
  99. package/dist/index.d.ts +12 -7
  100. package/dist/index.js +5 -3
  101. package/dist/metrics/metric.d.ts +3 -3
  102. package/dist/metrics/metric.js +1 -1
  103. package/docs/REFERENCE.md +84 -89
  104. package/node_modules/@orchestraworks/client/dist/apis/AgentsApi.d.ts +1 -1
  105. package/node_modules/@orchestraworks/client/dist/apis/AgentsApi.js +2 -2
  106. package/node_modules/@orchestraworks/client/dist/apis/ArtifactsApi.d.ts +1 -1
  107. package/node_modules/@orchestraworks/client/dist/apis/ArtifactsApi.js +2 -2
  108. package/node_modules/@orchestraworks/client/dist/apis/ConnectionInstallLinksApi.d.ts +1 -1
  109. package/node_modules/@orchestraworks/client/dist/apis/ConnectionInstallLinksApi.js +2 -2
  110. package/node_modules/@orchestraworks/client/dist/apis/ConnectionsApi.d.ts +1 -1
  111. package/node_modules/@orchestraworks/client/dist/apis/ConnectionsApi.js +2 -2
  112. package/node_modules/@orchestraworks/client/dist/apis/EnvironmentsApi.d.ts +1 -1
  113. package/node_modules/@orchestraworks/client/dist/apis/EnvironmentsApi.js +2 -2
  114. package/node_modules/@orchestraworks/client/dist/apis/FilesApi.d.ts +1 -1
  115. package/node_modules/@orchestraworks/client/dist/apis/FilesApi.js +2 -2
  116. package/node_modules/@orchestraworks/client/dist/apis/ImagesApi.d.ts +88 -0
  117. package/node_modules/@orchestraworks/client/dist/apis/ImagesApi.js +239 -0
  118. package/node_modules/@orchestraworks/client/dist/apis/MetricsApi.d.ts +1 -1
  119. package/node_modules/@orchestraworks/client/dist/apis/MetricsApi.js +2 -2
  120. package/node_modules/@orchestraworks/client/dist/apis/OrganizationsApi.d.ts +1 -15
  121. package/node_modules/@orchestraworks/client/dist/apis/OrganizationsApi.js +3 -49
  122. package/node_modules/@orchestraworks/client/dist/apis/PipelinesApi.d.ts +1 -1
  123. package/node_modules/@orchestraworks/client/dist/apis/PipelinesApi.js +2 -2
  124. package/node_modules/@orchestraworks/client/dist/apis/ProviderConnectionIntentsApi.d.ts +1 -1
  125. package/node_modules/@orchestraworks/client/dist/apis/ProviderConnectionIntentsApi.js +2 -2
  126. package/node_modules/@orchestraworks/client/dist/apis/SecretsApi.d.ts +1 -1
  127. package/node_modules/@orchestraworks/client/dist/apis/SecretsApi.js +2 -2
  128. package/node_modules/@orchestraworks/client/dist/apis/SessionsApi.d.ts +1 -1
  129. package/node_modules/@orchestraworks/client/dist/apis/SessionsApi.js +2 -2
  130. package/node_modules/@orchestraworks/client/dist/apis/SkillsApi.d.ts +1 -1
  131. package/node_modules/@orchestraworks/client/dist/apis/SkillsApi.js +2 -2
  132. package/node_modules/@orchestraworks/client/dist/apis/TeamMembershipsApi.d.ts +96 -0
  133. package/node_modules/@orchestraworks/client/dist/apis/{GroupsApi.js → TeamMembershipsApi.js} +62 -59
  134. package/node_modules/@orchestraworks/client/dist/apis/TeamsApi.d.ts +93 -0
  135. package/node_modules/@orchestraworks/client/dist/apis/{ProjectsApi.js → TeamsApi.js} +55 -55
  136. package/node_modules/@orchestraworks/client/dist/apis/TriggersApi.d.ts +1 -1
  137. package/node_modules/@orchestraworks/client/dist/apis/TriggersApi.js +2 -2
  138. package/node_modules/@orchestraworks/client/dist/apis/UsersApi.d.ts +0 -15
  139. package/node_modules/@orchestraworks/client/dist/apis/UsersApi.js +0 -49
  140. package/node_modules/@orchestraworks/client/dist/apis/VolumesApi.d.ts +1 -1
  141. package/node_modules/@orchestraworks/client/dist/apis/VolumesApi.js +2 -2
  142. package/node_modules/@orchestraworks/client/dist/apis/WorkItemsApi.d.ts +2 -2
  143. package/node_modules/@orchestraworks/client/dist/apis/WorkItemsApi.js +4 -4
  144. package/node_modules/@orchestraworks/client/dist/apis/WorkflowsApi.d.ts +1 -1
  145. package/node_modules/@orchestraworks/client/dist/apis/WorkflowsApi.js +2 -2
  146. package/node_modules/@orchestraworks/client/dist/apis/index.d.ts +3 -2
  147. package/node_modules/@orchestraworks/client/dist/apis/index.js +3 -2
  148. package/node_modules/@orchestraworks/client/dist/esm/apis/AgentsApi.d.ts +1 -1
  149. package/node_modules/@orchestraworks/client/dist/esm/apis/AgentsApi.js +2 -2
  150. package/node_modules/@orchestraworks/client/dist/esm/apis/ArtifactsApi.d.ts +1 -1
  151. package/node_modules/@orchestraworks/client/dist/esm/apis/ArtifactsApi.js +2 -2
  152. package/node_modules/@orchestraworks/client/dist/esm/apis/ConnectionInstallLinksApi.d.ts +1 -1
  153. package/node_modules/@orchestraworks/client/dist/esm/apis/ConnectionInstallLinksApi.js +2 -2
  154. package/node_modules/@orchestraworks/client/dist/esm/apis/ConnectionsApi.d.ts +1 -1
  155. package/node_modules/@orchestraworks/client/dist/esm/apis/ConnectionsApi.js +2 -2
  156. package/node_modules/@orchestraworks/client/dist/esm/apis/EnvironmentsApi.d.ts +1 -1
  157. package/node_modules/@orchestraworks/client/dist/esm/apis/EnvironmentsApi.js +2 -2
  158. package/node_modules/@orchestraworks/client/dist/esm/apis/FilesApi.d.ts +1 -1
  159. package/node_modules/@orchestraworks/client/dist/esm/apis/FilesApi.js +2 -2
  160. package/node_modules/@orchestraworks/client/dist/esm/apis/ImagesApi.d.ts +88 -0
  161. package/node_modules/@orchestraworks/client/dist/esm/apis/ImagesApi.js +235 -0
  162. package/node_modules/@orchestraworks/client/dist/esm/apis/MetricsApi.d.ts +1 -1
  163. package/node_modules/@orchestraworks/client/dist/esm/apis/MetricsApi.js +2 -2
  164. package/node_modules/@orchestraworks/client/dist/esm/apis/OrganizationsApi.d.ts +1 -15
  165. package/node_modules/@orchestraworks/client/dist/esm/apis/OrganizationsApi.js +3 -49
  166. package/node_modules/@orchestraworks/client/dist/esm/apis/PipelinesApi.d.ts +1 -1
  167. package/node_modules/@orchestraworks/client/dist/esm/apis/PipelinesApi.js +2 -2
  168. package/node_modules/@orchestraworks/client/dist/esm/apis/ProviderConnectionIntentsApi.d.ts +1 -1
  169. package/node_modules/@orchestraworks/client/dist/esm/apis/ProviderConnectionIntentsApi.js +2 -2
  170. package/node_modules/@orchestraworks/client/dist/esm/apis/SecretsApi.d.ts +1 -1
  171. package/node_modules/@orchestraworks/client/dist/esm/apis/SecretsApi.js +2 -2
  172. package/node_modules/@orchestraworks/client/dist/esm/apis/SessionsApi.d.ts +1 -1
  173. package/node_modules/@orchestraworks/client/dist/esm/apis/SessionsApi.js +2 -2
  174. package/node_modules/@orchestraworks/client/dist/esm/apis/SkillsApi.d.ts +1 -1
  175. package/node_modules/@orchestraworks/client/dist/esm/apis/SkillsApi.js +2 -2
  176. package/node_modules/@orchestraworks/client/dist/esm/apis/TeamMembershipsApi.d.ts +96 -0
  177. package/node_modules/@orchestraworks/client/dist/esm/apis/{GroupsApi.js → TeamMembershipsApi.js} +60 -57
  178. package/node_modules/@orchestraworks/client/dist/esm/apis/TeamsApi.d.ts +93 -0
  179. package/node_modules/@orchestraworks/client/dist/esm/apis/{ProjectsApi.js → TeamsApi.js} +53 -53
  180. package/node_modules/@orchestraworks/client/dist/esm/apis/TriggersApi.d.ts +1 -1
  181. package/node_modules/@orchestraworks/client/dist/esm/apis/TriggersApi.js +2 -2
  182. package/node_modules/@orchestraworks/client/dist/esm/apis/UsersApi.d.ts +0 -15
  183. package/node_modules/@orchestraworks/client/dist/esm/apis/UsersApi.js +0 -49
  184. package/node_modules/@orchestraworks/client/dist/esm/apis/VolumesApi.d.ts +1 -1
  185. package/node_modules/@orchestraworks/client/dist/esm/apis/VolumesApi.js +2 -2
  186. package/node_modules/@orchestraworks/client/dist/esm/apis/WorkItemsApi.d.ts +2 -2
  187. package/node_modules/@orchestraworks/client/dist/esm/apis/WorkItemsApi.js +4 -4
  188. package/node_modules/@orchestraworks/client/dist/esm/apis/WorkflowsApi.d.ts +1 -1
  189. package/node_modules/@orchestraworks/client/dist/esm/apis/WorkflowsApi.js +2 -2
  190. package/node_modules/@orchestraworks/client/dist/esm/apis/index.d.ts +3 -2
  191. package/node_modules/@orchestraworks/client/dist/esm/apis/index.js +3 -2
  192. package/node_modules/@orchestraworks/client/dist/esm/models/AddArtifactVersionRequest.d.ts +1 -1
  193. package/node_modules/@orchestraworks/client/dist/esm/models/Agent.d.ts +9 -3
  194. package/node_modules/@orchestraworks/client/dist/esm/models/Agent.js +3 -2
  195. package/node_modules/@orchestraworks/client/dist/esm/models/ApiErrorDetail.d.ts +9 -1
  196. package/node_modules/@orchestraworks/client/dist/esm/models/ApiErrorDetail.js +5 -1
  197. package/node_modules/@orchestraworks/client/dist/esm/models/Artifact.d.ts +2 -2
  198. package/node_modules/@orchestraworks/client/dist/esm/models/Artifact.js +2 -2
  199. package/node_modules/@orchestraworks/client/dist/esm/models/ArtifactSummary.d.ts +2 -2
  200. package/node_modules/@orchestraworks/client/dist/esm/models/ArtifactSummary.js +2 -2
  201. package/node_modules/@orchestraworks/client/dist/esm/models/AssignAction.d.ts +1 -1
  202. package/node_modules/@orchestraworks/client/dist/esm/models/AssignAction.js +2 -2
  203. package/node_modules/@orchestraworks/client/dist/esm/models/AssignWorkItemRequest.d.ts +2 -2
  204. package/node_modules/@orchestraworks/client/dist/esm/models/AssignWorkItemRequest.js +2 -2
  205. package/node_modules/@orchestraworks/client/dist/esm/models/ComputeProviderTarget.d.ts +6 -0
  206. package/node_modules/@orchestraworks/client/dist/esm/models/ComputeProviderTarget.js +2 -0
  207. package/node_modules/@orchestraworks/client/dist/esm/models/Connection.d.ts +16 -3
  208. package/node_modules/@orchestraworks/client/dist/esm/models/Connection.js +8 -2
  209. package/node_modules/@orchestraworks/client/dist/esm/models/ConnectionInstallLink.d.ts +2 -2
  210. package/node_modules/@orchestraworks/client/dist/esm/models/ConnectionInstallLink.js +2 -2
  211. package/node_modules/@orchestraworks/client/dist/esm/models/Connector.d.ts +2 -2
  212. package/node_modules/@orchestraworks/client/dist/esm/models/Connector.js +2 -2
  213. package/node_modules/@orchestraworks/client/dist/esm/models/CreateAgentRequest.d.ts +2 -2
  214. package/node_modules/@orchestraworks/client/dist/esm/models/CreateAgentRequest.js +2 -2
  215. package/node_modules/@orchestraworks/client/dist/esm/models/CreateArtifactRequest.d.ts +4 -4
  216. package/node_modules/@orchestraworks/client/dist/esm/models/CreateArtifactRequest.js +2 -2
  217. package/node_modules/@orchestraworks/client/dist/esm/models/CreateConnectionInstallLinkRequest.d.ts +3 -3
  218. package/node_modules/@orchestraworks/client/dist/esm/models/CreateConnectionInstallLinkRequest.js +2 -2
  219. package/node_modules/@orchestraworks/client/dist/esm/models/CreateConnectionRequest.d.ts +8 -2
  220. package/node_modules/@orchestraworks/client/dist/esm/models/CreateConnectionRequest.js +4 -2
  221. package/node_modules/@orchestraworks/client/dist/esm/models/CreateConnectorRequest.d.ts +2 -2
  222. package/node_modules/@orchestraworks/client/dist/esm/models/CreateConnectorRequest.js +2 -2
  223. package/node_modules/@orchestraworks/client/dist/esm/models/CreateDashboardRequest.d.ts +3 -3
  224. package/node_modules/@orchestraworks/client/dist/esm/models/CreateDashboardRequest.js +2 -2
  225. package/node_modules/@orchestraworks/client/dist/esm/models/CreateEnvironmentRequest.d.ts +2 -2
  226. package/node_modules/@orchestraworks/client/dist/esm/models/CreateEnvironmentRequest.js +2 -2
  227. package/node_modules/@orchestraworks/client/dist/esm/models/CreateFileRequest.d.ts +2 -2
  228. package/node_modules/@orchestraworks/client/dist/esm/models/CreateFileRequest.js +2 -2
  229. package/node_modules/@orchestraworks/client/dist/esm/models/CreateGatewayKeyRequest.d.ts +2 -2
  230. package/node_modules/@orchestraworks/client/dist/esm/models/CreateGatewayKeyRequest.js +2 -2
  231. package/node_modules/@orchestraworks/client/dist/esm/models/CreateImageRequest.d.ts +38 -0
  232. package/node_modules/@orchestraworks/client/dist/esm/models/{GroupMemberAgent.js → CreateImageRequest.js} +12 -16
  233. package/node_modules/@orchestraworks/client/dist/esm/models/CreateMachineRequest.d.ts +2 -2
  234. package/node_modules/@orchestraworks/client/dist/esm/models/CreateMachineRequest.js +2 -2
  235. package/node_modules/@orchestraworks/client/dist/esm/models/CreateMetricRequest.d.ts +2 -2
  236. package/node_modules/@orchestraworks/client/dist/esm/models/CreateMetricRequest.js +2 -2
  237. package/node_modules/@orchestraworks/client/dist/esm/models/CreateOrganizationInvitationRequest.d.ts +4 -4
  238. package/node_modules/@orchestraworks/client/dist/esm/models/CreateOrganizationInvitationRequest.js +3 -3
  239. package/node_modules/@orchestraworks/client/dist/esm/models/CreateOrganizationMembershipRequest.d.ts +1 -8
  240. package/node_modules/@orchestraworks/client/dist/esm/models/CreateOrganizationMembershipRequest.js +0 -3
  241. package/node_modules/@orchestraworks/client/dist/esm/models/CreatePipelineRequest.d.ts +2 -2
  242. package/node_modules/@orchestraworks/client/dist/esm/models/CreatePipelineRequest.js +2 -2
  243. package/node_modules/@orchestraworks/client/dist/esm/models/CreateProviderConnectionIntentRequest.d.ts +3 -3
  244. package/node_modules/@orchestraworks/client/dist/esm/models/CreateProviderConnectionIntentRequest.js +2 -2
  245. package/node_modules/@orchestraworks/client/dist/esm/models/CreateSecretRequest.d.ts +8 -2
  246. package/node_modules/@orchestraworks/client/dist/esm/models/CreateSecretRequest.js +4 -2
  247. package/node_modules/@orchestraworks/client/dist/esm/models/CreateSessionRequest.d.ts +2 -2
  248. package/node_modules/@orchestraworks/client/dist/esm/models/CreateSessionRequest.js +2 -2
  249. package/node_modules/@orchestraworks/client/dist/esm/models/CreateSkillRequest.d.ts +2 -2
  250. package/node_modules/@orchestraworks/client/dist/esm/models/CreateSkillRequest.js +2 -2
  251. package/node_modules/@orchestraworks/client/dist/esm/models/CreateTeamMembershipRequest.d.ts +65 -0
  252. package/node_modules/@orchestraworks/client/dist/esm/models/CreateTeamMembershipRequest.js +61 -0
  253. package/node_modules/@orchestraworks/client/dist/esm/models/CreateTeamRequest.d.ts +80 -0
  254. package/node_modules/@orchestraworks/client/dist/esm/models/CreateTeamRequest.js +64 -0
  255. package/node_modules/@orchestraworks/client/dist/esm/models/CreateTriggerRequest.d.ts +2 -2
  256. package/node_modules/@orchestraworks/client/dist/esm/models/CreateTriggerRequest.js +2 -2
  257. package/node_modules/@orchestraworks/client/dist/esm/models/CreateVolumeRequest.d.ts +2 -2
  258. package/node_modules/@orchestraworks/client/dist/esm/models/CreateVolumeRequest.js +2 -2
  259. package/node_modules/@orchestraworks/client/dist/esm/models/CreateWorkflowRequest.d.ts +1 -1
  260. package/node_modules/@orchestraworks/client/dist/esm/models/Dashboard.d.ts +8 -2
  261. package/node_modules/@orchestraworks/client/dist/esm/models/Dashboard.js +6 -2
  262. package/node_modules/@orchestraworks/client/dist/esm/models/DashboardChart.d.ts +45 -4
  263. package/node_modules/@orchestraworks/client/dist/esm/models/DashboardChart.js +29 -5
  264. package/node_modules/@orchestraworks/client/dist/esm/models/DashboardChartQuery.d.ts +1 -1
  265. package/node_modules/@orchestraworks/client/dist/esm/models/Delivery.d.ts +2 -2
  266. package/node_modules/@orchestraworks/client/dist/esm/models/Delivery.js +2 -2
  267. package/node_modules/@orchestraworks/client/dist/esm/models/EgressPolicyRule.d.ts +0 -13
  268. package/node_modules/@orchestraworks/client/dist/esm/models/EgressPolicyRule.js +0 -5
  269. package/node_modules/@orchestraworks/client/dist/esm/models/EntitlementTeamUsage.d.ts +58 -0
  270. package/node_modules/@orchestraworks/client/dist/esm/models/EntitlementTeamUsage.js +64 -0
  271. package/node_modules/@orchestraworks/client/dist/esm/models/Environment.d.ts +2 -2
  272. package/node_modules/@orchestraworks/client/dist/esm/models/Environment.js +2 -2
  273. package/node_modules/@orchestraworks/client/dist/esm/models/EnvironmentEgressPolicy.d.ts +1 -1
  274. package/node_modules/@orchestraworks/client/dist/esm/models/GatewayKey.d.ts +2 -2
  275. package/node_modules/@orchestraworks/client/dist/esm/models/GatewayKey.js +2 -2
  276. package/node_modules/@orchestraworks/client/dist/esm/models/Image.d.ts +113 -0
  277. package/node_modules/@orchestraworks/client/dist/esm/models/Image.js +91 -0
  278. package/node_modules/@orchestraworks/client/dist/esm/models/InboundWebhookEdge.d.ts +2 -2
  279. package/node_modules/@orchestraworks/client/dist/esm/models/InboundWebhookEdge.js +2 -2
  280. package/node_modules/@orchestraworks/client/dist/esm/models/InvitationTeamMembership.d.ts +44 -0
  281. package/node_modules/@orchestraworks/client/dist/esm/models/InvitationTeamMembership.js +47 -0
  282. package/node_modules/@orchestraworks/client/dist/esm/models/MachineEgressPolicyDiagnostics.d.ts +1 -1
  283. package/node_modules/@orchestraworks/client/dist/esm/models/MachineEgressRuleDiagnostics.d.ts +0 -6
  284. package/node_modules/@orchestraworks/client/dist/esm/models/MachineEgressRuleDiagnostics.js +0 -4
  285. package/node_modules/@orchestraworks/client/dist/esm/models/MachineView.d.ts +2 -2
  286. package/node_modules/@orchestraworks/client/dist/esm/models/MachineView.js +2 -2
  287. package/node_modules/@orchestraworks/client/dist/esm/models/MessageWorkItemRequest.d.ts +1 -1
  288. package/node_modules/@orchestraworks/client/dist/esm/models/Metric.d.ts +2 -2
  289. package/node_modules/@orchestraworks/client/dist/esm/models/Metric.js +2 -2
  290. package/node_modules/@orchestraworks/client/dist/esm/models/MetricValue.d.ts +2 -2
  291. package/node_modules/@orchestraworks/client/dist/esm/models/MetricValue.js +2 -2
  292. package/node_modules/@orchestraworks/client/dist/esm/models/ModelFile.d.ts +2 -2
  293. package/node_modules/@orchestraworks/client/dist/esm/models/ModelFile.js +2 -2
  294. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationEntitlements.d.ts +7 -0
  295. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationEntitlements.js +5 -0
  296. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationInvitation.d.ts +4 -4
  297. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationInvitation.js +4 -4
  298. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationMembership.d.ts +5 -5
  299. package/node_modules/@orchestraworks/client/dist/esm/models/OrganizationMembership.js +4 -4
  300. package/node_modules/@orchestraworks/client/dist/esm/models/PageImage.d.ts +51 -0
  301. package/node_modules/@orchestraworks/client/dist/esm/models/{PageProject.js → PageImage.js} +11 -11
  302. package/node_modules/@orchestraworks/client/dist/esm/models/PageTeam.d.ts +51 -0
  303. package/node_modules/@orchestraworks/client/dist/esm/models/{PageGroupSummary.js → PageTeam.js} +11 -11
  304. package/node_modules/@orchestraworks/client/dist/esm/models/PageTeamMembership.d.ts +51 -0
  305. package/node_modules/@orchestraworks/client/dist/esm/models/PageTeamMembership.js +56 -0
  306. package/node_modules/@orchestraworks/client/dist/esm/models/Pipeline.d.ts +2 -2
  307. package/node_modules/@orchestraworks/client/dist/esm/models/Pipeline.js +2 -2
  308. package/node_modules/@orchestraworks/client/dist/esm/models/PolicyAssignment.d.ts +8 -2
  309. package/node_modules/@orchestraworks/client/dist/esm/models/PolicyAssignment.js +4 -2
  310. package/node_modules/@orchestraworks/client/dist/esm/models/ProviderConnectionIntent.d.ts +2 -2
  311. package/node_modules/@orchestraworks/client/dist/esm/models/ProviderConnectionIntent.js +2 -2
  312. package/node_modules/@orchestraworks/client/dist/esm/models/ReferenceSubject.d.ts +1 -1
  313. package/node_modules/@orchestraworks/client/dist/esm/models/ReferenceSubject.js +1 -1
  314. package/node_modules/@orchestraworks/client/dist/esm/models/Role.d.ts +6 -0
  315. package/node_modules/@orchestraworks/client/dist/esm/models/Role.js +4 -0
  316. package/node_modules/@orchestraworks/client/dist/esm/models/Secret.d.ts +16 -3
  317. package/node_modules/@orchestraworks/client/dist/esm/models/Secret.js +8 -2
  318. package/node_modules/@orchestraworks/client/dist/esm/models/ServiceAccount.d.ts +7 -1
  319. package/node_modules/@orchestraworks/client/dist/esm/models/ServiceAccount.js +1 -0
  320. package/node_modules/@orchestraworks/client/dist/esm/models/Session.d.ts +3 -2
  321. package/node_modules/@orchestraworks/client/dist/esm/models/Session.js +3 -2
  322. package/node_modules/@orchestraworks/client/dist/esm/models/SessionSummary.d.ts +3 -2
  323. package/node_modules/@orchestraworks/client/dist/esm/models/SessionSummary.js +3 -2
  324. package/node_modules/@orchestraworks/client/dist/esm/models/Skill.d.ts +2 -2
  325. package/node_modules/@orchestraworks/client/dist/esm/models/Skill.js +2 -2
  326. package/node_modules/@orchestraworks/client/dist/esm/models/SnapshotAnchor.d.ts +1 -1
  327. package/node_modules/@orchestraworks/client/dist/esm/models/Team.d.ts +104 -0
  328. package/node_modules/@orchestraworks/client/dist/esm/models/{GroupSummary.js → Team.js} +25 -15
  329. package/node_modules/@orchestraworks/client/dist/esm/models/TeamMembership.d.ts +83 -0
  330. package/node_modules/@orchestraworks/client/dist/esm/models/TeamMembership.js +77 -0
  331. package/node_modules/@orchestraworks/client/dist/esm/models/Trigger.d.ts +2 -2
  332. package/node_modules/@orchestraworks/client/dist/esm/models/Trigger.js +2 -2
  333. package/node_modules/@orchestraworks/client/dist/esm/models/TriggerTarget.d.ts +1 -1
  334. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateArtifactRequest.d.ts +1 -1
  335. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateConnectionRequest.d.ts +6 -0
  336. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateConnectionRequest.js +2 -0
  337. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateOrganizationInvitationRequest.d.ts +4 -4
  338. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateOrganizationInvitationRequest.js +3 -3
  339. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateOrganizationMembershipRequest.d.ts +1 -8
  340. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateOrganizationMembershipRequest.js +0 -3
  341. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateSecretRequest.d.ts +6 -0
  342. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateSecretRequest.js +2 -0
  343. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateTeamMembershipRequest.d.ts +47 -0
  344. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateTeamMembershipRequest.js +51 -0
  345. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateTeamRequest.d.ts +68 -0
  346. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateTeamRequest.js +58 -0
  347. package/node_modules/@orchestraworks/client/dist/esm/models/UserGrant.d.ts +2 -2
  348. package/node_modules/@orchestraworks/client/dist/esm/models/UserGrant.js +2 -2
  349. package/node_modules/@orchestraworks/client/dist/esm/models/Volume.d.ts +10 -3
  350. package/node_modules/@orchestraworks/client/dist/esm/models/Volume.js +4 -2
  351. package/node_modules/@orchestraworks/client/dist/esm/models/WorkItemActivity.d.ts +2 -2
  352. package/node_modules/@orchestraworks/client/dist/esm/models/WorkItemAssignment.d.ts +7 -7
  353. package/node_modules/@orchestraworks/client/dist/esm/models/WorkItemAssignment.js +5 -5
  354. package/node_modules/@orchestraworks/client/dist/esm/models/WorkItemDraftAssignment.d.ts +2 -2
  355. package/node_modules/@orchestraworks/client/dist/esm/models/WorkItemDraftAssignment.js +2 -2
  356. package/node_modules/@orchestraworks/client/dist/esm/models/Workflow.d.ts +2 -2
  357. package/node_modules/@orchestraworks/client/dist/esm/models/Workflow.js +2 -2
  358. package/node_modules/@orchestraworks/client/dist/esm/models/index.d.ts +13 -17
  359. package/node_modules/@orchestraworks/client/dist/esm/models/index.js +13 -17
  360. package/node_modules/@orchestraworks/client/dist/models/AddArtifactVersionRequest.d.ts +1 -1
  361. package/node_modules/@orchestraworks/client/dist/models/Agent.d.ts +9 -3
  362. package/node_modules/@orchestraworks/client/dist/models/Agent.js +3 -2
  363. package/node_modules/@orchestraworks/client/dist/models/ApiErrorDetail.d.ts +9 -1
  364. package/node_modules/@orchestraworks/client/dist/models/ApiErrorDetail.js +5 -1
  365. package/node_modules/@orchestraworks/client/dist/models/Artifact.d.ts +2 -2
  366. package/node_modules/@orchestraworks/client/dist/models/Artifact.js +2 -2
  367. package/node_modules/@orchestraworks/client/dist/models/ArtifactSummary.d.ts +2 -2
  368. package/node_modules/@orchestraworks/client/dist/models/ArtifactSummary.js +2 -2
  369. package/node_modules/@orchestraworks/client/dist/models/AssignAction.d.ts +1 -1
  370. package/node_modules/@orchestraworks/client/dist/models/AssignAction.js +2 -2
  371. package/node_modules/@orchestraworks/client/dist/models/AssignWorkItemRequest.d.ts +2 -2
  372. package/node_modules/@orchestraworks/client/dist/models/AssignWorkItemRequest.js +2 -2
  373. package/node_modules/@orchestraworks/client/dist/models/ComputeProviderTarget.d.ts +6 -0
  374. package/node_modules/@orchestraworks/client/dist/models/ComputeProviderTarget.js +2 -0
  375. package/node_modules/@orchestraworks/client/dist/models/Connection.d.ts +16 -3
  376. package/node_modules/@orchestraworks/client/dist/models/Connection.js +8 -2
  377. package/node_modules/@orchestraworks/client/dist/models/ConnectionInstallLink.d.ts +2 -2
  378. package/node_modules/@orchestraworks/client/dist/models/ConnectionInstallLink.js +2 -2
  379. package/node_modules/@orchestraworks/client/dist/models/Connector.d.ts +2 -2
  380. package/node_modules/@orchestraworks/client/dist/models/Connector.js +2 -2
  381. package/node_modules/@orchestraworks/client/dist/models/CreateAgentRequest.d.ts +2 -2
  382. package/node_modules/@orchestraworks/client/dist/models/CreateAgentRequest.js +2 -2
  383. package/node_modules/@orchestraworks/client/dist/models/CreateArtifactRequest.d.ts +4 -4
  384. package/node_modules/@orchestraworks/client/dist/models/CreateArtifactRequest.js +2 -2
  385. package/node_modules/@orchestraworks/client/dist/models/CreateConnectionInstallLinkRequest.d.ts +3 -3
  386. package/node_modules/@orchestraworks/client/dist/models/CreateConnectionInstallLinkRequest.js +2 -2
  387. package/node_modules/@orchestraworks/client/dist/models/CreateConnectionRequest.d.ts +8 -2
  388. package/node_modules/@orchestraworks/client/dist/models/CreateConnectionRequest.js +4 -2
  389. package/node_modules/@orchestraworks/client/dist/models/CreateConnectorRequest.d.ts +2 -2
  390. package/node_modules/@orchestraworks/client/dist/models/CreateConnectorRequest.js +2 -2
  391. package/node_modules/@orchestraworks/client/dist/models/CreateDashboardRequest.d.ts +3 -3
  392. package/node_modules/@orchestraworks/client/dist/models/CreateDashboardRequest.js +2 -2
  393. package/node_modules/@orchestraworks/client/dist/models/CreateEnvironmentRequest.d.ts +2 -2
  394. package/node_modules/@orchestraworks/client/dist/models/CreateEnvironmentRequest.js +2 -2
  395. package/node_modules/@orchestraworks/client/dist/models/CreateFileRequest.d.ts +2 -2
  396. package/node_modules/@orchestraworks/client/dist/models/CreateFileRequest.js +2 -2
  397. package/node_modules/@orchestraworks/client/dist/models/CreateGatewayKeyRequest.d.ts +2 -2
  398. package/node_modules/@orchestraworks/client/dist/models/CreateGatewayKeyRequest.js +2 -2
  399. package/node_modules/@orchestraworks/client/dist/models/CreateImageRequest.d.ts +38 -0
  400. package/node_modules/@orchestraworks/client/dist/models/CreateImageRequest.js +54 -0
  401. package/node_modules/@orchestraworks/client/dist/models/CreateMachineRequest.d.ts +2 -2
  402. package/node_modules/@orchestraworks/client/dist/models/CreateMachineRequest.js +2 -2
  403. package/node_modules/@orchestraworks/client/dist/models/CreateMetricRequest.d.ts +2 -2
  404. package/node_modules/@orchestraworks/client/dist/models/CreateMetricRequest.js +2 -2
  405. package/node_modules/@orchestraworks/client/dist/models/CreateOrganizationInvitationRequest.d.ts +4 -4
  406. package/node_modules/@orchestraworks/client/dist/models/CreateOrganizationInvitationRequest.js +3 -3
  407. package/node_modules/@orchestraworks/client/dist/models/CreateOrganizationMembershipRequest.d.ts +1 -8
  408. package/node_modules/@orchestraworks/client/dist/models/CreateOrganizationMembershipRequest.js +0 -3
  409. package/node_modules/@orchestraworks/client/dist/models/CreatePipelineRequest.d.ts +2 -2
  410. package/node_modules/@orchestraworks/client/dist/models/CreatePipelineRequest.js +2 -2
  411. package/node_modules/@orchestraworks/client/dist/models/CreateProviderConnectionIntentRequest.d.ts +3 -3
  412. package/node_modules/@orchestraworks/client/dist/models/CreateProviderConnectionIntentRequest.js +2 -2
  413. package/node_modules/@orchestraworks/client/dist/models/CreateSecretRequest.d.ts +8 -2
  414. package/node_modules/@orchestraworks/client/dist/models/CreateSecretRequest.js +4 -2
  415. package/node_modules/@orchestraworks/client/dist/models/CreateSessionRequest.d.ts +2 -2
  416. package/node_modules/@orchestraworks/client/dist/models/CreateSessionRequest.js +2 -2
  417. package/node_modules/@orchestraworks/client/dist/models/CreateSkillRequest.d.ts +2 -2
  418. package/node_modules/@orchestraworks/client/dist/models/CreateSkillRequest.js +2 -2
  419. package/node_modules/@orchestraworks/client/dist/models/CreateTeamMembershipRequest.d.ts +65 -0
  420. package/node_modules/@orchestraworks/client/dist/models/CreateTeamMembershipRequest.js +69 -0
  421. package/node_modules/@orchestraworks/client/dist/models/CreateTeamRequest.d.ts +80 -0
  422. package/node_modules/@orchestraworks/client/dist/models/CreateTeamRequest.js +72 -0
  423. package/node_modules/@orchestraworks/client/dist/models/CreateTriggerRequest.d.ts +2 -2
  424. package/node_modules/@orchestraworks/client/dist/models/CreateTriggerRequest.js +2 -2
  425. package/node_modules/@orchestraworks/client/dist/models/CreateVolumeRequest.d.ts +2 -2
  426. package/node_modules/@orchestraworks/client/dist/models/CreateVolumeRequest.js +2 -2
  427. package/node_modules/@orchestraworks/client/dist/models/CreateWorkflowRequest.d.ts +1 -1
  428. package/node_modules/@orchestraworks/client/dist/models/Dashboard.d.ts +8 -2
  429. package/node_modules/@orchestraworks/client/dist/models/Dashboard.js +6 -2
  430. package/node_modules/@orchestraworks/client/dist/models/DashboardChart.d.ts +45 -4
  431. package/node_modules/@orchestraworks/client/dist/models/DashboardChart.js +30 -6
  432. package/node_modules/@orchestraworks/client/dist/models/DashboardChartQuery.d.ts +1 -1
  433. package/node_modules/@orchestraworks/client/dist/models/Delivery.d.ts +2 -2
  434. package/node_modules/@orchestraworks/client/dist/models/Delivery.js +2 -2
  435. package/node_modules/@orchestraworks/client/dist/models/EgressPolicyRule.d.ts +0 -13
  436. package/node_modules/@orchestraworks/client/dist/models/EgressPolicyRule.js +0 -5
  437. package/node_modules/@orchestraworks/client/dist/models/EntitlementTeamUsage.d.ts +58 -0
  438. package/node_modules/@orchestraworks/client/dist/models/EntitlementTeamUsage.js +72 -0
  439. package/node_modules/@orchestraworks/client/dist/models/Environment.d.ts +2 -2
  440. package/node_modules/@orchestraworks/client/dist/models/Environment.js +2 -2
  441. package/node_modules/@orchestraworks/client/dist/models/EnvironmentEgressPolicy.d.ts +1 -1
  442. package/node_modules/@orchestraworks/client/dist/models/GatewayKey.d.ts +2 -2
  443. package/node_modules/@orchestraworks/client/dist/models/GatewayKey.js +2 -2
  444. package/node_modules/@orchestraworks/client/dist/models/Image.d.ts +113 -0
  445. package/node_modules/@orchestraworks/client/dist/models/Image.js +99 -0
  446. package/node_modules/@orchestraworks/client/dist/models/InboundWebhookEdge.d.ts +2 -2
  447. package/node_modules/@orchestraworks/client/dist/models/InboundWebhookEdge.js +2 -2
  448. package/node_modules/@orchestraworks/client/dist/models/InvitationTeamMembership.d.ts +44 -0
  449. package/node_modules/@orchestraworks/client/dist/models/InvitationTeamMembership.js +54 -0
  450. package/node_modules/@orchestraworks/client/dist/models/MachineEgressPolicyDiagnostics.d.ts +1 -1
  451. package/node_modules/@orchestraworks/client/dist/models/MachineEgressRuleDiagnostics.d.ts +0 -6
  452. package/node_modules/@orchestraworks/client/dist/models/MachineEgressRuleDiagnostics.js +0 -4
  453. package/node_modules/@orchestraworks/client/dist/models/MachineView.d.ts +2 -2
  454. package/node_modules/@orchestraworks/client/dist/models/MachineView.js +2 -2
  455. package/node_modules/@orchestraworks/client/dist/models/MessageWorkItemRequest.d.ts +1 -1
  456. package/node_modules/@orchestraworks/client/dist/models/Metric.d.ts +2 -2
  457. package/node_modules/@orchestraworks/client/dist/models/Metric.js +2 -2
  458. package/node_modules/@orchestraworks/client/dist/models/MetricValue.d.ts +2 -2
  459. package/node_modules/@orchestraworks/client/dist/models/MetricValue.js +2 -2
  460. package/node_modules/@orchestraworks/client/dist/models/ModelFile.d.ts +2 -2
  461. package/node_modules/@orchestraworks/client/dist/models/ModelFile.js +2 -2
  462. package/node_modules/@orchestraworks/client/dist/models/OrganizationEntitlements.d.ts +7 -0
  463. package/node_modules/@orchestraworks/client/dist/models/OrganizationEntitlements.js +5 -0
  464. package/node_modules/@orchestraworks/client/dist/models/OrganizationInvitation.d.ts +4 -4
  465. package/node_modules/@orchestraworks/client/dist/models/OrganizationInvitation.js +4 -4
  466. package/node_modules/@orchestraworks/client/dist/models/OrganizationMembership.d.ts +5 -5
  467. package/node_modules/@orchestraworks/client/dist/models/OrganizationMembership.js +4 -4
  468. package/node_modules/@orchestraworks/client/dist/models/PageImage.d.ts +51 -0
  469. package/node_modules/@orchestraworks/client/dist/models/{PageProject.js → PageImage.js} +16 -16
  470. package/node_modules/@orchestraworks/client/dist/models/PageTeam.d.ts +51 -0
  471. package/node_modules/@orchestraworks/client/dist/models/{PageGroupSummary.js → PageTeam.js} +16 -16
  472. package/node_modules/@orchestraworks/client/dist/models/PageTeamMembership.d.ts +51 -0
  473. package/node_modules/@orchestraworks/client/dist/models/PageTeamMembership.js +63 -0
  474. package/node_modules/@orchestraworks/client/dist/models/Pipeline.d.ts +2 -2
  475. package/node_modules/@orchestraworks/client/dist/models/Pipeline.js +2 -2
  476. package/node_modules/@orchestraworks/client/dist/models/PolicyAssignment.d.ts +8 -2
  477. package/node_modules/@orchestraworks/client/dist/models/PolicyAssignment.js +4 -2
  478. package/node_modules/@orchestraworks/client/dist/models/ProviderConnectionIntent.d.ts +2 -2
  479. package/node_modules/@orchestraworks/client/dist/models/ProviderConnectionIntent.js +2 -2
  480. package/node_modules/@orchestraworks/client/dist/models/ReferenceSubject.d.ts +1 -1
  481. package/node_modules/@orchestraworks/client/dist/models/ReferenceSubject.js +1 -1
  482. package/node_modules/@orchestraworks/client/dist/models/Role.d.ts +6 -0
  483. package/node_modules/@orchestraworks/client/dist/models/Role.js +4 -0
  484. package/node_modules/@orchestraworks/client/dist/models/Secret.d.ts +16 -3
  485. package/node_modules/@orchestraworks/client/dist/models/Secret.js +8 -2
  486. package/node_modules/@orchestraworks/client/dist/models/ServiceAccount.d.ts +7 -1
  487. package/node_modules/@orchestraworks/client/dist/models/ServiceAccount.js +1 -0
  488. package/node_modules/@orchestraworks/client/dist/models/Session.d.ts +3 -2
  489. package/node_modules/@orchestraworks/client/dist/models/Session.js +3 -2
  490. package/node_modules/@orchestraworks/client/dist/models/SessionSummary.d.ts +3 -2
  491. package/node_modules/@orchestraworks/client/dist/models/SessionSummary.js +3 -2
  492. package/node_modules/@orchestraworks/client/dist/models/Skill.d.ts +2 -2
  493. package/node_modules/@orchestraworks/client/dist/models/Skill.js +2 -2
  494. package/node_modules/@orchestraworks/client/dist/models/SnapshotAnchor.d.ts +1 -1
  495. package/node_modules/@orchestraworks/client/dist/models/Team.d.ts +104 -0
  496. package/node_modules/@orchestraworks/client/dist/models/{GroupSummary.js → Team.js} +31 -21
  497. package/node_modules/@orchestraworks/client/dist/models/TeamMembership.d.ts +83 -0
  498. package/node_modules/@orchestraworks/client/dist/models/TeamMembership.js +85 -0
  499. package/node_modules/@orchestraworks/client/dist/models/Trigger.d.ts +2 -2
  500. package/node_modules/@orchestraworks/client/dist/models/Trigger.js +2 -2
  501. package/node_modules/@orchestraworks/client/dist/models/TriggerTarget.d.ts +1 -1
  502. package/node_modules/@orchestraworks/client/dist/models/UpdateArtifactRequest.d.ts +1 -1
  503. package/node_modules/@orchestraworks/client/dist/models/UpdateConnectionRequest.d.ts +6 -0
  504. package/node_modules/@orchestraworks/client/dist/models/UpdateConnectionRequest.js +2 -0
  505. package/node_modules/@orchestraworks/client/dist/models/UpdateOrganizationInvitationRequest.d.ts +4 -4
  506. package/node_modules/@orchestraworks/client/dist/models/UpdateOrganizationInvitationRequest.js +3 -3
  507. package/node_modules/@orchestraworks/client/dist/models/UpdateOrganizationMembershipRequest.d.ts +1 -8
  508. package/node_modules/@orchestraworks/client/dist/models/UpdateOrganizationMembershipRequest.js +0 -3
  509. package/node_modules/@orchestraworks/client/dist/models/UpdateSecretRequest.d.ts +6 -0
  510. package/node_modules/@orchestraworks/client/dist/models/UpdateSecretRequest.js +2 -0
  511. package/node_modules/@orchestraworks/client/dist/models/UpdateTeamMembershipRequest.d.ts +47 -0
  512. package/node_modules/@orchestraworks/client/dist/models/UpdateTeamMembershipRequest.js +59 -0
  513. package/node_modules/@orchestraworks/client/dist/models/UpdateTeamRequest.d.ts +68 -0
  514. package/node_modules/@orchestraworks/client/dist/models/UpdateTeamRequest.js +66 -0
  515. package/node_modules/@orchestraworks/client/dist/models/UserGrant.d.ts +2 -2
  516. package/node_modules/@orchestraworks/client/dist/models/UserGrant.js +2 -2
  517. package/node_modules/@orchestraworks/client/dist/models/Volume.d.ts +10 -3
  518. package/node_modules/@orchestraworks/client/dist/models/Volume.js +4 -2
  519. package/node_modules/@orchestraworks/client/dist/models/WorkItemActivity.d.ts +2 -2
  520. package/node_modules/@orchestraworks/client/dist/models/WorkItemAssignment.d.ts +7 -7
  521. package/node_modules/@orchestraworks/client/dist/models/WorkItemAssignment.js +5 -5
  522. package/node_modules/@orchestraworks/client/dist/models/WorkItemDraftAssignment.d.ts +2 -2
  523. package/node_modules/@orchestraworks/client/dist/models/WorkItemDraftAssignment.js +2 -2
  524. package/node_modules/@orchestraworks/client/dist/models/Workflow.d.ts +2 -2
  525. package/node_modules/@orchestraworks/client/dist/models/Workflow.js +2 -2
  526. package/node_modules/@orchestraworks/client/dist/models/index.d.ts +13 -17
  527. package/node_modules/@orchestraworks/client/dist/models/index.js +13 -17
  528. package/node_modules/@orchestraworks/client/package.json +1 -1
  529. package/package.json +4 -4
  530. package/skills/orchestra/SKILL.md +74 -64
  531. package/skills/orchestra-fdk/references/authoring.md +75 -39
  532. package/skills/orchestra-fdk/references/environment.md +214 -33
  533. package/skills/orchestra-fdk/references/troubleshooting.md +8 -7
  534. package/templates/bug-fix/main.ts +6 -1
  535. package/templates/engineering-team/README.md +10 -7
  536. package/templates/engineering-team/agents/engineer-agent.md +38 -16
  537. package/templates/engineering-team/lib/environment.ts +15 -3
  538. package/templates/engineering-team/main.ts +1 -1
  539. package/templates/todo-factory/main.ts +6 -1
  540. package/dist/constructs/project.d.ts +0 -33
  541. package/dist/constructs/project.js +0 -82
  542. package/node_modules/@orchestraworks/client/dist/apis/GroupsApi.d.ts +0 -95
  543. package/node_modules/@orchestraworks/client/dist/apis/ProjectsApi.d.ts +0 -93
  544. package/node_modules/@orchestraworks/client/dist/esm/apis/GroupsApi.d.ts +0 -95
  545. package/node_modules/@orchestraworks/client/dist/esm/apis/ProjectsApi.d.ts +0 -93
  546. package/node_modules/@orchestraworks/client/dist/esm/models/CreateGroupRequest.d.ts +0 -82
  547. package/node_modules/@orchestraworks/client/dist/esm/models/CreateGroupRequest.js +0 -74
  548. package/node_modules/@orchestraworks/client/dist/esm/models/CreateOrganizationRequest.d.ts +0 -53
  549. package/node_modules/@orchestraworks/client/dist/esm/models/CreateOrganizationRequest.js +0 -50
  550. package/node_modules/@orchestraworks/client/dist/esm/models/CreateProjectRequest.d.ts +0 -52
  551. package/node_modules/@orchestraworks/client/dist/esm/models/CreateProjectRequest.js +0 -49
  552. package/node_modules/@orchestraworks/client/dist/esm/models/CreateUserRequest.d.ts +0 -46
  553. package/node_modules/@orchestraworks/client/dist/esm/models/CreateUserRequest.js +0 -47
  554. package/node_modules/@orchestraworks/client/dist/esm/models/CredentialBinding.d.ts +0 -57
  555. package/node_modules/@orchestraworks/client/dist/esm/models/CredentialBinding.js +0 -50
  556. package/node_modules/@orchestraworks/client/dist/esm/models/Group.d.ts +0 -106
  557. package/node_modules/@orchestraworks/client/dist/esm/models/Group.js +0 -92
  558. package/node_modules/@orchestraworks/client/dist/esm/models/GroupMember.d.ts +0 -40
  559. package/node_modules/@orchestraworks/client/dist/esm/models/GroupMember.js +0 -45
  560. package/node_modules/@orchestraworks/client/dist/esm/models/GroupMemberAgent.d.ts +0 -44
  561. package/node_modules/@orchestraworks/client/dist/esm/models/GroupMemberReference.d.ts +0 -38
  562. package/node_modules/@orchestraworks/client/dist/esm/models/GroupMemberReference.js +0 -43
  563. package/node_modules/@orchestraworks/client/dist/esm/models/GroupMemberUser.d.ts +0 -38
  564. package/node_modules/@orchestraworks/client/dist/esm/models/GroupMemberUser.js +0 -45
  565. package/node_modules/@orchestraworks/client/dist/esm/models/GroupSummary.d.ts +0 -86
  566. package/node_modules/@orchestraworks/client/dist/esm/models/PageGroupSummary.d.ts +0 -51
  567. package/node_modules/@orchestraworks/client/dist/esm/models/PageProject.d.ts +0 -51
  568. package/node_modules/@orchestraworks/client/dist/esm/models/Project.d.ts +0 -76
  569. package/node_modules/@orchestraworks/client/dist/esm/models/Project.js +0 -69
  570. package/node_modules/@orchestraworks/client/dist/esm/models/RoleAssignment.d.ts +0 -38
  571. package/node_modules/@orchestraworks/client/dist/esm/models/RoleAssignment.js +0 -45
  572. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateGroupRequest.d.ts +0 -70
  573. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateGroupRequest.js +0 -60
  574. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateProjectRequest.d.ts +0 -46
  575. package/node_modules/@orchestraworks/client/dist/esm/models/UpdateProjectRequest.js +0 -45
  576. package/node_modules/@orchestraworks/client/dist/models/CreateGroupRequest.d.ts +0 -82
  577. package/node_modules/@orchestraworks/client/dist/models/CreateGroupRequest.js +0 -82
  578. package/node_modules/@orchestraworks/client/dist/models/CreateOrganizationRequest.d.ts +0 -53
  579. package/node_modules/@orchestraworks/client/dist/models/CreateOrganizationRequest.js +0 -57
  580. package/node_modules/@orchestraworks/client/dist/models/CreateProjectRequest.d.ts +0 -52
  581. package/node_modules/@orchestraworks/client/dist/models/CreateProjectRequest.js +0 -56
  582. package/node_modules/@orchestraworks/client/dist/models/CreateUserRequest.d.ts +0 -46
  583. package/node_modules/@orchestraworks/client/dist/models/CreateUserRequest.js +0 -54
  584. package/node_modules/@orchestraworks/client/dist/models/CredentialBinding.d.ts +0 -57
  585. package/node_modules/@orchestraworks/client/dist/models/CredentialBinding.js +0 -57
  586. package/node_modules/@orchestraworks/client/dist/models/Group.d.ts +0 -106
  587. package/node_modules/@orchestraworks/client/dist/models/Group.js +0 -100
  588. package/node_modules/@orchestraworks/client/dist/models/GroupMember.d.ts +0 -40
  589. package/node_modules/@orchestraworks/client/dist/models/GroupMember.js +0 -52
  590. package/node_modules/@orchestraworks/client/dist/models/GroupMemberAgent.d.ts +0 -44
  591. package/node_modules/@orchestraworks/client/dist/models/GroupMemberAgent.js +0 -58
  592. package/node_modules/@orchestraworks/client/dist/models/GroupMemberReference.d.ts +0 -38
  593. package/node_modules/@orchestraworks/client/dist/models/GroupMemberReference.js +0 -50
  594. package/node_modules/@orchestraworks/client/dist/models/GroupMemberUser.d.ts +0 -38
  595. package/node_modules/@orchestraworks/client/dist/models/GroupMemberUser.js +0 -52
  596. package/node_modules/@orchestraworks/client/dist/models/GroupSummary.d.ts +0 -86
  597. package/node_modules/@orchestraworks/client/dist/models/PageGroupSummary.d.ts +0 -51
  598. package/node_modules/@orchestraworks/client/dist/models/PageProject.d.ts +0 -51
  599. package/node_modules/@orchestraworks/client/dist/models/Project.d.ts +0 -76
  600. package/node_modules/@orchestraworks/client/dist/models/Project.js +0 -76
  601. package/node_modules/@orchestraworks/client/dist/models/RoleAssignment.d.ts +0 -38
  602. package/node_modules/@orchestraworks/client/dist/models/RoleAssignment.js +0 -52
  603. package/node_modules/@orchestraworks/client/dist/models/UpdateGroupRequest.d.ts +0 -70
  604. package/node_modules/@orchestraworks/client/dist/models/UpdateGroupRequest.js +0 -68
  605. package/node_modules/@orchestraworks/client/dist/models/UpdateProjectRequest.d.ts +0 -46
  606. package/node_modules/@orchestraworks/client/dist/models/UpdateProjectRequest.js +0 -52
@@ -8,12 +8,13 @@ import { isEnvImportMarker, parseEnvImportMarker } from "../constructs/reference
8
8
  import { isGatewayKeyRecipe } from "../core/gateway-key-recipe.js";
9
9
  import { createLabels, labelsPatch, MANAGED_BY_LABEL_KEY, stampManagedBy } from "../core/labels.js";
10
10
  import { isRefToken, parseRefToken, refToken } from "../core/tokens.js";
11
- import { ApplyError, credentialValueWritten, defaultPrint, describeTargetOrganization, desiredProjectOf, failing, getBySlugOrUndefined, modelSettingsUnchanged, standbyCapacityUnchanged, subsetDeepEqual, } from "./apply-core.js";
11
+ import { ApplyError, credentialValueWritten, defaultPrint, createTeamResolver, describeTargetOrganization, failing, getBySlugOrUndefined, modelSettingsUnchanged, stampTeam, standbyCapacityUnchanged, subsetDeepEqual, } from "./apply-core.js";
12
12
  import { preApprovalLevers, typedAtTerminalRemedy, } from "../cli/core/approval-policy.js";
13
- import { egressCredentialBindingLabel, refusalError, refusalOf, refuseIf, } from "./refusals.js";
13
+ import { refuseIf, } from "./refusals.js";
14
14
  import { assertSecretTransport } from "../cli/core/auth.js";
15
15
  import { provenanceField } from "./provenance.js";
16
- import { applyPipeline, groupIdOf } from "./pipeline-reconcile.js";
16
+ import { applyPipeline, teamIdOf } from "./pipeline-reconcile.js";
17
+ import { applyRole, applyTeam, applyTeamMemberships } from "./role-membership-reconcile.js";
17
18
  import { decideGatewayKeys, gatewayKeyPendingWrites, writeGatewayKeys, } from "./gateway-key-reconcile.js";
18
19
  import { applyComputeProvider } from "./compute-provider-reconcile.js";
19
20
  import { decideModelProviderKeys, modelProviderKeyPendingWrites, writeModelProviderKeys, } from "./model-provider-key-reconcile.js";
@@ -21,7 +22,7 @@ import { applyCeremonyBackedConnection, isCeremonyBackedConnection, } from "./co
21
22
  import { assertManagedChatConnectionForDesired } from "./connection-readiness.js";
22
23
  import { removedConfigurationNotice } from "./connector-configuration.js";
23
24
  import { PreflightError, PreflightRefusalError, readConnection, RedactedRefError, reservedProviderSecretIds, resolveSecretRef, validateConnectionImport, validateRefShape, } from "./preflight.js";
24
- import { allRootSourceLabels, commandLineOccurrencesFor, containsCommandLineRecipe, decideSecretWrite, metadataInjectionChange, pendingSecretWrite, reconcileInjection, replacesLiveCredentialValue, resolveSecretValueSource, } from "./secrets-apply.js";
25
+ import { allRootSourceLabels, commandLineOccurrencesFor, containsCommandLineRecipe, declaredSecretHosts, decideSecretWrite, metadataHostsChange, metadataInjectionChange, pendingSecretWrite, reconcileInjection, replacesLiveCredentialValue, resolveSecretValueSource, } from "./secrets-apply.js";
25
26
  import { collectCommandLineValues, } from "./command-line-values.js";
26
27
  // These live in the leaf module `engine/apply-core.ts` so the per-kind reconcile lanes can share them
27
28
  // without importing this monolith, which imports THEM — a cycle. Re-exported here so `engine/reconcile`
@@ -59,29 +60,10 @@ function resolveManagedToken(token, applied) {
59
60
  }
60
61
  return id;
61
62
  }
62
- /** Exported so the workflow phase resolves the same stamp through the identical seam. */
63
- export async function resolveProjectReference(apis, ref, applied) {
64
- if (isRefToken(ref)) {
65
- return resolveManagedToken(ref, applied);
66
- }
67
- const live = await getBySlugOrUndefined(() => apis.projects.getProject({ id: ref }));
68
- if (live === undefined) {
69
- throw new PreflightError(`project import '${ref}' was not found in this organization (import 404). Create it or fix the reference.`);
70
- }
71
- return live.id;
72
- }
73
- /** Synth already stamped every body symbolically, so this is a pure in-place resolve. */
74
- function stampBodyProject(body, projectId) {
75
- if (projectId !== undefined) {
76
- body.projectId = projectId;
77
- }
78
- }
79
- /**
80
- * Carries NO `env`: the project-identity arm reads none, and supplying one would claim this lane holds
81
- * credential-source evidence it does not have.
82
- */
83
- function projectCtx(live, project) {
84
- return { project, ...(live !== undefined ? { live } : {}) };
63
+ /** Carries no `env`: the team arm reads none, and supplying one would claim evidence this lane does not hold. */
64
+ async function teamCtx(teams, live, declared, resource, outcomes) {
65
+ const team = await teams.judged(declared, live, { kind: resource.kind, slug: resource.slug, op: "get" }, outcomes);
66
+ return { ...(team !== undefined ? { team } : {}), ...(live !== undefined ? { live } : {}) };
85
67
  }
86
68
  /**
87
69
  * Reads memoize by the EFFECTIVE id/slug value, so direct and env-backed handles resolving to the same value
@@ -146,24 +128,24 @@ export class ConnectionResolutionContext {
146
128
  * return shape, so every existing `ApplyOutcome[]`-returning caller is untouched; the workflow phase reuses
147
129
  * the map it fills to resolve each agent assignment through the identical machinery.
148
130
  */
149
- export async function reconcile(plan, apis, opts, appliedOut, projectOut) {
131
+ export async function reconcile(plan, apis, opts, appliedOut) {
150
132
  const outcomes = [];
151
133
  const applied = appliedOut ?? new Map();
134
+ const teams = opts.teams ?? createTeamResolver(apis, applied);
152
135
  const env = opts.env ?? process.env;
153
136
  const connections = opts.connectionResolution ?? new ConnectionResolutionContext(apis, plan.imports, applied, env);
154
137
  let reservedCache;
155
138
  const reserved = async () => (reservedCache ??= await reservedProviderSecretIds(apis));
156
139
  try {
157
140
  const secrets = plan.resources.filter((r) => r.kind === "secret");
158
- // (0) Project FIRST: resolved to a canonical id BEFORE any stamped resource — secrets included — needs
159
- // it. `undefined` for a commons factory, in which case no body carries `projectId` at all.
160
- const projectId = await resolveFactoryProjectId(plan, apis, outcomes, applied);
161
- // Populated inside the try, before any downstream resource can fail.
162
- if (projectOut !== undefined)
163
- projectOut.projectId = projectId;
164
- // The ONE descriptor every refusal classification below compares against, settled here so no lane
165
- // derives its own: phase 0 IS the resolution, so a caller-supplied one could say nothing different.
166
- const desiredProject = desiredProjectOf(projectId);
141
+ // (0) Teams and roles FIRST: every team-able row resolves its team against them, secrets included, and
142
+ // a team-membership row names a custom role.
143
+ for (const resource of plan.resources) {
144
+ if (resource.kind === "team")
145
+ await applyTeam(resource, apis, outcomes, applied, teams);
146
+ if (resource.kind === "role")
147
+ await applyRole(resource, apis, outcomes, applied);
148
+ }
167
149
  // (1) Transport guard BEFORE any API call. A pending write is knowable from env alone; a `gateway-key`
168
150
  // or `model-provider-key` resource is not, so the PRESENCE of either kind is the check — a
169
151
  // credential-bearing exchange will happen and neither credential is visible in the environment.
@@ -176,15 +158,16 @@ export async function reconcile(plan, apis, opts, appliedOut, projectOut) {
176
158
  // (2a) The two credential kinds DECIDE: reads only, raising the named refusals for the states no write
177
159
  // can fix. Both run before the secret phase so their value-free rows join the ONE consolidated
178
160
  // confirmation below, and a refused pair is therefore never approved.
179
- const gatewayKeys = await decideGatewayKeys(plan, apis, outcomes, projectId);
161
+ const gatewayKeys = await decideGatewayKeys(plan, apis, outcomes, teams);
180
162
  const modelProviderKeys = await decideModelProviderKeys(plan, apis, env, outcomes);
181
163
  // (2) Secrets: decide (reads only) → ONE confirm → the gated writes, so the consolidated prompt sees
182
164
  // every pending write. The gateway-key and BYOK write phases run inside, right after that confirm.
183
- await applySecrets(plan, apis, opts, env, outcomes, applied, projectId, desiredProject, gatewayKeys, modelProviderKeys);
165
+ await applySecrets(plan, apis, opts, env, outcomes, applied, teams, gatewayKeys, modelProviderKeys);
184
166
  // (3) The rest, in plan (topo) order.
185
167
  for (const resource of plan.resources) {
186
168
  switch (resource.kind) {
187
- case "project":
169
+ case "team":
170
+ case "role":
188
171
  break; // handled in (0)
189
172
  case "gateway-key":
190
173
  break; // handled in (2a)/(2)
@@ -193,33 +176,35 @@ export async function reconcile(plan, apis, opts, appliedOut, projectOut) {
193
176
  case "secret":
194
177
  break; // handled in (2)
195
178
  case "connector":
196
- await applyConnector(resource, apis, outcomes, applied, projectId, desiredProject, opts.notices);
179
+ await applyConnector(resource, apis, outcomes, applied, teams, opts.notices);
197
180
  break;
198
181
  case "connection":
199
- await applyConnection(resource, apis, outcomes, applied, connections, projectId, desiredProject, opts);
182
+ await applyConnection(resource, apis, outcomes, applied, connections, teams, opts);
200
183
  break;
201
184
  case "compute-provider":
202
185
  await applyComputeProvider(resource, apis, outcomes, applied, opts.onComputeProviderKey);
203
186
  break;
204
187
  case "environment":
205
- await applyEnvironment(resource, apis, outcomes, applied, reserved, connections, projectId, desiredProject);
188
+ await applyEnvironment(resource, apis, outcomes, applied, reserved, teams);
206
189
  break;
207
190
  case "skill":
208
- await applySkill(resource, apis, outcomes, applied, projectId, desiredProject);
191
+ await applySkill(resource, apis, outcomes, applied, teams);
209
192
  break;
210
193
  case "agent":
211
- await applyAgent(resource, apis, outcomes, applied, projectId, desiredProject, plan.factory, opts.provenance);
194
+ await applyAgent(resource, apis, outcomes, applied, teams, plan.factory, opts.provenance);
212
195
  break;
213
196
  case "pipeline":
214
197
  await applyPipeline(resource, apis, outcomes, applied, {
215
- projectId,
216
- desiredProject,
198
+ teams,
217
199
  resolveAgentId: (ref) => resolveReferenceId(ref, "agent", applied, apis),
218
- resolveGroupId: (ref) => groupIdOf(apis, ref),
200
+ resolveTeamId: (ref) => teamIdOf(apis, ref),
219
201
  ...(opts.notices !== undefined ? { notices: opts.notices } : {}),
220
202
  pending: opts.pendingPipelineWrites ?? [],
221
203
  });
222
204
  break;
205
+ case "team-membership":
206
+ await applyTeamMemberships(resource, apis, outcomes, applied, teams);
207
+ break;
223
208
  case "workflow":
224
209
  break; // its own phase, after the plan kinds
225
210
  default:
@@ -243,55 +228,6 @@ export async function reconcile(plan, apis, opts, appliedOut, projectOut) {
243
228
  throw new ApplyError(error?.message ?? String(error), [...outcomes], { cause: error });
244
229
  }
245
230
  }
246
- /** `undefined` for a commons factory — nothing is stamped, and every body omits `projectId` entirely. */
247
- async function resolveFactoryProjectId(plan, apis, outcomes, applied) {
248
- const managed = plan.resources.find((r) => r.kind === "project");
249
- if (managed !== undefined) {
250
- return applyProject(managed, apis, outcomes, applied);
251
- }
252
- const imported = plan.imports.find((i) => i.kind === "project");
253
- if (imported !== undefined) {
254
- return resolveProjectReference(apis, imported.ref, applied);
255
- }
256
- return undefined;
257
- }
258
- /**
259
- * `name` and the declared labels are the orchestra-managed fields: a label key no apply declared, like the
260
- * console-owned description, is never touched. No ownership marker is stamped on a project.
261
- */
262
- async function applyProject(resource, apis, outcomes, applied) {
263
- const payload = resource.payload;
264
- const live = await failing(() => getBySlugOrUndefined(() => apis.projects.getProject({ id: resource.slug })), { kind: "project", slug: resource.slug, op: "get" }, outcomes);
265
- let id;
266
- let action;
267
- if (live === undefined) {
268
- const labels = createLabels(payload.labels);
269
- const body = {
270
- name: payload.name,
271
- slug: resource.slug,
272
- ...(Object.keys(labels).length > 0 ? { labels } : {}),
273
- };
274
- const created = await failing(() => apis.projects.createProject({ createProjectRequest: body }), { kind: "project", slug: resource.slug, op: "create" }, outcomes);
275
- id = created.id;
276
- action = "created";
277
- }
278
- else {
279
- const labels = labelsPatch(payload.labels, live.labels);
280
- if (subsetDeepEqual({ name: payload.name }, live) && labels === undefined) {
281
- id = live.id;
282
- action = "unchanged";
283
- }
284
- else {
285
- const patch = { name: payload.name, ...(labels !== undefined ? { labels } : {}) };
286
- const updated = await failing(() => apis.projects.updateProject({ id: live.id, updateProjectRequest: patch }), { kind: "project", slug: resource.slug, op: "update" }, outcomes);
287
- id = updated.id;
288
- action = "updated";
289
- }
290
- }
291
- outcomes.push({ path: resource.path, kind: "project", slug: resource.slug, id, action });
292
- applied.set(refToken("project", resource.path.split("/")), id);
293
- return id;
294
- }
295
231
  // The remedy sentences a headless credential refusal offers come from the approval policy's own prose home,
296
232
  // which is where every other surface that recommends a lever reads them from too. This module used to keep a
297
233
  // second copy and the two had already drifted on word ORDER — a refusal recommending a lever spelled
@@ -398,7 +334,7 @@ function typedAtTerminalRows(modelProviderKeys, pendingSecrets) {
398
334
  * decision loop below — its whole write protocol belongs to the gateway lane — and a DECLINED confirmation
399
335
  * throws before any of the three write phases, leaving nothing stranded mid-protocol.
400
336
  */
401
- async function applySecrets(plan, apis, opts, env, outcomes, applied, projectId, desiredProject, gatewayKeys = [], modelProviderKeys = []) {
337
+ async function applySecrets(plan, apis, opts, env, outcomes, applied, teams, gatewayKeys = [], modelProviderKeys = []) {
402
338
  const secretPlans = [];
403
339
  // Decision phase — reads only. No writes yet.
404
340
  for (const resource of plan.resources) {
@@ -417,18 +353,7 @@ async function applySecrets(plan, apis, opts, env, outcomes, applied, projectId,
417
353
  // collection pass deliberately runs after the confirmation this decision feeds. Resolving it here would
418
354
  // classify a real write as a no-op and it would never be collected.
419
355
  const commandLinePending = containsCommandLineRecipe(resource.valueFrom);
420
- // A project-less Factory has NO verdict that could outrank the partial-recipe error, so it is raised
421
- // locally with no network read at all: otherwise a transient 401/5xx/offline `getSecret` would replace
422
- // an actionable "your recipe is half-supplied" message with a transport error, for a declaration that
423
- // never opted into the project axis. The `unset-source` arm needs to know whether the row EXISTS, so it
424
- // is deliberately left to the full call after the read below — acting on it here would read "absent" off
425
- // a row nobody has looked at and refuse a clean no-op.
426
- if (projectId === undefined) {
427
- const early = refusalOf("secret", resource, { env, project: desiredProject });
428
- if (early?.code === "partially-supplied") {
429
- throw refusalError(early, outcomes);
430
- }
431
- }
356
+ const team = await teams.desired(resource.payload.teamId, { kind: "secret", slug, op: "get" }, outcomes);
432
357
  const live = await failing(() => getBySlugOrUndefined(() => apis.secrets.getSecret({ id: slug })), {
433
358
  kind: "secret",
434
359
  slug,
@@ -440,23 +365,25 @@ async function applySecrets(plan, apis, opts, env, outcomes, applied, projectId,
440
365
  // outranks every other verdict, and `diff` reads the row unconditionally, so ordering it the other way
441
366
  // made apply raise a bare `ApplyError` where `diff` reported `refused`.
442
367
  //
443
- // The classifier decides all three of this phase's refusals in one call, in that order: the cross-project
444
- // row, then a composed recipe whose leaves are only PARTLY available (letting that fall through would
368
+ // The classifier decides all three of this phase's refusals in one call, in that order: the row in another
369
+ // team, then a composed recipe whose leaves are only PARTLY available (letting that fall through would
445
370
  // resolve to `undefined`, read as "nothing supplied", and silently retain the stale live value), then a
446
371
  // declared secret that is absent with nothing to write. Every leaf unset on an EXISTING secret is a clean
447
372
  // no-op, none of the three. This lane DOES supply `env`, because two of those arms judge the credential
448
373
  // SOURCE and the classifier gates them on holding an environment to judge against.
449
- refuseIf(resource.kind, resource, { ...projectCtx(live, desiredProject), env }, outcomes);
374
+ refuseIf(resource.kind, resource, { ...(await teamCtx(teams, live, team, resource, outcomes)), env }, outcomes);
450
375
  const resolvedValue = commandLinePending
451
376
  ? undefined
452
377
  : resolveSecretValueSource(resource.valueFrom, env);
453
378
  // Diffed against the live recipe so a value-less recipe edit still PATCHes instead of silently no-oping.
454
379
  const desiredInjection = resource.payload.injection;
455
380
  const injectionChange = metadataInjectionChange(desiredInjection, live?.injection);
381
+ const hostsChange = metadataHostsChange(declaredSecretHosts(resource.payload), live?.hosts);
456
382
  const decision = decideSecretWrite(resolvedValue, live !== undefined, {
457
383
  slug,
458
384
  envName,
459
385
  injectionChange,
386
+ hostsChange,
460
387
  commandLinePending,
461
388
  });
462
389
  if (decision.kind === "skip-empty") {
@@ -468,6 +395,7 @@ async function applySecrets(plan, apis, opts, env, outcomes, applied, projectId,
468
395
  resource,
469
396
  slug,
470
397
  decision,
398
+ team,
471
399
  value: resolvedValue,
472
400
  id: live?.id,
473
401
  liveInjection: live?.injection,
@@ -545,16 +473,19 @@ async function applySecrets(plan, apis, opts, env, outcomes, applied, projectId,
545
473
  // writes, because its paired Secret is a secret write the author just approved, and because a declined
546
474
  // confirmation must strand nothing — no mint has happened at this point.
547
475
  if (gatewayKeys.length > 0) {
548
- await writeGatewayKeys(gatewayKeys, apis, outcomes, applied, projectId, plan.factory);
476
+ await writeGatewayKeys(gatewayKeys, apis, outcomes, applied, plan.factory);
549
477
  }
550
- // No `projectId` is threaded: a BYOK row is org-commons by construction and exempt from project stamping.
478
+ // No team is threaded: a BYOK row is organization-wide and has none.
551
479
  if (modelProviderKeys.length > 0) {
552
480
  await writeModelProviderKeys(modelProviderKeys, apis, env, outcomes, applied, commandLineValues, plan.factory);
553
481
  }
554
482
  // Write phase — creates and overwrites, in plan order.
555
483
  for (const p of secretPlans) {
556
484
  const desiredInjection = p.resource.payload.injection;
485
+ const desiredHosts = declaredSecretHosts(p.resource.payload);
557
486
  if (p.decision.kind === "create") {
487
+ const placement = {};
488
+ stampTeam(placement, p.team);
558
489
  const body = {
559
490
  name: p.resource.payload.name,
560
491
  slug: p.slug,
@@ -562,11 +493,12 @@ async function applySecrets(plan, apis, opts, env, outcomes, applied, projectId,
562
493
  value: p.value,
563
494
  // The ordinary `Secret` construct declares no labels, so the map holds exactly the ownership marker.
564
495
  labels: stampManagedBy(undefined, plan.factory),
565
- // CREATE is the one moment a placement is chosen. No update body carries it: once this row exists,
566
- // its placement is its identity.
567
- ...(projectId !== undefined ? { projectId } : {}),
496
+ // CREATE is the one moment a team is chosen. No update body carries it: once this row exists, its
497
+ // team is its identity.
498
+ ...placement,
568
499
  // Live is absent, so never a `null` clear here.
569
500
  ...(desiredInjection !== undefined ? { injection: desiredInjection } : {}),
501
+ ...(desiredHosts !== undefined ? { hosts: desiredHosts } : {}),
570
502
  };
571
503
  const created = await failing(() => apis.secrets.createSecret({ createSecretRequest: body }), { kind: "secret", slug: p.slug, op: "create" }, outcomes);
572
504
  p.id = created.id;
@@ -574,23 +506,27 @@ async function applySecrets(plan, apis, opts, env, outcomes, applied, projectId,
574
506
  else if (p.decision.kind === "overwrite") {
575
507
  // An explicit `null` clears a live recipe the construct dropped while rotating the value.
576
508
  const injection = reconcileInjection(desiredInjection, p.liveInjection);
577
- // No `projectId`: the decision phase proved the live placement equals the declared one, so re-sending
578
- // it would say nothing — and sending a DIFFERENT one would be a silent move.
509
+ // No team: the decision phase proved the live team equals the declared one, so re-sending it would say
510
+ // nothing — and sending a different one would be a silent move.
579
511
  const body = {
580
512
  name: p.resource.payload.name,
581
513
  description: p.resource.payload.description,
582
514
  value: p.value,
583
515
  ...(injection !== undefined ? { injection } : {}),
516
+ ...(desiredHosts !== undefined ? { hosts: desiredHosts } : {}),
584
517
  };
585
518
  await failing(() => apis.secrets.updateSecret({ id: p.id, updateSecretRequest: body }), { kind: "secret", slug: p.slug, op: "update" }, outcomes);
586
519
  }
587
520
  else if (p.decision.kind === "metadata-update") {
588
- // The secret exists with no fresh value but its recipe changed: a value-less PATCH carrying `injection`
589
- // and nothing else.
590
- const body = { injection: p.decision.injection };
521
+ // The secret exists with no fresh value but its recipe or hosts changed: a value-less PATCH carrying
522
+ // only the changed fields.
523
+ const body = {
524
+ ...(p.decision.injection !== undefined ? { injection: p.decision.injection } : {}),
525
+ ...(p.decision.hosts !== undefined ? { hosts: p.decision.hosts } : {}),
526
+ };
591
527
  await failing(() => apis.secrets.updateSecret({ id: p.id, updateSecretRequest: body }), { kind: "secret", slug: p.slug, op: "update" }, outcomes);
592
528
  }
593
- // There is deliberately no fourth branch: `noop-resolve` writes nothing, because a placement mismatch is
529
+ // There is deliberately no fourth branch: `noop-resolve` writes nothing, because a team mismatch is
594
530
  // refused in the decision phase and moving the row was the only job its PATCH ever had.
595
531
  }
596
532
  for (const p of secretPlans) {
@@ -621,9 +557,10 @@ async function applySecrets(plan, apis, opts, env, outcomes, applied, projectId,
621
557
  * REQUIRED one that notice would be a dead end — the platform rejects a create missing a required field — so
622
558
  * apply refuses by name and asks for the field to be declared.
623
559
  */
624
- async function applyConnector(resource, apis, outcomes, applied, projectId, desiredProject, notices) {
560
+ async function applyConnector(resource, apis, outcomes, applied, teams, notices) {
625
561
  const body = clonePayload(resource.payload);
626
- stampBodyProject(body, projectId);
562
+ const team = await teams.desired(body.teamId, { kind: "connector", slug: resource.slug, op: "get" }, outcomes);
563
+ stampTeam(body, team);
627
564
  for (const field of CONNECTOR_SECRET_WIRE_FIELDS) {
628
565
  const ref = body[field];
629
566
  if (typeof ref === "string" && ref !== "") {
@@ -641,8 +578,8 @@ async function applyConnector(resource, apis, outcomes, applied, projectId, desi
641
578
  else {
642
579
  const liveRecord = live;
643
580
  // Nothing may classify or write a newly readable row until the ONE aggregate classifier has cleared it:
644
- // project identity first, then immutable-field drift.
645
- refuseIf(resource.kind, resource, { ...projectCtx(live, desiredProject), resolvedDesired: body }, outcomes);
581
+ // team identity first, then immutable-field drift.
582
+ refuseIf(resource.kind, resource, { ...(await teamCtx(teams, live, team, resource, outcomes)), resolvedDesired: body }, outcomes);
646
583
  // Set-only updates cannot clear a stored override, so a removed optional CONFIGURATION prop is a printed
647
584
  // human step — recorded BEFORE the unchanged/patch fork, because it applies to both.
648
585
  const notice = removedConfigurationNotice(body, liveRecord, resource);
@@ -653,12 +590,12 @@ async function applyConnector(resource, apis, outcomes, applied, projectId, desi
653
590
  action = "unchanged";
654
591
  }
655
592
  else {
656
- // `slug` is the reconcile key, the immutable fields were just proven equal, and `projectId` is
657
- // identity the guard above already proved equal — so the create-stamped body sheds it rather than
658
- // carrying a stamp that could only restate the placement or silently move the row.
593
+ // `slug` is the reconcile key, the immutable fields were just proven equal, and `teamId` is identity
594
+ // the guard above already proved equal — so the create body sheds it rather than carrying a field that
595
+ // could only restate the team or silently move the row.
659
596
  const patch = stripKeys(body, [
660
597
  "slug",
661
- "projectId",
598
+ "teamId",
662
599
  ...connectorImmutableFields(body.providerKey),
663
600
  ]);
664
601
  const updated = await failing(() => apis.connectors.updateConnector({ id: live.id, updateConnectorRequest: patch }), { kind: "connector", slug: resource.slug, op: "update" }, outcomes);
@@ -704,9 +641,10 @@ async function resolveConnectorReference(ref, applied, apis, resource, outcomes)
704
641
  * not exist until a human installs the App. Every other connection — a GitHub App declaration supplying a
705
642
  * real `installationId` included — keeps the direct GET → POST/PATCH path below, byte for byte.
706
643
  */
707
- async function applyConnection(resource, apis, outcomes, applied, connections, projectId, desiredProject, opts) {
644
+ async function applyConnection(resource, apis, outcomes, applied, connections, teams, opts) {
708
645
  const body = clonePayload(resource.payload);
709
- stampBodyProject(body, projectId);
646
+ const team = await teams.desired(body.teamId, { kind: "connection", slug: resource.slug, op: "get" }, outcomes);
647
+ stampTeam(body, team);
710
648
  // OAuth / webhook-secret connections carry no `secretId`, so there is nothing to resolve.
711
649
  const auth = body.auth;
712
650
  if (auth !== undefined && typeof auth.secretId === "string" && auth.secretId !== "") {
@@ -715,10 +653,18 @@ async function applyConnection(resource, apis, outcomes, applied, connections, p
715
653
  if (auth !== undefined && typeof auth.connectorId === "string" && auth.connectorId !== "") {
716
654
  auth.connectorId = await resolveConnectorReference(auth.connectorId, applied, apis, resource, outcomes);
717
655
  }
718
- // Taken AFTER ref resolution and project stamping, so the lane receives exactly the body this function
656
+ // Taken AFTER ref resolution and team stamping, so the lane receives exactly the body this function
719
657
  // would otherwise have sent. It records its own outcome and `applied` entry.
720
658
  if (isCeremonyBackedConnection(body)) {
721
- await applyCeremonyBackedConnection(resource, body, apis, outcomes, applied, installLinkOptions(opts));
659
+ // An install link reports Shared's id, so the ceremony lane matches links against Shared read.
660
+ const ceremonyTeam = team?.state === "shared"
661
+ ? {
662
+ state: "resolved",
663
+ teamId: (await teams.shared({ kind: "connection", slug: resource.slug, op: "get" }, outcomes)).id,
664
+ shared: true,
665
+ }
666
+ : team;
667
+ await applyCeremonyBackedConnection(resource, body, apis, outcomes, applied, installLinkOptions(opts), ceremonyTeam);
722
668
  return;
723
669
  }
724
670
  const live = await failing(() => getBySlugOrUndefined(() => apis.connections.getConnection({ id: resource.slug })), { kind: "connection", slug: resource.slug, op: "get" }, outcomes);
@@ -726,7 +672,7 @@ async function applyConnection(resource, apis, outcomes, applied, connections, p
726
672
  // then the create-only OAuth app selection. Both compare CANONICAL ids — the resolution above already
727
673
  // turned a managed token or an imported slug into one — so a valid repeat apply is never falsely refused.
728
674
  refuseIf(resource.kind, resource, {
729
- ...projectCtx(live, desiredProject),
675
+ ...(await teamCtx(teams, live, team, resource, outcomes)),
730
676
  resolvedDesired: { body, ceremonyBacked: false },
731
677
  }, outcomes);
732
678
  let id;
@@ -766,13 +712,13 @@ async function applyConnection(resource, apis, outcomes, applied, connections, p
766
712
  observed = live;
767
713
  }
768
714
  else {
769
- // `provider`/`slug` are create-only, `status` is server-owned, and `projectId` is identity the guard
715
+ // `provider`/`slug` are create-only, `status` is server-owned, and `teamId` is identity the guard
770
716
  // above already proved equal — none of the four is sent on PATCH.
771
717
  const patch = stripKeys(body, [
772
718
  "slug",
773
719
  "provider",
774
720
  "status",
775
- "projectId",
721
+ "teamId",
776
722
  ]);
777
723
  observed = await failing(() => apis.connections.updateConnection({ id: live.id, updateConnectionRequest: patch }), { kind: "connection", slug: resource.slug, op: "update" }, outcomes);
778
724
  id = observed.id;
@@ -861,7 +807,7 @@ export function connectionUnchanged(desired, live) {
861
807
  }
862
808
  return subsetDeepEqual(compare, live);
863
809
  }
864
- /** The connection OWNS this credential, so — unlike an egress binding — it is not checked as reserved. */
810
+ /** The connection OWNS this credential, so — unlike a pull credential — it is not checked as reserved. */
865
811
  async function resolveConnectionSecret(ref, applied, apis, resource, outcomes) {
866
812
  if (isRefToken(ref)) {
867
813
  return resolveManagedToken(ref, applied);
@@ -893,64 +839,11 @@ function connectionExpectFor(imports, ref) {
893
839
  }
894
840
  return { provider, install: Object.keys(install).length > 0 ? install : undefined };
895
841
  }
896
- /** Decides an egress credential binding's arm — see {@link CredentialBindingArm} for what each one means. */
897
- export function credentialBindingArm(binding) {
898
- if (typeof binding.connectionId === "string" && binding.connectionId !== "") {
899
- return "connection";
900
- }
901
- return "secret";
902
- }
903
- async function applyEnvironment(resource, apis, outcomes, applied, reserved, connections, projectId, desiredProject) {
842
+ async function applyEnvironment(resource, apis, outcomes, applied, reserved, teams) {
904
843
  const body = clonePayload(resource.payload);
905
- stampBodyProject(body, projectId);
844
+ const team = await teams.desired(body.teamId, { kind: "environment", slug: resource.slug, op: "get" }, outcomes);
845
+ stampTeam(body, team);
906
846
  const envPath = resource.path;
907
- /**
908
- * BOTH binding rules — pairwise-distinct, then connection-owned — are rules over ONE GROUP in the
909
- * aggregate classifier, rather than checks repeated inline wherever a secret ref can appear. The two
910
- * groups stay SEPARATE: pairwise-distinct is about the egress bindings, and folding the pull credential
911
- * into the same group would refuse an environment that legally binds one secret both ways.
912
- */
913
- const refuseBoundSecrets = async (secretRefs) => {
914
- if (secretRefs.length === 0)
915
- return; // the scan is lazy: no binding, no read
916
- refuseIf(resource.kind, resource, {
917
- project: desiredProject,
918
- resolvedDesired: { secretRefs },
919
- reservedProviderSecretIds: await reserved(),
920
- }, outcomes);
921
- };
922
- // Construct paths and rule labels are named on failure — never the reference value.
923
- const boundSecrets = [];
924
- const egress = body.egressPolicy;
925
- for (const rule of egress?.rules ?? []) {
926
- const bindings = rule.credentialBindings ?? [];
927
- for (const binding of bindings) {
928
- const arm = credentialBindingArm(binding);
929
- if (arm === "connection") {
930
- // Not a secret, so it contributes to neither distinctness rule: one connection may back many rules.
931
- binding.connectionId = await connections.resolve(binding.connectionId);
932
- continue;
933
- }
934
- const ref = binding.secretId;
935
- // Derived by the ONE helper `diff` names the same binding with, so preview and apply cannot word one
936
- // refusal two ways — which they did, preview building only the imported-literal shape.
937
- const label = egressCredentialBindingLabel(envPath, rule.name, ref, binding.header);
938
- let id;
939
- if (isRefToken(ref)) {
940
- id = resolveManagedToken(ref, applied);
941
- }
942
- else {
943
- validateRefShape(ref, label);
944
- // The connection-owned check is the classifier's (below), not this resolver's: one rule, one
945
- // wording, reachable from `orchestra fdk diff` too. The 404/expiry live checks stay here.
946
- id = (await resolveSecretRef(apis, { value: ref, sourceLabel: label })).id;
947
- }
948
- binding.secretId = id;
949
- boundSecrets.push({ id, label });
950
- }
951
- }
952
- // A connection-owned secret can back no egress credential binding, on either resolution path.
953
- await refuseBoundSecrets(boundSecrets);
954
847
  // A slug the platform stores canonically must be canonical BEFORE it is compared against the live row, or
955
848
  // every apply of a slug-authored reference would read as a swap. The durable home is an ordinary `/home`
956
849
  // entry in this same list, so it needs no second resolution path of its own.
@@ -983,10 +876,13 @@ async function applyEnvironment(resource, apis, outcomes, applied, reserved, con
983
876
  validateRefShape(pullRef, label);
984
877
  launchSpec.imagePullSecretId = (await resolveSecretRef(apis, { value: pullRef, sourceLabel: label })).id;
985
878
  }
986
- // The SAME classifier as the egress bindings: a connection's own credential is no more usable as a
987
- // registry pull credential than as an egress one. Its OWN group of one, since a single ref cannot
988
- // duplicate anything.
989
- await refuseBoundSecrets([{ id: launchSpec.imagePullSecretId, label }]);
879
+ // A connection's own credential is not usable as a registry pull credential.
880
+ const secretRefs = [{ id: launchSpec.imagePullSecretId, label }];
881
+ refuseIf(resource.kind, resource, {
882
+ ...(await teamCtx(teams, undefined, team, resource, outcomes)),
883
+ resolvedDesired: { secretRefs },
884
+ reservedProviderSecretIds: await reserved(),
885
+ }, outcomes);
990
886
  }
991
887
  // A declared record's token, or an imported slug, becomes the record's id; `null` stays, naming hosted
992
888
  // compute.
@@ -995,8 +891,8 @@ async function applyEnvironment(resource, apis, outcomes, applied, reserved, con
995
891
  launchSpec.computeProviderId = await resolveReferenceId(providerRef, "compute-provider", applied, apis);
996
892
  }
997
893
  const live = await failing(() => getBySlugOrUndefined(() => apis.environments.getEnvironment({ id: resource.slug })), { kind: "environment", slug: resource.slug, op: "get" }, outcomes);
998
- // Placement is identity: settle it before the no-change compare or the PATCH.
999
- refuseIf(resource.kind, resource, projectCtx(live, desiredProject), outcomes);
894
+ // A team is identity: settle it before the no-change compare or the PATCH.
895
+ refuseIf(resource.kind, resource, await teamCtx(teams, live, team, resource, outcomes), outcomes);
1000
896
  let id;
1001
897
  let action;
1002
898
  if (live === undefined) {
@@ -1009,10 +905,10 @@ async function applyEnvironment(resource, apis, outcomes, applied, reserved, con
1009
905
  action = "unchanged";
1010
906
  }
1011
907
  else {
1012
- // `slug` is the reconcile key; `projectId` is identity, proven equal above — neither is sent. The
908
+ // `slug` is the reconcile key; `teamId` is identity, proven equal above — neither is sent. The
1013
909
  // platform refuses any update carrying `platform.runtime`, and the refusal above has proven a declared
1014
910
  // one equal to the live one.
1015
- const patch = stripKeys(body, ["slug", "projectId"]);
911
+ const patch = stripKeys(body, ["slug", "teamId"]);
1016
912
  if (typeof patch.platform === "object" && patch.platform !== null) {
1017
913
  patch.platform = stripKeys(patch.platform, ["runtime"]);
1018
914
  }
@@ -1082,7 +978,7 @@ function sortByPath(refs) {
1082
978
  return [...refs].sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
1083
979
  }
1084
980
  /**
1085
- * `projectId` is deliberately NOT part of this compare: the refusal classifier already proved the live stamp
981
+ * `teamId` is deliberately NOT part of this compare: the refusal classifier already proved the live team
1086
982
  * equals the declared one, so comparing it again could only produce a second, divergent opinion.
1087
983
  */
1088
984
  function skillUnchanged(displayName, fileRefs, live) {
@@ -1092,12 +988,15 @@ function skillUnchanged(displayName, fileRefs, live) {
1092
988
  }
1093
989
  return subsetDeepEqual(desired, live);
1094
990
  }
1095
- async function applySkill(resource, apis, outcomes, applied, projectId, desiredProject) {
991
+ async function applySkill(resource, apis, outcomes, applied, teams) {
1096
992
  const payload = resource.payload;
993
+ const team = await teams.desired(payload.teamId, { kind: "skill", slug: resource.slug, op: "get" }, outcomes);
994
+ const placement = {};
995
+ stampTeam(placement, team);
1097
996
  // READ AND CLASSIFY BEFORE ANY FILE POST: the uploads below mint immutable `files` rows, so running them
1098
997
  // first would leave orphaned rows behind every refusal, for a declaration that never owned this skill.
1099
998
  const live = await failing(() => getBySlugOrUndefined(() => apis.skills.getSkill({ id: resource.slug })), { kind: "skill", slug: resource.slug, op: "get" }, outcomes);
1100
- refuseIf(resource.kind, resource, projectCtx(live, desiredProject), outcomes);
999
+ refuseIf(resource.kind, resource, await teamCtx(teams, live, team, resource, outcomes), outcomes);
1101
1000
  const fileRefs = await uploadContentFiles(payload.files, apis, { kind: "skill", slug: resource.slug }, outcomes);
1102
1001
  let id;
1103
1002
  let action;
@@ -1106,7 +1005,7 @@ async function applySkill(resource, apis, outcomes, applied, projectId, desiredP
1106
1005
  slug: resource.slug,
1107
1006
  files: fileRefs,
1108
1007
  ...(payload.displayName !== undefined ? { displayName: payload.displayName } : {}),
1109
- ...(projectId !== undefined ? { projectId } : {}),
1008
+ ...placement,
1110
1009
  };
1111
1010
  const created = await failing(() => apis.skills.createSkill({ createSkillRequest: createBody }), { kind: "skill", slug: resource.slug, op: "create" }, outcomes);
1112
1011
  id = created.id;
@@ -1117,8 +1016,8 @@ async function applySkill(resource, apis, outcomes, applied, projectId, desiredP
1117
1016
  action = "unchanged";
1118
1017
  }
1119
1018
  else {
1120
- // Whole-list `files` replacement plus the optional cosmetic `displayName`; no `projectId`, because
1121
- // placement is identity and never a move. A live displayName cannot be CLEARED by omission — the subset
1019
+ // Whole-list `files` replacement plus the optional cosmetic `displayName`; no `teamId`, because a
1020
+ // team is identity and never a move. A live displayName cannot be CLEARED by omission — the subset
1122
1021
  // compare ignores live-only keys — an accepted cosmetic residual.
1123
1022
  const patch = {
1124
1023
  files: fileRefs,
@@ -1147,9 +1046,10 @@ export function agentUnchanged(desired, live) {
1147
1046
  standbyCapacityUnchanged(desiredStandby, liveStandby) &&
1148
1047
  subsetDeepEqual(desiredRest, { ...liveRest, skillIds: liveSkillIds }));
1149
1048
  }
1150
- async function applyAgent(resource, apis, outcomes, applied, projectId, desiredProject, factory, provenance) {
1049
+ async function applyAgent(resource, apis, outcomes, applied, teams, factory, provenance) {
1151
1050
  const body = clonePayload(resource.payload);
1152
- stampBodyProject(body, projectId);
1051
+ const team = await teams.desired(body.teamId, { kind: "agent", slug: resource.slug, op: "get" }, outcomes);
1052
+ stampTeam(body, team);
1153
1053
  // Compared and written apart from the body, because an update merges them into the live map: the stamp rides
1154
1054
  // the patch too, which is what makes an ADOPTED agent missing the marker read as drift and get stamped.
1155
1055
  const declaredLabels = body.labels;
@@ -1162,7 +1062,7 @@ async function applyAgent(resource, apis, outcomes, applied, projectId, desiredP
1162
1062
  // READ AND CLASSIFY BEFORE ANY FILE POST, as the skill lane does: a refusal must leave no `files` rows
1163
1063
  // behind. The reference resolution above is reads only, so it may stay where it is.
1164
1064
  const live = await failing(() => getBySlugOrUndefined(() => apis.agents.getAgent({ id: resource.slug })), { kind: "agent", slug: resource.slug, op: "get" }, outcomes);
1165
- refuseIf(resource.kind, resource, projectCtx(live, desiredProject), outcomes);
1065
+ refuseIf(resource.kind, resource, await teamCtx(teams, live, team, resource, outcomes), outcomes);
1166
1066
  body.memoryFiles = await uploadContentFiles(body.memoryFiles ?? [], apis, { kind: "agent", slug: resource.slug }, outcomes);
1167
1067
  let id;
1168
1068
  let action;
@@ -1186,11 +1086,11 @@ async function applyAgent(resource, apis, outcomes, applied, projectId, desiredP
1186
1086
  }
1187
1087
  else {
1188
1088
  const labels = labelsPatch(declaredLabels, live.labels, managed);
1189
- // `slug` and `harness` are create-only and `projectId` is identity the guard above proved equal.
1089
+ // `slug` and `harness` are create-only and `teamId` is identity the guard above proved equal.
1190
1090
  // `UpdateAgentRequest` carries no `harness`, so the refusal above is what stops a declaration that moved
1191
1091
  // it from silently reconciling forever.
1192
1092
  const patch = {
1193
- ...stripKeys(body, ["slug", "projectId", "harness"]),
1093
+ ...stripKeys(body, ["slug", "teamId", "harness"]),
1194
1094
  ...(labels !== undefined ? { labels } : {}),
1195
1095
  ...provenanceField(provenance),
1196
1096
  };