@processfocus/runtime-local 0.1.0-next.0 → 0.1.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +3 -3
  2. package/dist/authentication-server.mjs +2 -2
  3. package/dist/{chunk-vpsm84e8.js → chunk-6b6t8tyq.js} +1 -1
  4. package/dist/{chunk-mvkr77wp.js → chunk-cq9xscgb.js} +69 -36
  5. package/dist/{chunk-9weqs8n8.js → chunk-fn7b5pxw.js} +1110 -1067
  6. package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/delegations-client.tsx +5 -1
  7. package/dist/dashboard-source/apps/frontend/app/(protected)/executions/page.tsx +52 -10
  8. package/dist/dashboard-source/apps/frontend/app/api/auth/callback/route.ts +16 -0
  9. package/dist/dashboard-source/apps/frontend/app/api/auth/delegation/route.ts +9 -0
  10. package/dist/dashboard-source/apps/frontend/app/login/login-form-content.tsx +5 -0
  11. package/dist/dashboard-source/apps/frontend/app/login/secret-login-form.tsx +20 -5
  12. package/dist/dashboard-source/apps/frontend/lib/auth/session-admission-message.ts +2 -0
  13. package/dist/dashboard-source/apps/frontend/lib/auth/session-admission.ts +29 -0
  14. package/dist/dashboard-source/apps/frontend/lib/auth/verify-passkey.ts +8 -0
  15. package/dist/dashboard-source/apps/frontend/lib/collections/execution.ts +7 -1
  16. package/dist/dashboard-source/apps/frontend/lib/generated/gql/gql.ts +6 -6
  17. package/dist/dashboard-source/apps/frontend/lib/generated/gql/graphql.ts +4 -4
  18. package/dist/dashboard-source/apps/frontend/package.json +2 -2
  19. package/dist/dashboard-source/modules/aws-common/src/index.ts +1 -0
  20. package/dist/dashboard-source/modules/aws-common/src/lib/project-balance-admission.ts +68 -0
  21. package/dist/dashboard-source/modules/form/src/lib/walker.tsx +2 -7
  22. package/dist/dashboard-source/modules/frontend-plugin-host/src/lib/frontend-plugin-host.ts +6 -0
  23. package/dist/dashboard-source/modules/rxdb-collections/generated/execution-schema.json +16 -2
  24. package/dist/dashboard-source/modules/rxdb-collections/src/lib/rxdb-collections.ts +10 -1
  25. package/dist/dashboard-source.json +2 -2
  26. package/dist/graphql-server.mjs +3 -3
  27. package/dist/job-worker.mjs +2 -2
  28. package/dist/prepare-dashboard.mjs +2 -2
  29. package/dist/resources/graphql-schema/rxdb.graphql +5 -0
  30. package/package.json +3 -3
@@ -85,12 +85,12 @@ export type PullExecutionQueryVariables = Exact<{
85
85
  }>;
86
86
 
87
87
 
88
- export type PullExecutionQuery = { pullExecution: { documents: Array<{ id: string, updatedAt: number, processStateId: string, withoutWaiting: boolean | null, processName: string, processPath: string, canAbandonExecution: boolean | null, canRestartExecution: boolean | null, status: string, failureReason: string | null, abandonedReason: string | null, startedAt: string, finishedAt: string | null, completedSteps: number, totalSteps: number, durationMs: number | null, estimatedCompletionAt: string | null, slaWarningAt: string | null, slaTargetAt: string | null, deleted: boolean, steps: Array<{ id: string, name: string, path: string, status: string, failureReason: string | null, submittedViaEmbeddedForm: boolean | null, externalSubmitterEmail: string | null, assignedProviderUserEmail: string | null, startedAt: string | null, completedAt: string | null, role: { id: string, name: string } | null, providerUser: { id: string, firstName: string, lastName: string, picture: string, orgUnit: string } | null }> }>, checkpoint: { id: string, updatedAt: number } | null } };
88
+ export type PullExecutionQuery = { pullExecution: { documents: Array<{ id: string, updatedAt: number, processStateId: string, withoutWaiting: boolean | null, processName: string, processPath: string, canAbandonExecution: boolean | null, canRestartExecution: boolean | null, status: string, failureReason: string | null, abandonedReason: string | null, notStartedReason: string | null, startedAt: string, finishedAt: string | null, completedSteps: number, totalSteps: number, durationMs: number | null, estimatedCompletionAt: string | null, slaWarningAt: string | null, slaTargetAt: string | null, deleted: boolean, steps: Array<{ id: string, name: string, path: string, status: string, failureReason: string | null, notStartedReason: string | null, submittedViaEmbeddedForm: boolean | null, externalSubmitterEmail: string | null, assignedProviderUserEmail: string | null, startedAt: string | null, completedAt: string | null, role: { id: string, name: string } | null, providerUser: { id: string, firstName: string, lastName: string, picture: string, orgUnit: string } | null }> }>, checkpoint: { id: string, updatedAt: number } | null } };
89
89
 
90
90
  export type StreamExecutionSubscriptionVariables = Exact<{ [key: string]: never; }>;
91
91
 
92
92
 
93
- export type StreamExecutionSubscription = { streamExecution: { documents: Array<{ id: string, updatedAt: number, processStateId: string, withoutWaiting: boolean | null, processName: string, processPath: string, canAbandonExecution: boolean | null, canRestartExecution: boolean | null, status: string, failureReason: string | null, abandonedReason: string | null, startedAt: string, finishedAt: string | null, completedSteps: number, totalSteps: number, durationMs: number | null, estimatedCompletionAt: string | null, slaWarningAt: string | null, slaTargetAt: string | null, deleted: boolean, steps: Array<{ id: string, name: string, path: string, status: string, failureReason: string | null, submittedViaEmbeddedForm: boolean | null, externalSubmitterEmail: string | null, assignedProviderUserEmail: string | null, startedAt: string | null, completedAt: string | null, role: { id: string, name: string } | null, providerUser: { id: string, firstName: string, lastName: string, picture: string, orgUnit: string } | null }> }>, checkpoint: { id: string, updatedAt: number } | null } };
93
+ export type StreamExecutionSubscription = { streamExecution: { documents: Array<{ id: string, updatedAt: number, processStateId: string, withoutWaiting: boolean | null, processName: string, processPath: string, canAbandonExecution: boolean | null, canRestartExecution: boolean | null, status: string, failureReason: string | null, abandonedReason: string | null, notStartedReason: string | null, startedAt: string, finishedAt: string | null, completedSteps: number, totalSteps: number, durationMs: number | null, estimatedCompletionAt: string | null, slaWarningAt: string | null, slaTargetAt: string | null, deleted: boolean, steps: Array<{ id: string, name: string, path: string, status: string, failureReason: string | null, notStartedReason: string | null, submittedViaEmbeddedForm: boolean | null, externalSubmitterEmail: string | null, assignedProviderUserEmail: string | null, startedAt: string | null, completedAt: string | null, role: { id: string, name: string } | null, providerUser: { id: string, firstName: string, lastName: string, picture: string, orgUnit: string } | null }> }>, checkpoint: { id: string, updatedAt: number } | null } };
94
94
 
95
95
  export type PullProcessQueryVariables = Exact<{
96
96
  checkpoint?: PullCheckpoint | null | undefined;
@@ -401,8 +401,8 @@ export type ProcessWorkflowQuery = { processWorkflow: { processId: string, proce
401
401
 
402
402
  export const PullDraftProcessExecutionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PullDraftProcessExecution"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PullCheckpoint"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pullDraftProcessExecution"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"checkpoint"},"value":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"processId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"startStepPath"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"fieldsCompleted"}},{"kind":"Field","name":{"kind":"Name","value":"totalFields"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"lastSaved"}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<PullDraftProcessExecutionQuery, PullDraftProcessExecutionQueryVariables>;
403
403
  export const StreamDraftProcessExecutionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"StreamDraftProcessExecution"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamDraftProcessExecution"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"processId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"startStepPath"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"fieldsCompleted"}},{"kind":"Field","name":{"kind":"Name","value":"totalFields"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"lastSaved"}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<StreamDraftProcessExecutionSubscription, StreamDraftProcessExecutionSubscriptionVariables>;
404
- export const PullExecutionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PullExecution"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PullCheckpoint"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"includeRunning"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"historySince"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pullExecution"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"checkpoint"},"value":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"includeRunning"},"value":{"kind":"Variable","name":{"kind":"Name","value":"includeRunning"}}},{"kind":"Argument","name":{"kind":"Name","value":"historySince"},"value":{"kind":"Variable","name":{"kind":"Name","value":"historySince"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"processStateId"}},{"kind":"Field","name":{"kind":"Name","value":"withoutWaiting"}},{"kind":"Field","name":{"kind":"Name","value":"processName"}},{"kind":"Field","name":{"kind":"Name","value":"processPath"}},{"kind":"Field","name":{"kind":"Name","value":"canAbandonExecution"}},{"kind":"Field","name":{"kind":"Name","value":"canRestartExecution"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"failureReason"}},{"kind":"Field","name":{"kind":"Name","value":"abandonedReason"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"completedSteps"}},{"kind":"Field","name":{"kind":"Name","value":"totalSteps"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedCompletionAt"}},{"kind":"Field","name":{"kind":"Name","value":"slaWarningAt"}},{"kind":"Field","name":{"kind":"Name","value":"slaTargetAt"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"steps"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"failureReason"}},{"kind":"Field","name":{"kind":"Name","value":"role"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"submittedViaEmbeddedForm"}},{"kind":"Field","name":{"kind":"Name","value":"externalSubmitterEmail"}},{"kind":"Field","name":{"kind":"Name","value":"assignedProviderUserEmail"}},{"kind":"Field","name":{"kind":"Name","value":"providerUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"picture"}},{"kind":"Field","name":{"kind":"Name","value":"orgUnit"}}]}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<PullExecutionQuery, PullExecutionQueryVariables>;
405
- export const StreamExecutionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"StreamExecution"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamExecution"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"processStateId"}},{"kind":"Field","name":{"kind":"Name","value":"withoutWaiting"}},{"kind":"Field","name":{"kind":"Name","value":"processName"}},{"kind":"Field","name":{"kind":"Name","value":"processPath"}},{"kind":"Field","name":{"kind":"Name","value":"canAbandonExecution"}},{"kind":"Field","name":{"kind":"Name","value":"canRestartExecution"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"failureReason"}},{"kind":"Field","name":{"kind":"Name","value":"abandonedReason"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"completedSteps"}},{"kind":"Field","name":{"kind":"Name","value":"totalSteps"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedCompletionAt"}},{"kind":"Field","name":{"kind":"Name","value":"slaWarningAt"}},{"kind":"Field","name":{"kind":"Name","value":"slaTargetAt"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"steps"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"failureReason"}},{"kind":"Field","name":{"kind":"Name","value":"role"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"submittedViaEmbeddedForm"}},{"kind":"Field","name":{"kind":"Name","value":"externalSubmitterEmail"}},{"kind":"Field","name":{"kind":"Name","value":"assignedProviderUserEmail"}},{"kind":"Field","name":{"kind":"Name","value":"providerUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"picture"}},{"kind":"Field","name":{"kind":"Name","value":"orgUnit"}}]}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<StreamExecutionSubscription, StreamExecutionSubscriptionVariables>;
404
+ export const PullExecutionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PullExecution"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PullCheckpoint"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"includeRunning"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"historySince"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Float"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pullExecution"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"checkpoint"},"value":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}},{"kind":"Argument","name":{"kind":"Name","value":"includeRunning"},"value":{"kind":"Variable","name":{"kind":"Name","value":"includeRunning"}}},{"kind":"Argument","name":{"kind":"Name","value":"historySince"},"value":{"kind":"Variable","name":{"kind":"Name","value":"historySince"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"processStateId"}},{"kind":"Field","name":{"kind":"Name","value":"withoutWaiting"}},{"kind":"Field","name":{"kind":"Name","value":"processName"}},{"kind":"Field","name":{"kind":"Name","value":"processPath"}},{"kind":"Field","name":{"kind":"Name","value":"canAbandonExecution"}},{"kind":"Field","name":{"kind":"Name","value":"canRestartExecution"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"failureReason"}},{"kind":"Field","name":{"kind":"Name","value":"abandonedReason"}},{"kind":"Field","name":{"kind":"Name","value":"notStartedReason"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"completedSteps"}},{"kind":"Field","name":{"kind":"Name","value":"totalSteps"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedCompletionAt"}},{"kind":"Field","name":{"kind":"Name","value":"slaWarningAt"}},{"kind":"Field","name":{"kind":"Name","value":"slaTargetAt"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"steps"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"failureReason"}},{"kind":"Field","name":{"kind":"Name","value":"notStartedReason"}},{"kind":"Field","name":{"kind":"Name","value":"role"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"submittedViaEmbeddedForm"}},{"kind":"Field","name":{"kind":"Name","value":"externalSubmitterEmail"}},{"kind":"Field","name":{"kind":"Name","value":"assignedProviderUserEmail"}},{"kind":"Field","name":{"kind":"Name","value":"providerUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"picture"}},{"kind":"Field","name":{"kind":"Name","value":"orgUnit"}}]}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<PullExecutionQuery, PullExecutionQueryVariables>;
405
+ export const StreamExecutionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"StreamExecution"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamExecution"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"processStateId"}},{"kind":"Field","name":{"kind":"Name","value":"withoutWaiting"}},{"kind":"Field","name":{"kind":"Name","value":"processName"}},{"kind":"Field","name":{"kind":"Name","value":"processPath"}},{"kind":"Field","name":{"kind":"Name","value":"canAbandonExecution"}},{"kind":"Field","name":{"kind":"Name","value":"canRestartExecution"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"failureReason"}},{"kind":"Field","name":{"kind":"Name","value":"abandonedReason"}},{"kind":"Field","name":{"kind":"Name","value":"notStartedReason"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}},{"kind":"Field","name":{"kind":"Name","value":"completedSteps"}},{"kind":"Field","name":{"kind":"Name","value":"totalSteps"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"estimatedCompletionAt"}},{"kind":"Field","name":{"kind":"Name","value":"slaWarningAt"}},{"kind":"Field","name":{"kind":"Name","value":"slaTargetAt"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"steps"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"failureReason"}},{"kind":"Field","name":{"kind":"Name","value":"notStartedReason"}},{"kind":"Field","name":{"kind":"Name","value":"role"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"submittedViaEmbeddedForm"}},{"kind":"Field","name":{"kind":"Name","value":"externalSubmitterEmail"}},{"kind":"Field","name":{"kind":"Name","value":"assignedProviderUserEmail"}},{"kind":"Field","name":{"kind":"Name","value":"providerUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"picture"}},{"kind":"Field","name":{"kind":"Name","value":"orgUnit"}}]}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<StreamExecutionSubscription, StreamExecutionSubscriptionVariables>;
406
406
  export const PullProcessDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PullProcess"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PullCheckpoint"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pullProcess"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"checkpoint"},"value":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"activeInstances"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"duration"}},{"kind":"Field","name":{"kind":"Name","value":"formFieldCount"}},{"kind":"Field","name":{"kind":"Name","value":"purpose"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorite"}},{"kind":"Field","name":{"kind":"Name","value":"orgUnit"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"level"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canSkipScheduleWaits"}},{"kind":"Field","name":{"kind":"Name","value":"startStepPath"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<PullProcessQuery, PullProcessQueryVariables>;
407
407
  export const StreamProcessDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"StreamProcess"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"streamProcess"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"path"}},{"kind":"Field","name":{"kind":"Name","value":"activeInstances"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"duration"}},{"kind":"Field","name":{"kind":"Name","value":"formFieldCount"}},{"kind":"Field","name":{"kind":"Name","value":"purpose"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorite"}},{"kind":"Field","name":{"kind":"Name","value":"orgUnit"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"level"}}]}},{"kind":"Field","name":{"kind":"Name","value":"canSkipScheduleWaits"}},{"kind":"Field","name":{"kind":"Name","value":"startStepPath"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]} as unknown as DocumentNode<StreamProcessSubscription, StreamProcessSubscriptionVariables>;
408
408
  export const PullTodoDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PullTodo"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"PullCheckpoint"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"limit"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pullTodo"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"checkpoint"},"value":{"kind":"Variable","name":{"kind":"Name","value":"checkpoint"}}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"Variable","name":{"kind":"Name","value":"limit"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"processExecutionId"}},{"kind":"Field","name":{"kind":"Name","value":"flowId"}},{"kind":"Field","name":{"kind":"Name","value":"processName"}},{"kind":"Field","name":{"kind":"Name","value":"stepName"}},{"kind":"Field","name":{"kind":"Name","value":"stepPath"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}},{"kind":"Field","name":{"kind":"Name","value":"assignedAt"}},{"kind":"Field","name":{"kind":"Name","value":"dueAt"}},{"kind":"Field","name":{"kind":"Name","value":"formComplexity"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"summary"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"checkpoint"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mode"}},{"kind":"Field","name":{"kind":"Name","value":"backfillHead"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}}]}}]} as unknown as DocumentNode<PullTodoQuery, PullTodoQueryVariables>;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": true,
3
3
  "type": "module",
4
- "version": "0.1.0-next.0",
4
+ "version": "0.1.0-next.1",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-acm": "^3.1131.0",
7
7
  "@aws-sdk/client-ssm": "^3.1131.0",
@@ -20,7 +20,7 @@
20
20
  "@opentelemetry/resources": "^2.11.0",
21
21
  "@opentelemetry/sdk-metrics": "^2.11.0",
22
22
  "@opentelemetry/sdk-trace-base": "^2.11.0",
23
- "@processfocus/runtime": "0.1.0-next.0",
23
+ "@processfocus/runtime": "0.1.0-next.1",
24
24
  "@radix-ui/react-checkbox": "^1.3.11",
25
25
  "@radix-ui/react-dialog": "^1.1.23",
26
26
  "@radix-ui/react-dropdown-menu": "^2.1.24",
@@ -1,3 +1,4 @@
1
1
  export * from "./lib/acm.ts"
2
2
  export * from "./lib/otlp-config.ts"
3
+ export * from "./lib/project-balance-admission.ts"
3
4
  export * from "./lib/runtime-ssm.ts"
@@ -0,0 +1,68 @@
1
+ import {
2
+ HttpClient,
3
+ HttpClientRequest,
4
+ HttpClientResponse,
5
+ } from "@effect/platform"
6
+ import { Effect, type Redacted, Schema } from "effect"
7
+
8
+ const BalanceResponse = Schema.Struct({
9
+ data: Schema.Struct({
10
+ getProjectBalance: Schema.Struct({
11
+ projectBalance: Schema.Number.pipe(Schema.finite()),
12
+ }),
13
+ }),
14
+ // Even a partial GraphQL response with errors is an unreadable balance.
15
+ errors: Schema.optional(Schema.Tuple()),
16
+ })
17
+
18
+ export interface ProjectBalanceAccess {
19
+ readonly backendOrigin: string
20
+ readonly projectId: string
21
+ readonly credential: Redacted.Redacted<string>
22
+ }
23
+
24
+ export const makeProjectBalanceAdmission = (
25
+ access: ProjectBalanceAccess,
26
+ ): Effect.Effect<
27
+ { readonly admits: Effect.Effect<boolean> },
28
+ never,
29
+ HttpClient.HttpClient
30
+ > =>
31
+ Effect.gen(function* () {
32
+ const client = (yield* HttpClient.HttpClient).pipe(
33
+ HttpClient.filterStatusOk,
34
+ )
35
+ const admits = Effect.gen(function* () {
36
+ const endpoint = yield* Effect.try(
37
+ () => new URL("/graphql", access.backendOrigin).href,
38
+ )
39
+ const request = yield* HttpClientRequest.post(endpoint).pipe(
40
+ HttpClientRequest.bearerToken(access.credential),
41
+ HttpClientRequest.setHeader("cache-control", "no-store"),
42
+ HttpClientRequest.bodyJson({
43
+ query:
44
+ "query RuntimeProjectBalance($projectId: String!) { getProjectBalance(projectId: $projectId) { projectBalance } }",
45
+ variables: { projectId: access.projectId },
46
+ }),
47
+ )
48
+ const response = yield* client.execute(request)
49
+ const balance =
50
+ yield* HttpClientResponse.schemaBodyJson(BalanceResponse)(response)
51
+ return balance.data.getProjectBalance.projectBalance > 0
52
+ }).pipe(
53
+ Effect.scoped,
54
+ Effect.timeout("5 seconds"),
55
+ Effect.catchAll(() =>
56
+ Effect.logWarning(
57
+ "Project Balance could not be read; admitting work",
58
+ ).pipe(
59
+ Effect.annotateLogs({
60
+ projectId: access.projectId,
61
+ backendOrigin: access.backendOrigin,
62
+ }),
63
+ Effect.as(true),
64
+ ),
65
+ ),
66
+ )
67
+ return { admits }
68
+ })
@@ -18,6 +18,7 @@ import type {
18
18
  TableField as TableFieldType,
19
19
  } from "../../../form-client-representation/src/lib/types.ts"
20
20
  import { FormComponentType } from "../../../form-client-representation/src/lib/types.ts"
21
+ import type { FrontendPluginForm } from "../../../frontend-plugin-host/src/index.ts"
21
22
  import {
22
23
  BooleanField,
23
24
  Button,
@@ -45,13 +46,7 @@ import {
45
46
  } from "./lookup-context.tsx"
46
47
  import { getPluginRenderer } from "./plugin-registry.ts"
47
48
 
48
- // Type alias for forms
49
- type AnyAppForm = {
50
- AppField: React.ComponentType<{
51
- name: string
52
- children: () => React.JSX.Element
53
- }>
54
- }
49
+ type AnyAppForm = FrontendPluginForm
55
50
 
56
51
  const effectiveReadOnly = (component: FormComponent): boolean | undefined => {
57
52
  if (component.disabled === true) return true
@@ -78,6 +78,12 @@ export interface FrontendPluginForm {
78
78
  readonly name: string
79
79
  readonly children: () => JSX.Element
80
80
  }>
81
+ readonly Subscribe: <TSelected = unknown>(props: {
82
+ readonly selector?: (
83
+ state: Readonly<{ readonly values: unknown }>,
84
+ ) => TSelected
85
+ readonly children: ((values: TSelected) => ReactNode) | ReactNode
86
+ }) => ReactNode | Promise<ReactNode>
81
87
  }
82
88
 
83
89
  export interface FormRendererOptions {
@@ -40,7 +40,8 @@
40
40
  "Running",
41
41
  "Completed",
42
42
  "Failed",
43
- "Abandoned"
43
+ "Abandoned",
44
+ "Not started"
44
45
  ]
45
46
  },
46
47
  "failureReason": {
@@ -55,6 +56,12 @@
55
56
  "null"
56
57
  ]
57
58
  },
59
+ "notStartedReason": {
60
+ "type": [
61
+ "string",
62
+ "null"
63
+ ]
64
+ },
58
65
  "startedAt": {
59
66
  "type": "string"
60
67
  },
@@ -97,7 +104,8 @@
97
104
  "Waiting",
98
105
  "Potential",
99
106
  "Failed",
100
- "Correction Required"
107
+ "Correction Required",
108
+ "Not started"
101
109
  ]
102
110
  },
103
111
  "failureReason": {
@@ -106,6 +114,12 @@
106
114
  "null"
107
115
  ]
108
116
  },
117
+ "notStartedReason": {
118
+ "type": [
119
+ "string",
120
+ "null"
121
+ ]
122
+ },
109
123
  "role": {
110
124
  "type": [
111
125
  "object",
@@ -132,8 +132,10 @@ export const ExecutionStepSchema = ES.Struct({
132
132
  "Potential",
133
133
  "Failed",
134
134
  "Correction Required",
135
+ "Not started",
135
136
  ),
136
137
  failureReason: ES.optional(ES.String),
138
+ notStartedReason: ES.optional(ES.String),
137
139
  role: ES.optional(RoleSchema),
138
140
  submittedViaEmbeddedForm: ES.optional(ES.Boolean),
139
141
  externalSubmitterEmail: ES.optional(ES.String),
@@ -155,9 +157,16 @@ export const ExecutionSchema = ES.Struct({
155
157
  processPath: ES.String,
156
158
  canAbandonExecution: ES.optional(ES.Boolean),
157
159
  canRestartExecution: ES.optional(ES.Boolean),
158
- status: ES.Literal("Running", "Completed", "Failed", "Abandoned"), // (derived from finished_at / failed todos / abandoned_at)
160
+ status: ES.Literal(
161
+ "Running",
162
+ "Completed",
163
+ "Failed",
164
+ "Abandoned",
165
+ "Not started",
166
+ ),
159
167
  failureReason: ES.optional(ES.String),
160
168
  abandonedReason: ES.optional(ES.String),
169
+ notStartedReason: ES.optional(ES.String),
161
170
  startedAt: ES.DateTimeUtc, // ISO date-time string
162
171
  finishedAt: ES.optional(ES.DateTimeUtc), // ISO date-time string
163
172
  durationMs: ES.optional(ES.Number),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "format": 1,
3
- "sha256": "f06dcadcf63fe7fb7ab47acdf12fc5942b0f9459ad1c1d1246f6b267b18835bc",
3
+ "sha256": "12bc174e66aa8914a89b5a07f6cd192f71a39b7e4f3d9e7e7d1d88ffbfcfb17d",
4
4
  "dependencies": {
5
5
  "@aws-sdk/client-acm": "^3.1131.0",
6
6
  "@aws-sdk/client-ssm": "^3.1131.0",
@@ -19,7 +19,7 @@
19
19
  "@opentelemetry/resources": "^2.11.0",
20
20
  "@opentelemetry/sdk-metrics": "^2.11.0",
21
21
  "@opentelemetry/sdk-trace-base": "^2.11.0",
22
- "@processfocus/runtime": "0.1.0-next.0",
22
+ "@processfocus/runtime": "0.1.0-next.1",
23
23
  "@radix-ui/react-checkbox": "^1.3.11",
24
24
  "@radix-ui/react-dialog": "^1.1.23",
25
25
  "@radix-ui/react-dropdown-menu": "^2.1.24",
@@ -29,7 +29,7 @@ import {
29
29
  LocalCedarConfigStatic,
30
30
  LocalCedarConfigHotReload,
31
31
  LocalCedarAuthorizationLive
32
- } from "./chunk-9weqs8n8.js";
32
+ } from "./chunk-fn7b5pxw.js";
33
33
  import {
34
34
  HttpClient,
35
35
  post,
@@ -78,12 +78,12 @@ import {
78
78
  generateLocalDocumentStoreToken,
79
79
  LocalDocumentStoreServiceLive,
80
80
  makeServerPluginWebhookRouter
81
- } from "./chunk-mvkr77wp.js";
81
+ } from "./chunk-cq9xscgb.js";
82
82
  import {
83
83
  serveOnExactPort,
84
84
  serveWithPortFallback,
85
85
  writePortFile
86
- } from "./chunk-vpsm84e8.js";
86
+ } from "./chunk-6b6t8tyq.js";
87
87
 
88
88
  // src/graphql-server/graphql-server.ts
89
89
  import * as Otel from "@effect/opentelemetry";
@@ -59,7 +59,7 @@ import {
59
59
  LocalCedarConfigStatic,
60
60
  LocalCedarConfigHotReload,
61
61
  LocalCedarAuthorizationLive
62
- } from "./chunk-9weqs8n8.js";
62
+ } from "./chunk-fn7b5pxw.js";
63
63
  import {
64
64
  HttpClient,
65
65
  post,
@@ -94,7 +94,7 @@ import {
94
94
  TodoFromJobPublisher,
95
95
  todoEventHandler,
96
96
  buildTodoChangeEvent
97
- } from "./chunk-mvkr77wp.js";
97
+ } from "./chunk-cq9xscgb.js";
98
98
 
99
99
  // src/job-worker/job-worker.ts
100
100
  import { existsSync as existsSync4 } from "fs";
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{createHash as D}from"crypto";import{copyFileSync as G,existsSync as P,mkdirSync as V,readFileSync as R,realpathSync as w,rmSync as q,statSync as L,writeFileSync as m}from"fs";import{dirname as F,relative as H,resolve as c,sep as f}from"path";var A="browser-plugins.json",O=["analytics","formComponents"],_=(n)=>O.some((t)=>n===t),y=(n,t)=>{if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`${t} must be an object`);return{...n}},g=(n,t)=>{if(typeof n!=="string"||n.trim().length===0)throw Error(`${t} must be a non-empty string`);return n.trim()},C=(n,t)=>{if(!_(n)){let r=O.map((e)=>JSON.stringify(e)).join(" or ");throw Error(`${t} must be ${r}`)}return n},b=(n,t,r="path")=>{let e=g(n,`browser plugin "${t}" ${r}`),i=e.split("/");if(e.startsWith("/")||e.includes("\\")||i.some((a)=>a===""||a==="."||a===".."))throw Error(`browser plugin "${t}" ${r} must stay within the artifact root: ${e}`);return e},k=(n,t)=>{let r=y(n,`browser plugin "${t}" preparation`);if(r.kind!=="stylesheet")throw Error(`browser plugin "${t}" preparation.kind must be "stylesheet"`);let e=g(r.sha256,`browser plugin "${t}" preparation.sha256`);if(!/^[0-9a-f]{64}$/.test(e))throw Error(`browser plugin "${t}" preparation.sha256 must be a 64-character hex string`);return{kind:"stylesheet",path:b(r.path,t,"preparation.path"),sha256:e}},B=(n,t)=>{let r=`browser plugin artifact manifest.plugins[${t}]`,e=y(n,r),i=g(e.identity,`${r}.identity`),a=e.hostInterfaceVersion;if(typeof a!=="number"||!Number.isInteger(a)||a<1)throw Error(`browser plugin "${i}" hostInterfaceVersion must be a positive integer`);let s=g(e.sha256,`browser plugin "${i}" sha256`);if(!/^[0-9a-f]{64}$/.test(s))throw Error(`browser plugin "${i}" sha256 must be a 64-character hex string`);return{identity:i,category:C(e.category,`browser plugin "${i}" category`),hostInterfaceVersion:a,path:b(e.path,i),sha256:s,...e.preparation!==void 0&&{preparation:k(e.preparation,i)}}},I=(n)=>{let t=y(n,"browser plugin artifact manifest");if(t.format!=="processfocus/browser-plugins")throw Error("browser plugin artifact manifest format must be processfocus/browser-plugins");if(t.version!==1)throw Error(`browser plugin artifact manifest version must be ${String(1)}`);if(!Array.isArray(t.plugins))throw Error("browser plugin artifact manifest.plugins must be an array");let r=t.plugins.map(B),e=new Set;for(let i of r){if(e.has(i.identity))throw Error(`browser plugin artifact manifest has duplicate identity "${i.identity}"`);e.add(i.identity)}return{format:"processfocus/browser-plugins",version:1,plugins:r}};var p=1;var h=(n,t)=>{if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`${t} must be an object`);return n},S=(n,t)=>{if(typeof n!=="string"||n.trim()==="")throw Error(`${t} must be a non-empty string`);return n},v=(n)=>{let r=h(JSON.parse(R(n,"utf8")),n).plugins;if(r===void 0)return[];let e=h(r,`${n}.plugins`);return["analytics","formComponents"].flatMap((i)=>{let a=e[i]??[];if(!Array.isArray(a))throw Error(`${n}.plugins.${i} must be an array`);return a.map((s,l)=>{let o=`${n}.plugins.${i}[${l}]`,d=h(s,o);return{category:i,module:S(d.module,`${o}.module`),type:S(d.type,`${o}.type`)}})})},N=(n)=>{for(let t of n.selections)if(!n.artifactIdentities.has(t.type))throw Error(`browser plugin "${t.type}" requires an organisation artifact entry in ${n.artifactManifestPath}`)},M=(n)=>{let t=c(n.artifactRoot,n.artifactPath);if(!t.startsWith(`${n.artifactRoot}${f}`))throw Error(`browser plugin "${n.identity}" ${n.artifactPathField} escapes the artifact root: ${n.artifactPath}`);if(!P(t)){let a=n.artifactPathField==="path"?"file":"preparation file";throw Error(`browser plugin "${n.identity}" ${a} is missing: ${n.artifactPath}`)}let r=w(t);if(!r.startsWith(`${n.realArtifactRoot}${f}`))throw Error(`browser plugin "${n.identity}" ${n.artifactPathField} escapes the artifact root through a symbolic link: ${n.artifactPath}`);if(!L(r).isFile())throw Error(`browser plugin "${n.identity}" ${n.artifactPathField} is not a file: ${n.artifactPath}`);let e=D("sha256").update(R(r)).digest("hex");if(e!==n.expectedSha256){let a=n.artifactPathField==="path"?"":"preparation ";throw Error(`browser plugin "${n.identity}" ${a}integrity mismatch for ${n.artifactPath}: expected ${n.expectedSha256}, got ${e}`)}V(n.outputDirectory,{recursive:!0});let i=c(n.outputDirectory,`${n.expectedSha256}${n.stagedExtension}`);return G(r,i),i},j=(n)=>{let t=F(n.manifestPath),r=c(t,A),e=c(F(n.outputModulePath),"browser-plugins");q(e,{recursive:!0,force:!0});let i=w(t);for(let o of[n.manifestPath,r])if(P(o)&&!w(o).startsWith(`${i}${f}`))throw Error(`plugin manifest escapes the selected organisation artifact root: ${o}`);if(!P(r))return N({selections:n.selections,artifactIdentities:new Set,artifactManifestPath:r}),[];let a;try{a=I(JSON.parse(R(r,"utf8")))}catch(o){throw Error(`browser plugin artifact manifest at ${r} is invalid: ${o instanceof Error?o.message:String(o)}`,{cause:o})}let s=new Map;for(let o of n.selections){if(s.has(o.type))throw Error(`frontend manifest has duplicate browser plugin identity "${o.type}"`);s.set(o.type,o)}N({selections:n.selections,artifactIdentities:new Set(a.plugins.map((o)=>o.identity)),artifactManifestPath:r});let l=c(t);return a.plugins.map((o)=>{let d=s.get(o.identity);if(!d)throw Error(`browser plugin "${o.identity}" has no matching frontend manifest selection`);if(d.category!==o.category)throw Error(`browser plugin "${o.identity}" declares category "${o.category}" but its frontend manifest selection is "${d.category}"`);if(o.hostInterfaceVersion!==p)throw Error(`browser plugin "${o.identity}" requires host interface version ${o.hostInterfaceVersion}, but the Dashboard provides ${p}`);let E=M({identity:o.identity,artifactPath:o.path,artifactPathField:"path",artifactRoot:l,expectedSha256:o.sha256,outputDirectory:e,realArtifactRoot:i,stagedExtension:".js"}),u=o.preparation;if(u===void 0)return{...o,stagedPath:E};let T=M({identity:o.identity,artifactPath:u.path,artifactPathField:"preparation.path",artifactRoot:l,expectedSha256:u.sha256,outputDirectory:e,realArtifactRoot:i,stagedExtension:".css"});return{...o,stagedPath:E,preparation:{...u,stagedPath:T}}})},x=(n,t)=>{let r=H(F(n),t).split(f).join("/");return r.startsWith(".")?r:`./${r}`},W=(n,t)=>{let r=n.map((s,l)=>{let o=JSON.stringify(x(t,s.stagedPath)),d=JSON.stringify(s.identity);return`const artifactLoader${l} = Object.assign(
2
+ import{createHash as D}from"crypto";import{copyFileSync as G,existsSync as P,mkdirSync as V,readFileSync as R,realpathSync as w,rmSync as q,statSync as L,writeFileSync as m}from"fs";import{dirname as F,relative as v,resolve as c,sep as f}from"path";var A="browser-plugins.json",O=["analytics","formComponents"],_=(n)=>O.some((t)=>n===t),y=(n,t)=>{if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`${t} must be an object`);return{...n}},g=(n,t)=>{if(typeof n!=="string"||n.trim().length===0)throw Error(`${t} must be a non-empty string`);return n.trim()},C=(n,t)=>{if(!_(n)){let r=O.map((e)=>JSON.stringify(e)).join(" or ");throw Error(`${t} must be ${r}`)}return n},b=(n,t,r="path")=>{let e=g(n,`browser plugin "${t}" ${r}`),i=e.split("/");if(e.startsWith("/")||e.includes("\\")||i.some((a)=>a===""||a==="."||a===".."))throw Error(`browser plugin "${t}" ${r} must stay within the artifact root: ${e}`);return e},k=(n,t)=>{let r=y(n,`browser plugin "${t}" preparation`);if(r.kind!=="stylesheet")throw Error(`browser plugin "${t}" preparation.kind must be "stylesheet"`);let e=g(r.sha256,`browser plugin "${t}" preparation.sha256`);if(!/^[0-9a-f]{64}$/.test(e))throw Error(`browser plugin "${t}" preparation.sha256 must be a 64-character hex string`);return{kind:"stylesheet",path:b(r.path,t,"preparation.path"),sha256:e}},B=(n,t)=>{let r=`browser plugin artifact manifest.plugins[${t}]`,e=y(n,r),i=g(e.identity,`${r}.identity`),a=e.hostInterfaceVersion;if(typeof a!=="number"||!Number.isInteger(a)||a<1)throw Error(`browser plugin "${i}" hostInterfaceVersion must be a positive integer`);let s=g(e.sha256,`browser plugin "${i}" sha256`);if(!/^[0-9a-f]{64}$/.test(s))throw Error(`browser plugin "${i}" sha256 must be a 64-character hex string`);return{identity:i,category:C(e.category,`browser plugin "${i}" category`),hostInterfaceVersion:a,path:b(e.path,i),sha256:s,...e.preparation!==void 0&&{preparation:k(e.preparation,i)}}},I=(n)=>{let t=y(n,"browser plugin artifact manifest");if(t.format!=="processfocus/browser-plugins")throw Error("browser plugin artifact manifest format must be processfocus/browser-plugins");if(t.version!==1)throw Error(`browser plugin artifact manifest version must be ${String(1)}`);if(!Array.isArray(t.plugins))throw Error("browser plugin artifact manifest.plugins must be an array");let r=t.plugins.map(B),e=new Set;for(let i of r){if(e.has(i.identity))throw Error(`browser plugin artifact manifest has duplicate identity "${i.identity}"`);e.add(i.identity)}return{format:"processfocus/browser-plugins",version:1,plugins:r}};var p=1;var h=(n,t)=>{if(typeof n!=="object"||n===null||Array.isArray(n))throw Error(`${t} must be an object`);return n},S=(n,t)=>{if(typeof n!=="string"||n.trim()==="")throw Error(`${t} must be a non-empty string`);return n},H=(n)=>{let r=h(JSON.parse(R(n,"utf8")),n).plugins;if(r===void 0)return[];let e=h(r,`${n}.plugins`);return["analytics","formComponents"].flatMap((i)=>{let a=e[i]??[];if(!Array.isArray(a))throw Error(`${n}.plugins.${i} must be an array`);return a.map((s,l)=>{let o=`${n}.plugins.${i}[${l}]`,d=h(s,o);return{category:i,module:S(d.module,`${o}.module`),type:S(d.type,`${o}.type`)}})})},N=(n)=>{for(let t of n.selections)if(!n.artifactIdentities.has(t.type))throw Error(`browser plugin "${t.type}" requires an organisation artifact entry in ${n.artifactManifestPath}`)},M=(n)=>{let t=c(n.artifactRoot,n.artifactPath);if(!t.startsWith(`${n.artifactRoot}${f}`))throw Error(`browser plugin "${n.identity}" ${n.artifactPathField} escapes the artifact root: ${n.artifactPath}`);if(!P(t)){let a=n.artifactPathField==="path"?"file":"preparation file";throw Error(`browser plugin "${n.identity}" ${a} is missing: ${n.artifactPath}`)}let r=w(t);if(!r.startsWith(`${n.realArtifactRoot}${f}`))throw Error(`browser plugin "${n.identity}" ${n.artifactPathField} escapes the artifact root through a symbolic link: ${n.artifactPath}`);if(!L(r).isFile())throw Error(`browser plugin "${n.identity}" ${n.artifactPathField} is not a file: ${n.artifactPath}`);let e=D("sha256").update(R(r)).digest("hex");if(e!==n.expectedSha256){let a=n.artifactPathField==="path"?"":"preparation ";throw Error(`browser plugin "${n.identity}" ${a}integrity mismatch for ${n.artifactPath}: expected ${n.expectedSha256}, got ${e}`)}V(n.outputDirectory,{recursive:!0});let i=c(n.outputDirectory,`${n.expectedSha256}${n.stagedExtension}`);return G(r,i),i},j=(n)=>{let t=F(n.manifestPath),r=c(t,A),e=c(F(n.outputModulePath),"browser-plugins");q(e,{recursive:!0,force:!0});let i=w(t);for(let o of[n.manifestPath,r])if(P(o)&&!w(o).startsWith(`${i}${f}`))throw Error(`plugin manifest escapes the selected organisation artifact root: ${o}`);if(!P(r))return N({selections:n.selections,artifactIdentities:new Set,artifactManifestPath:r}),[];let a;try{a=I(JSON.parse(R(r,"utf8")))}catch(o){throw Error(`browser plugin artifact manifest at ${r} is invalid: ${o instanceof Error?o.message:String(o)}`,{cause:o})}let s=new Map;for(let o of n.selections){if(s.has(o.type))throw Error(`frontend manifest has duplicate browser plugin identity "${o.type}"`);s.set(o.type,o)}N({selections:n.selections,artifactIdentities:new Set(a.plugins.map((o)=>o.identity)),artifactManifestPath:r});let l=c(t);return a.plugins.map((o)=>{let d=s.get(o.identity);if(!d)throw Error(`browser plugin "${o.identity}" has no matching frontend manifest selection`);if(d.category!==o.category)throw Error(`browser plugin "${o.identity}" declares category "${o.category}" but its frontend manifest selection is "${d.category}"`);if(o.hostInterfaceVersion!==p)throw Error(`browser plugin "${o.identity}" requires host interface version ${o.hostInterfaceVersion}, but the Dashboard provides ${p}`);let E=M({identity:o.identity,artifactPath:o.path,artifactPathField:"path",artifactRoot:l,expectedSha256:o.sha256,outputDirectory:e,realArtifactRoot:i,stagedExtension:".js"}),u=o.preparation;if(u===void 0)return{...o,stagedPath:E};let T=M({identity:o.identity,artifactPath:u.path,artifactPathField:"preparation.path",artifactRoot:l,expectedSha256:u.sha256,outputDirectory:e,realArtifactRoot:i,stagedExtension:".css"});return{...o,stagedPath:E,preparation:{...u,stagedPath:T}}})},x=(n,t)=>{let r=v(F(n),t).split(f).join("/");return r.startsWith(".")?r:`./${r}`},W=(n,t)=>{let r=n.map((s,l)=>{let o=JSON.stringify(x(t,s.stagedPath)),d=JSON.stringify(s.identity);return`const artifactLoader${l} = Object.assign(
3
3
  async (): Promise<boolean> => {
4
4
  const artifact = await import(${o})
5
5
  await host.activate(${d}, artifact.plugin)
@@ -31,5 +31,5 @@ ${a}
31
31
  `},J=(n,t)=>{let e=n.flatMap((i)=>i.preparation===void 0?[]:[`import ${JSON.stringify(x(t,i.preparation.stagedPath))}`]).join(`
32
32
  `);return`// Generated by prepare-build-inputs. Do not edit.
33
33
  ${e}${e?`
34
- `:""}`},U=(n)=>{let t=v(n.manifestPath),r=j({manifestPath:n.manifestPath,selections:t,outputModulePath:n.outputModulePath});m(n.outputModulePath,W(r,n.outputModulePath)),m(n.outputPreparationModulePath,J(r,n.outputPreparationModulePath)),m(n.outputReportPath,`${JSON.stringify({version:1,active:[...r.map((e)=>({source:"organisation-artifact",category:e.category,type:e.identity,path:e.path,sha256:e.sha256,hostInterfaceVersion:e.hostInterfaceVersion}))]},null,2)}
34
+ `:""}`},U=(n)=>{let t=H(n.manifestPath),r=j({manifestPath:n.manifestPath,selections:t,outputModulePath:n.outputModulePath});m(n.outputModulePath,W(r,n.outputModulePath)),m(n.outputPreparationModulePath,J(r,n.outputPreparationModulePath)),m(n.outputReportPath,`${JSON.stringify({version:1,active:[...r.map((e)=>({source:"organisation-artifact",category:e.category,type:e.identity,path:e.path,sha256:e.sha256,hostInterfaceVersion:e.hostInterfaceVersion}))]},null,2)}
35
35
  `)};if(import.meta.main){let[n,t,r,e]=process.argv.slice(2);if(!n||!t||!r||!e)throw Error("usage: generate-organisation-plugin-composition <manifest> <output-module> <output-preparation-module> <output-report>");U({manifestPath:n,outputModulePath:t,outputPreparationModulePath:r,outputReportPath:e})}export{U as generateOrganisationFrontendPluginComposition};
@@ -121,6 +121,7 @@ type ExecutionSteps {
121
121
  path: String!
122
122
  status: String!
123
123
  failureReason: String
124
+ notStartedReason: String
124
125
  role: ExecutionStepsRole
125
126
  submittedViaEmbeddedForm: Boolean
126
127
  externalSubmitterEmail: String
@@ -136,6 +137,7 @@ input ExecutionStepsInput {
136
137
  path: String!
137
138
  status: String!
138
139
  failureReason: String
140
+ notStartedReason: String
139
141
  role: ExecutionStepsRoleInput
140
142
  submittedViaEmbeddedForm: Boolean
141
143
  externalSubmitterEmail: String
@@ -157,6 +159,7 @@ type Execution implements RxDbDocument {
157
159
  status: String!
158
160
  failureReason: String
159
161
  abandonedReason: String
162
+ notStartedReason: String
160
163
  startedAt: DateTimeISO!
161
164
  finishedAt: DateTimeISO
162
165
  durationMs: Float
@@ -186,6 +189,7 @@ input ExecutionInputPushRowT0AssumedMasterStateT0 {
186
189
  status: String!
187
190
  failureReason: String
188
191
  abandonedReason: String
192
+ notStartedReason: String
189
193
  startedAt: DateTimeISO!
190
194
  finishedAt: DateTimeISO
191
195
  durationMs: Float
@@ -210,6 +214,7 @@ input ExecutionInputPushRowT0NewDocumentStateT0 {
210
214
  status: String!
211
215
  failureReason: String
212
216
  abandonedReason: String
217
+ notStartedReason: String
213
218
  startedAt: DateTimeISO!
214
219
  finishedAt: DateTimeISO
215
220
  durationMs: Float
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processfocus/runtime-local",
3
- "version": "0.1.0-next.0",
3
+ "version": "0.1.0-next.1",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,8 +27,8 @@
27
27
  "@opentelemetry/exporter-trace-otlp-http": "0.222.0",
28
28
  "@opentelemetry/sdk-metrics": "^2.11.0",
29
29
  "@opentelemetry/sdk-trace-base": "^2.11.0",
30
- "@processfocus/cli": "0.1.0-next.0",
31
- "@processfocus/runtime": "0.1.0-next.0",
30
+ "@processfocus/cli": "0.1.0-next.1",
31
+ "@processfocus/runtime": "0.1.0-next.1",
32
32
  "@tursodatabase/database": "0.7.2",
33
33
  "@tursodatabase/serverless": "1.4.0",
34
34
  "@tursodatabase/sync": "0.7.2",