@shipfox/expression 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +117 -0
  3. package/dist/evaluator/errors.d.ts +8 -0
  4. package/dist/evaluator/errors.d.ts.map +1 -0
  5. package/dist/evaluator/errors.js +13 -0
  6. package/dist/evaluator/errors.js.map +1 -0
  7. package/dist/evaluator/evaluate-workflow-expression.d.ts +11 -0
  8. package/dist/evaluator/evaluate-workflow-expression.d.ts.map +1 -0
  9. package/dist/evaluator/evaluate-workflow-expression.js +30 -0
  10. package/dist/evaluator/evaluate-workflow-expression.js.map +1 -0
  11. package/dist/evaluator/index.d.ts +3 -0
  12. package/dist/evaluator/index.d.ts.map +1 -0
  13. package/dist/evaluator/index.js +4 -0
  14. package/dist/evaluator/index.js.map +1 -0
  15. package/dist/expression/create-workflow-expression.d.ts +7 -0
  16. package/dist/expression/create-workflow-expression.d.ts.map +1 -0
  17. package/dist/expression/create-workflow-expression.js +156 -0
  18. package/dist/expression/create-workflow-expression.js.map +1 -0
  19. package/dist/expression/errors.d.ts +12 -0
  20. package/dist/expression/errors.d.ts.map +1 -0
  21. package/dist/expression/errors.js +13 -0
  22. package/dist/expression/errors.js.map +1 -0
  23. package/dist/expression/index.d.ts +4 -0
  24. package/dist/expression/index.d.ts.map +1 -0
  25. package/dist/expression/index.js +4 -0
  26. package/dist/expression/index.js.map +1 -0
  27. package/dist/expression/workflow-expression.d.ts +33 -0
  28. package/dist/expression/workflow-expression.d.ts.map +1 -0
  29. package/dist/expression/workflow-expression.js +3 -0
  30. package/dist/expression/workflow-expression.js.map +1 -0
  31. package/dist/index.d.ts +27 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +25 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/outputs/index.d.ts +2 -0
  36. package/dist/outputs/index.d.ts.map +1 -0
  37. package/dist/outputs/index.js +3 -0
  38. package/dist/outputs/index.js.map +1 -0
  39. package/dist/outputs/output-declarations.d.ts +39 -0
  40. package/dist/outputs/output-declarations.d.ts.map +1 -0
  41. package/dist/outputs/output-declarations.js +295 -0
  42. package/dist/outputs/output-declarations.js.map +1 -0
  43. package/dist/plan/bare-reference.d.ts +2 -0
  44. package/dist/plan/bare-reference.d.ts.map +1 -0
  45. package/dist/plan/bare-reference.js +23 -0
  46. package/dist/plan/bare-reference.js.map +1 -0
  47. package/dist/plan/context-key-access.d.ts +25 -0
  48. package/dist/plan/context-key-access.d.ts.map +1 -0
  49. package/dist/plan/context-key-access.js +249 -0
  50. package/dist/plan/context-key-access.js.map +1 -0
  51. package/dist/plan/evaluate-planned-predicate.d.ts +14 -0
  52. package/dist/plan/evaluate-planned-predicate.d.ts.map +1 -0
  53. package/dist/plan/evaluate-planned-predicate.js +31 -0
  54. package/dist/plan/evaluate-planned-predicate.js.map +1 -0
  55. package/dist/plan/evaluation-trace.d.ts +44 -0
  56. package/dist/plan/evaluation-trace.d.ts.map +1 -0
  57. package/dist/plan/evaluation-trace.js +95 -0
  58. package/dist/plan/evaluation-trace.js.map +1 -0
  59. package/dist/plan/extract-exact-context-roots.d.ts +2 -0
  60. package/dist/plan/extract-exact-context-roots.d.ts.map +1 -0
  61. package/dist/plan/extract-exact-context-roots.js +114 -0
  62. package/dist/plan/extract-exact-context-roots.js.map +1 -0
  63. package/dist/plan/fill.d.ts +3 -0
  64. package/dist/plan/fill.d.ts.map +1 -0
  65. package/dist/plan/fill.js +8 -0
  66. package/dist/plan/fill.js.map +1 -0
  67. package/dist/plan/freeze-run-command.d.ts +17 -0
  68. package/dist/plan/freeze-run-command.d.ts.map +1 -0
  69. package/dist/plan/freeze-run-command.js +33 -0
  70. package/dist/plan/freeze-run-command.js.map +1 -0
  71. package/dist/plan/freeze.d.ts +48 -0
  72. package/dist/plan/freeze.d.ts.map +1 -0
  73. package/dist/plan/freeze.js +148 -0
  74. package/dist/plan/freeze.js.map +1 -0
  75. package/dist/plan/plan-field.d.ts +26 -0
  76. package/dist/plan/plan-field.d.ts.map +1 -0
  77. package/dist/plan/plan-field.js +63 -0
  78. package/dist/plan/plan-field.js.map +1 -0
  79. package/dist/plan/predicate-shape.d.ts +2 -0
  80. package/dist/plan/predicate-shape.d.ts.map +1 -0
  81. package/dist/plan/predicate-shape.js +45 -0
  82. package/dist/plan/predicate-shape.js.map +1 -0
  83. package/dist/plan/resolved-field.d.ts +17 -0
  84. package/dist/plan/resolved-field.d.ts.map +1 -0
  85. package/dist/plan/resolved-field.js +3 -0
  86. package/dist/plan/resolved-field.js.map +1 -0
  87. package/dist/plan/route-expression.d.ts +9 -0
  88. package/dist/plan/route-expression.d.ts.map +1 -0
  89. package/dist/plan/route-expression.js +46 -0
  90. package/dist/plan/route-expression.js.map +1 -0
  91. package/dist/plan/validate-server-evaluable.d.ts +14 -0
  92. package/dist/plan/validate-server-evaluable.d.ts.map +1 -0
  93. package/dist/plan/validate-server-evaluable.js +20 -0
  94. package/dist/plan/validate-server-evaluable.js.map +1 -0
  95. package/dist/resolver/coerce-workflow-value-to-string.d.ts +2 -0
  96. package/dist/resolver/coerce-workflow-value-to-string.d.ts.map +1 -0
  97. package/dist/resolver/coerce-workflow-value-to-string.js +16 -0
  98. package/dist/resolver/coerce-workflow-value-to-string.js.map +1 -0
  99. package/dist/resolver/errors.d.ts +10 -0
  100. package/dist/resolver/errors.d.ts.map +1 -0
  101. package/dist/resolver/errors.js +12 -0
  102. package/dist/resolver/errors.js.map +1 -0
  103. package/dist/run/hoist-run-command.d.ts +33 -0
  104. package/dist/run/hoist-run-command.d.ts.map +1 -0
  105. package/dist/run/hoist-run-command.js +79 -0
  106. package/dist/run/hoist-run-command.js.map +1 -0
  107. package/dist/run/shell-quoting.d.ts +24 -0
  108. package/dist/run/shell-quoting.d.ts.map +1 -0
  109. package/dist/run/shell-quoting.js +364 -0
  110. package/dist/run/shell-quoting.js.map +1 -0
  111. package/dist/template/errors.d.ts +14 -0
  112. package/dist/template/errors.d.ts.map +1 -0
  113. package/dist/template/errors.js +14 -0
  114. package/dist/template/errors.js.map +1 -0
  115. package/dist/template/extract-cel-context-roots.d.ts +2 -0
  116. package/dist/template/extract-cel-context-roots.d.ts.map +1 -0
  117. package/dist/template/extract-cel-context-roots.js +110 -0
  118. package/dist/template/extract-cel-context-roots.js.map +1 -0
  119. package/dist/template/extract-cel-untrusted-path-accesses.d.ts +5 -0
  120. package/dist/template/extract-cel-untrusted-path-accesses.d.ts.map +1 -0
  121. package/dist/template/extract-cel-untrusted-path-accesses.js +140 -0
  122. package/dist/template/extract-cel-untrusted-path-accesses.js.map +1 -0
  123. package/dist/template/parse-workflow-template.d.ts +3 -0
  124. package/dist/template/parse-workflow-template.d.ts.map +1 -0
  125. package/dist/template/parse-workflow-template.js +111 -0
  126. package/dist/template/parse-workflow-template.js.map +1 -0
  127. package/dist/template/scan-cel-token.d.ts +3 -0
  128. package/dist/template/scan-cel-token.d.ts.map +1 -0
  129. package/dist/template/scan-cel-token.js +55 -0
  130. package/dist/template/scan-cel-token.js.map +1 -0
  131. package/dist/template/template-segment.d.ts +12 -0
  132. package/dist/template/template-segment.d.ts.map +1 -0
  133. package/dist/template/template-segment.js +3 -0
  134. package/dist/template/template-segment.js.map +1 -0
  135. package/dist/tsconfig.test.tsbuildinfo +1 -0
  136. package/dist/workflow-context/workflow-context.d.ts +458 -0
  137. package/dist/workflow-context/workflow-context.d.ts.map +1 -0
  138. package/dist/workflow-context/workflow-context.js +664 -0
  139. package/dist/workflow-context/workflow-context.js.map +1 -0
  140. package/package.json +49 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/workflow-context/workflow-context.ts"],"sourcesContent":["import type {ExpressionType, ExpressionTypeEnvironment} from '../expression/workflow-expression.js';\nimport {\n type OutputDeclarations,\n outputDeclarationsToExpressionFields,\n} from '../outputs/output-declarations.js';\n\nexport const workflowContextNames = [\n 'run',\n 'trigger',\n 'event',\n 'inputs',\n 'job',\n 'executions',\n 'execution',\n 'jobs',\n 'needs',\n 'steps',\n 'step',\n 'vars',\n 'secrets',\n] as const;\nexport type WorkflowContextName = (typeof workflowContextNames)[number];\n\nexport const availabilitySites = [\n // Server receives an external trigger or manual request before a run row exists.\n 'ingest',\n // Server creates the workflow run and its run-scoped context.\n 'run-creation',\n // Server creates a concrete job execution and its execution-scoped context.\n 'execution-creation',\n // Server activates a queued job after dependencies, matrix expansion, and runner demand are known.\n 'job-activation',\n // Server dispatches a job step to a runner with all server-filled context resolved.\n 'step-dispatch',\n // Server receives a step report and makes step result context available.\n 'step-report',\n // Server resolves one job execution after its steps have settled.\n 'execution-resolution',\n // Server resolves the job after all of its executions are known.\n 'job-resolution',\n] as const;\nexport type AvailabilitySite = (typeof availabilitySites)[number];\n\nexport const runnerFillTarget = 'runner-fill';\nexport type FillTarget = AvailabilitySite | typeof runnerFillTarget;\n\nexport const workflowContextSensitivities = ['persistable', 'ephemeral'] as const;\nexport type WorkflowContextSensitivity = (typeof workflowContextSensitivities)[number];\n\nexport const workflowContextHosts = ['server', 'runner'] as const;\nexport type WorkflowContextHost = (typeof workflowContextHosts)[number];\n\nexport type ReservedRootDefinition =\n | {readonly host: 'server'; readonly availability: AvailabilitySite}\n | {readonly host: 'runner'};\n\nexport const workflowContextReservedRoots = {\n matrix: {host: 'server', availability: 'job-activation'},\n runner: {host: 'runner'},\n} as const satisfies Record<string, ReservedRootDefinition>;\nexport type WorkflowContextReservedRoot = keyof typeof workflowContextReservedRoots;\n\nexport const workflowContextTrustTiers = ['trusted', 'untrusted'] as const;\nexport type WorkflowContextTrustTier = (typeof workflowContextTrustTiers)[number];\n\nexport type WorkflowContextShape = 'known' | 'open';\n\nexport interface TypedWorkflowContextDefinition {\n readonly availability: AvailabilitySite;\n readonly trustTier: WorkflowContextTrustTier;\n readonly sensitivity: WorkflowContextSensitivity;\n readonly host: 'server';\n readonly shape: 'known';\n readonly checkMode: 'typed';\n readonly typeEnvironment: ExpressionTypeEnvironment;\n readonly untrustedPaths?: readonly string[];\n}\n\nexport interface OpenWorkflowContextDefinition {\n readonly availability: AvailabilitySite;\n readonly trustTier: WorkflowContextTrustTier;\n readonly sensitivity: WorkflowContextSensitivity;\n readonly host: 'server';\n readonly shape: 'open';\n readonly checkMode: 'syntax';\n readonly literalKeyOnly?: boolean;\n}\n\nexport interface RunnerWorkflowContextDefinition {\n readonly trustTier: WorkflowContextTrustTier;\n readonly sensitivity: 'ephemeral';\n readonly host: 'runner';\n readonly shape: 'open';\n readonly checkMode: 'syntax';\n readonly literalKeyOnly?: boolean;\n}\n\nexport type WorkflowContextDefinition =\n | TypedWorkflowContextDefinition\n | OpenWorkflowContextDefinition\n | RunnerWorkflowContextDefinition;\n\nconst runTypeEnvironment = {\n run: {\n kind: 'object',\n fields: {\n id: 'string',\n name: 'string',\n definition_id: 'string',\n project_id: 'string',\n workspace_id: 'string',\n created_at: 'timestamp',\n },\n },\n} as const satisfies ExpressionTypeEnvironment;\n\nconst triggerTypeEnvironment = {\n trigger: {\n kind: 'object',\n fields: {\n source: 'string',\n event: 'string',\n },\n },\n} as const satisfies ExpressionTypeEnvironment;\n\nconst jobTypeEnvironment = {\n job: {\n kind: 'object',\n fields: {\n key: 'string',\n },\n },\n} as const satisfies ExpressionTypeEnvironment;\n\nconst executionEventType = {\n kind: 'object',\n fields: {\n source: 'string',\n event: 'string',\n delivery_id: 'string',\n received_at: 'timestamp',\n data: {\n kind: 'object',\n fields: {},\n },\n },\n} as const;\n\nconst executionType = {\n kind: 'object',\n fields: {\n index: 'int',\n name: 'string',\n status: 'string',\n failed: 'bool',\n started_at: 'timestamp',\n finished_at: 'timestamp',\n events: {\n kind: 'list',\n element: executionEventType,\n },\n outputs: {kind: 'map'},\n },\n} as const;\n\nconst executionsTypeEnvironment = {\n executions: {\n kind: 'list',\n element: executionType,\n },\n} as const satisfies ExpressionTypeEnvironment;\n\nconst executionTypeEnvironment = {\n execution: executionType,\n} as const satisfies ExpressionTypeEnvironment;\n\nconst stepGateType = {\n kind: 'object',\n fields: {\n passed: 'bool',\n source: 'string',\n reason: 'string',\n exit_code: 'int',\n },\n} as const;\n\nconst stepAttemptType = {\n kind: 'object',\n fields: {\n status: 'string',\n exit_code: 'int',\n outputs: {kind: 'map'},\n response: 'string',\n gate: stepGateType,\n },\n} as const;\n\nconst stepEntityType = {\n kind: 'object',\n fields: {\n ...stepAttemptType.fields,\n attempts: {\n kind: 'list',\n element: stepAttemptType,\n },\n },\n} as const;\n\nconst stepTypeEnvironment = {\n step: {\n kind: 'object',\n fields: {\n attempt: 'int',\n is_retry: 'bool',\n restart: {\n kind: 'object',\n fields: {\n from: stepEntityType,\n feedback: 'string',\n },\n },\n exit_code: 'int',\n status: 'string',\n outputs: {kind: 'map'},\n },\n },\n} as const satisfies ExpressionTypeEnvironment;\n\ntype ObjectExpressionType = Extract<ExpressionType, {kind: 'object'}>;\n\nexport interface WorkflowStepTypeOverlay {\n readonly key: string;\n readonly outputs?: OutputDeclarations;\n}\n\nexport interface WorkflowJobTypeOverlay {\n readonly key: string;\n readonly outputs?: Readonly<Record<string, ExpressionType>>;\n}\n\nexport function buildTypedRootsEnvironment(params: {\n readonly steps?: readonly WorkflowStepTypeOverlay[];\n readonly currentStep?: WorkflowStepTypeOverlay;\n readonly jobs?: readonly WorkflowJobTypeOverlay[];\n readonly needs?: readonly WorkflowJobTypeOverlay[];\n}): ExpressionTypeEnvironment {\n return {\n ...(params.steps === undefined ? {} : {steps: stepsRootType(params.steps)}),\n ...(params.currentStep === undefined ? {} : {step: selfStepType(params.currentStep)}),\n ...(params.jobs === undefined ? {} : {jobs: jobsRootType(params.jobs)}),\n ...(params.needs === undefined ? {} : {needs: needsRootType()}),\n };\n}\n\nexport const workflowContextDefinitions = {\n run: {\n availability: 'run-creation',\n trustTier: 'trusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'known',\n checkMode: 'typed',\n typeEnvironment: runTypeEnvironment,\n },\n trigger: {\n availability: 'ingest',\n trustTier: 'trusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'known',\n checkMode: 'typed',\n typeEnvironment: triggerTypeEnvironment,\n },\n event: {\n availability: 'ingest',\n trustTier: 'untrusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'open',\n checkMode: 'syntax',\n },\n inputs: {\n availability: 'run-creation',\n trustTier: 'untrusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'open',\n checkMode: 'syntax',\n },\n job: {\n availability: 'run-creation',\n trustTier: 'trusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'known',\n checkMode: 'typed',\n typeEnvironment: jobTypeEnvironment,\n },\n executions: {\n availability: 'execution-creation',\n trustTier: 'trusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'known',\n checkMode: 'typed',\n typeEnvironment: executionsTypeEnvironment,\n untrustedPaths: ['events'],\n },\n execution: {\n availability: 'execution-creation',\n trustTier: 'trusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'known',\n checkMode: 'typed',\n typeEnvironment: executionTypeEnvironment,\n untrustedPaths: ['events'],\n },\n jobs: {\n availability: 'job-activation',\n trustTier: 'untrusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'open',\n checkMode: 'syntax',\n },\n needs: {\n availability: 'job-activation',\n trustTier: 'untrusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'known',\n checkMode: 'typed',\n typeEnvironment: {needs: {kind: 'list', element: jobEntityType({key: '$need'})}},\n },\n steps: {\n availability: 'step-dispatch',\n trustTier: 'trusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'open',\n checkMode: 'syntax',\n },\n step: {\n availability: 'step-dispatch',\n trustTier: 'trusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'known',\n checkMode: 'typed',\n typeEnvironment: stepTypeEnvironment,\n untrustedPaths: ['outputs'],\n },\n vars: {\n availability: 'run-creation',\n trustTier: 'trusted',\n sensitivity: 'persistable',\n host: 'server',\n shape: 'open',\n checkMode: 'syntax',\n literalKeyOnly: true,\n },\n secrets: {\n trustTier: 'trusted',\n sensitivity: 'ephemeral',\n host: 'runner',\n shape: 'open',\n checkMode: 'syntax',\n literalKeyOnly: true,\n },\n} as const satisfies Record<WorkflowContextName, WorkflowContextDefinition>;\n\nexport type WorkflowInterpolationField =\n | 'run'\n | 'env.value'\n | 'agent.prompt'\n | 'agent.model'\n | 'agent.provider'\n | 'agent.thinking'\n | 'job.runner'\n | 'job.outputs'\n | 'job.name'\n | 'step.name'\n | 'step.feedback';\n\nexport const workflowFieldFailurePolicies = ['fail', 'degrade', 'fail-closed'] as const;\nexport type WorkflowFieldFailurePolicy = (typeof workflowFieldFailurePolicies)[number];\nexport type WorkflowInterpolationFailurePolicy = Exclude<WorkflowFieldFailurePolicy, 'fail-closed'>;\n\nexport interface WorkflowInterpolationFieldPolicy {\n readonly acceptedTrustTiers: readonly WorkflowContextTrustTier[];\n readonly acceptedHosts: readonly WorkflowContextHost[];\n readonly failurePolicy: WorkflowInterpolationFailurePolicy;\n readonly renderSanitize: boolean;\n readonly minimumFillTarget?: AvailabilitySite;\n}\n\nconst trustedOnlyTrustTiers: readonly WorkflowContextTrustTier[] = ['trusted'];\nconst anyTrustTier: readonly WorkflowContextTrustTier[] = ['trusted', 'untrusted'];\nconst serverOnlyHosts: readonly WorkflowContextHost[] = ['server'];\nconst anyHost: readonly WorkflowContextHost[] = ['server', 'runner'];\n\nexport const workflowInterpolationFieldPolicies = {\n run: {\n acceptedTrustTiers: trustedOnlyTrustTiers,\n acceptedHosts: anyHost,\n failurePolicy: 'fail',\n renderSanitize: false,\n },\n 'env.value': {\n acceptedTrustTiers: anyTrustTier,\n acceptedHosts: anyHost,\n failurePolicy: 'fail',\n renderSanitize: false,\n },\n 'agent.prompt': {\n acceptedTrustTiers: anyTrustTier,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'fail',\n renderSanitize: false,\n },\n 'agent.model': {\n acceptedTrustTiers: trustedOnlyTrustTiers,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'fail',\n renderSanitize: false,\n },\n 'agent.provider': {\n acceptedTrustTiers: trustedOnlyTrustTiers,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'fail',\n renderSanitize: false,\n },\n 'agent.thinking': {\n acceptedTrustTiers: trustedOnlyTrustTiers,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'fail',\n renderSanitize: false,\n },\n 'job.runner': {\n acceptedTrustTiers: anyTrustTier,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'fail',\n renderSanitize: false,\n },\n 'job.outputs': {\n acceptedTrustTiers: anyTrustTier,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'fail',\n renderSanitize: false,\n minimumFillTarget: 'execution-resolution',\n },\n 'job.name': {\n acceptedTrustTiers: anyTrustTier,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'degrade',\n renderSanitize: true,\n },\n 'step.name': {\n acceptedTrustTiers: anyTrustTier,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'degrade',\n renderSanitize: true,\n },\n 'step.feedback': {\n acceptedTrustTiers: anyTrustTier,\n acceptedHosts: serverOnlyHosts,\n failurePolicy: 'fail',\n renderSanitize: false,\n },\n} as const satisfies Record<WorkflowInterpolationField, WorkflowInterpolationFieldPolicy>;\n\nexport const workflowInterpolationFields = Object.keys(\n workflowInterpolationFieldPolicies,\n) as readonly WorkflowInterpolationField[];\n\nexport const workflowPredicateFields = [\n 'step.success',\n 'job.success',\n 'trigger.filter',\n 'listener.on',\n 'listener.until',\n 'job.if',\n 'step.if',\n] as const;\nexport type WorkflowPredicateField = (typeof workflowPredicateFields)[number];\n\nexport const workflowPredicateFieldFailurePolicy =\n 'fail-closed' as const satisfies WorkflowFieldFailurePolicy;\n\nconst workflowPredicateFieldMinimumFillTargets = {\n 'step.success': 'step-report',\n 'job.success': 'job-resolution',\n 'trigger.filter': 'ingest',\n 'listener.on': 'job-activation',\n 'listener.until': 'job-activation',\n 'job.if': 'job-activation',\n 'step.if': 'step-dispatch',\n} as const satisfies Record<WorkflowPredicateField, AvailabilitySite>;\n\nexport function getWorkflowContextDefinition(name: WorkflowContextName): WorkflowContextDefinition {\n return workflowContextDefinitions[name];\n}\n\nexport function getWorkflowContextAvailability(\n name: WorkflowContextName,\n): AvailabilitySite | undefined {\n const definition = workflowContextDefinitions[name];\n return definition.host === 'server' ? definition.availability : undefined;\n}\n\nexport function getWorkflowContextHost(name: WorkflowContextName): WorkflowContextHost {\n return workflowContextDefinitions[name].host;\n}\n\nexport function resolveContextRootHost(root: string): WorkflowContextHost | undefined {\n if (isWorkflowContextName(root)) return workflowContextDefinitions[root].host;\n if (isWorkflowContextReservedRoot(root)) return workflowContextReservedRoots[root].host;\n return undefined;\n}\n\nexport function resolveContextRootAvailability(root: string): AvailabilitySite | undefined {\n if (isWorkflowContextName(root)) {\n const definition = workflowContextDefinitions[root];\n return definition.host === 'server' ? definition.availability : undefined;\n }\n\n if (!isWorkflowContextReservedRoot(root)) return undefined;\n const reservedRoot = workflowContextReservedRoots[root];\n return reservedRoot.host === 'server' ? reservedRoot.availability : undefined;\n}\n\nexport function getWorkflowContextSensitivity(\n name: WorkflowContextName,\n): WorkflowContextSensitivity {\n return workflowContextDefinitions[name].sensitivity;\n}\n\nexport function rootsAvailableAt(site: AvailabilitySite): readonly WorkflowContextName[] {\n const targetSiteIndex = availabilitySites.indexOf(site);\n return workflowContextNames.filter((name) => {\n const definition = workflowContextDefinitions[name];\n return (\n definition.host === 'server' &&\n availabilitySites.indexOf(definition.availability) <= targetSiteIndex\n );\n });\n}\n\nexport function unavailableRootsAt(\n roots: readonly WorkflowContextName[],\n site: AvailabilitySite,\n): readonly WorkflowContextName[] {\n const availableRoots = new Set(rootsAvailableAt(site));\n return roots.filter((root) => !availableRoots.has(root));\n}\n\nexport function getWorkflowContextTypeEnvironment(\n name: WorkflowContextName,\n): ExpressionTypeEnvironment | undefined {\n const context = getWorkflowContextDefinition(name);\n return context.shape === 'known' ? context.typeEnvironment : undefined;\n}\n\nexport function getWorkflowContextUntrustedPaths(\n name: WorkflowContextName,\n): readonly string[] | undefined {\n const context = getWorkflowContextDefinition(name);\n return context.shape === 'known' ? context.untrustedPaths : undefined;\n}\n\nexport function workflowInterpolationFieldAcceptsTrustTier(\n field: WorkflowInterpolationField,\n trustTier: WorkflowContextTrustTier,\n): boolean {\n return workflowInterpolationFieldPolicies[field].acceptedTrustTiers.includes(trustTier);\n}\n\nexport function workflowInterpolationFieldAcceptsHost(\n field: WorkflowInterpolationField,\n host: WorkflowContextHost,\n): boolean {\n return workflowInterpolationFieldPolicies[field].acceptedHosts.includes(host);\n}\n\nexport function workflowInterpolationFieldAcceptsContext(\n field: WorkflowInterpolationField,\n context: WorkflowContextName,\n): boolean {\n return workflowInterpolationFieldAcceptsTrustTier(\n field,\n workflowContextDefinitions[context].trustTier,\n );\n}\n\nexport function workflowContextRootRequiresLiteralKey(root: string): boolean {\n if (!isWorkflowContextName(root)) return false;\n const definition = workflowContextDefinitions[root];\n return 'literalKeyOnly' in definition && definition.literalKeyOnly === true;\n}\n\nexport function getWorkflowInterpolationFieldFailurePolicy(\n field: WorkflowInterpolationField,\n): WorkflowInterpolationFailurePolicy {\n return workflowInterpolationFieldPolicies[field].failurePolicy;\n}\n\nexport function getWorkflowInterpolationFieldMinimumFillTarget(\n field: WorkflowInterpolationField,\n): AvailabilitySite | undefined {\n const policy = workflowInterpolationFieldPolicies[field];\n return 'minimumFillTarget' in policy ? policy.minimumFillTarget : undefined;\n}\n\nexport function getWorkflowPredicateFieldMinimumFillTarget(\n field: WorkflowPredicateField,\n): AvailabilitySite {\n return workflowPredicateFieldMinimumFillTargets[field];\n}\n\nexport interface WorkflowContextAvailabilityReferenceEntry {\n readonly root: WorkflowContextName | WorkflowContextReservedRoot;\n readonly availability?: AvailabilitySite;\n readonly reserved: boolean;\n readonly availableAt: Readonly<Record<AvailabilitySite, boolean>>;\n}\n\nexport function workflowContextAvailabilityReference(): readonly WorkflowContextAvailabilityReferenceEntry[] {\n return [\n ...workflowContextNames.map((root) => {\n const definition = workflowContextDefinitions[root];\n if (definition.host === 'runner') return noServerAvailabilityReferenceEntry(root, false);\n return availabilityReferenceEntry(root, definition.availability, false);\n }),\n ...Object.entries(workflowContextReservedRoots).map(([root, definition]) => {\n if (definition.host === 'runner') {\n return noServerAvailabilityReferenceEntry(root as WorkflowContextReservedRoot, true);\n }\n return availabilityReferenceEntry(\n root as WorkflowContextReservedRoot,\n definition.availability,\n true,\n );\n }),\n ];\n}\n\nfunction availabilityReferenceEntry(\n root: WorkflowContextName | WorkflowContextReservedRoot,\n availability: AvailabilitySite,\n reserved: boolean,\n): WorkflowContextAvailabilityReferenceEntry {\n const availabilityIndex = availabilitySites.indexOf(availability);\n const availableAt = Object.fromEntries(\n availabilitySites.map((site) => [site, availabilitySites.indexOf(site) >= availabilityIndex]),\n ) as Record<AvailabilitySite, boolean>;\n\n return {root, availability, reserved, availableAt};\n}\n\nfunction noServerAvailabilityReferenceEntry(\n root: WorkflowContextName | WorkflowContextReservedRoot,\n reserved: boolean,\n): WorkflowContextAvailabilityReferenceEntry {\n const availableAt = Object.fromEntries(availabilitySites.map((site) => [site, false])) as Record<\n AvailabilitySite,\n boolean\n >;\n\n return {root, reserved, availableAt};\n}\n\nfunction stepsRootType(steps: readonly WorkflowStepTypeOverlay[]): ExpressionType {\n return {\n kind: 'object',\n fields: Object.fromEntries(steps.map((step) => [step.key, stepEntityTypeForStep(step)])),\n };\n}\n\nfunction stepEntityTypeForStep(step: WorkflowStepTypeOverlay): ExpressionType {\n const attemptType = stepAttemptTypeForOutputs(outputsTypeForStep(step));\n return {\n kind: 'object',\n fields: {\n ...attemptType.fields,\n attempts: {\n kind: 'list',\n element: attemptType,\n },\n },\n };\n}\n\nfunction selfStepType(step: WorkflowStepTypeOverlay): ExpressionType {\n return {\n kind: 'object',\n fields: {\n ...stepTypeEnvironment.step.fields,\n outputs: outputsTypeForStep(step),\n },\n };\n}\n\nfunction stepAttemptTypeForOutputs(outputs: ExpressionType): ObjectExpressionType {\n return {\n kind: 'object',\n fields: {\n ...stepAttemptType.fields,\n outputs,\n },\n };\n}\n\nfunction outputsTypeForStep(step: WorkflowStepTypeOverlay): ExpressionType {\n if (step.outputs === undefined) return {kind: 'map'};\n return {kind: 'object', fields: outputDeclarationsToExpressionFields(step.outputs)};\n}\n\nfunction jobsRootType(jobs: readonly WorkflowJobTypeOverlay[]): ExpressionType {\n return {\n kind: 'object',\n fields: Object.fromEntries(jobs.map((job) => [job.key, jobEntityType(job)])),\n };\n}\n\nfunction needsRootType(): ExpressionType {\n return {\n kind: 'list',\n element: jobEntityTypeForNeeds(),\n };\n}\n\nfunction jobEntityTypeForNeeds(): ExpressionType {\n return {\n kind: 'object',\n fields: {\n key: 'string',\n status: 'string',\n outputs: {kind: 'map'},\n executions: {\n kind: 'list',\n element: executionTypeWithOutputs({kind: 'map'}),\n },\n },\n };\n}\n\nfunction jobEntityType(job: WorkflowJobTypeOverlay): ExpressionType {\n const outputs = jobOutputsType(job);\n const execution = executionTypeWithOutputs(outputs);\n return {\n kind: 'object',\n fields: {\n key: 'string',\n status: 'string',\n outputs,\n executions: {\n kind: 'list',\n element: execution,\n },\n },\n };\n}\n\nfunction jobOutputsType(job: WorkflowJobTypeOverlay): ExpressionType {\n return job.outputs === undefined\n ? ({kind: 'map'} as const satisfies ExpressionType)\n : ({kind: 'object', fields: job.outputs} as const satisfies ExpressionType);\n}\n\nfunction executionTypeWithOutputs(outputs: ExpressionType): ExpressionType {\n return {\n kind: 'object',\n fields: {\n ...executionType.fields,\n outputs,\n },\n };\n}\n\nfunction isWorkflowContextName(root: string): root is WorkflowContextName {\n return Object.hasOwn(workflowContextDefinitions, root);\n}\n\nfunction isWorkflowContextReservedRoot(root: string): root is WorkflowContextReservedRoot {\n return Object.hasOwn(workflowContextReservedRoots, root);\n}\n"],"names":["outputDeclarationsToExpressionFields","workflowContextNames","availabilitySites","runnerFillTarget","workflowContextSensitivities","workflowContextHosts","workflowContextReservedRoots","matrix","host","availability","runner","workflowContextTrustTiers","runTypeEnvironment","run","kind","fields","id","name","definition_id","project_id","workspace_id","created_at","triggerTypeEnvironment","trigger","source","event","jobTypeEnvironment","job","key","executionEventType","delivery_id","received_at","data","executionType","index","status","failed","started_at","finished_at","events","element","outputs","executionsTypeEnvironment","executions","executionTypeEnvironment","execution","stepGateType","passed","reason","exit_code","stepAttemptType","response","gate","stepEntityType","attempts","stepTypeEnvironment","step","attempt","is_retry","restart","from","feedback","buildTypedRootsEnvironment","params","steps","undefined","stepsRootType","currentStep","selfStepType","jobs","jobsRootType","needs","needsRootType","workflowContextDefinitions","trustTier","sensitivity","shape","checkMode","typeEnvironment","inputs","untrustedPaths","jobEntityType","vars","literalKeyOnly","secrets","workflowFieldFailurePolicies","trustedOnlyTrustTiers","anyTrustTier","serverOnlyHosts","anyHost","workflowInterpolationFieldPolicies","acceptedTrustTiers","acceptedHosts","failurePolicy","renderSanitize","minimumFillTarget","workflowInterpolationFields","Object","keys","workflowPredicateFields","workflowPredicateFieldFailurePolicy","workflowPredicateFieldMinimumFillTargets","getWorkflowContextDefinition","getWorkflowContextAvailability","definition","getWorkflowContextHost","resolveContextRootHost","root","isWorkflowContextName","isWorkflowContextReservedRoot","resolveContextRootAvailability","reservedRoot","getWorkflowContextSensitivity","rootsAvailableAt","site","targetSiteIndex","indexOf","filter","unavailableRootsAt","roots","availableRoots","Set","has","getWorkflowContextTypeEnvironment","context","getWorkflowContextUntrustedPaths","workflowInterpolationFieldAcceptsTrustTier","field","includes","workflowInterpolationFieldAcceptsHost","workflowInterpolationFieldAcceptsContext","workflowContextRootRequiresLiteralKey","getWorkflowInterpolationFieldFailurePolicy","getWorkflowInterpolationFieldMinimumFillTarget","policy","getWorkflowPredicateFieldMinimumFillTarget","workflowContextAvailabilityReference","map","noServerAvailabilityReferenceEntry","availabilityReferenceEntry","entries","reserved","availabilityIndex","availableAt","fromEntries","stepEntityTypeForStep","attemptType","stepAttemptTypeForOutputs","outputsTypeForStep","jobEntityTypeForN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",
4
+ "private": false,
5
+ "version": "1.1.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
9
+ "directory": "libs/shared/expression"
10
+ },
11
+ "type": "module",
12
+ "main": "dist/index.js",
13
+ "types": "dist/index.d.ts",
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "exports": {
18
+ ".": {
19
+ "development": {
20
+ "types": "./src/index.ts",
21
+ "default": "./src/index.ts"
22
+ },
23
+ "default": {
24
+ "types": "./dist/index.d.ts",
25
+ "default": "./dist/index.js"
26
+ }
27
+ }
28
+ },
29
+ "dependencies": {
30
+ "@marcbachmann/cel-js": "7.6.1",
31
+ "ajv": "8.20.0",
32
+ "@shipfox/workflow-document": "2.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "@shipfox/biome": "1.8.1",
36
+ "@shipfox/typescript": "1.1.6",
37
+ "@shipfox/swc": "1.2.5",
38
+ "@shipfox/ts-config": "1.3.7",
39
+ "@shipfox/vitest": "1.2.2"
40
+ },
41
+ "scripts": {
42
+ "build": "shipfox-swc",
43
+ "check": "shipfox-biome-check",
44
+ "check:fix": "shipfox-biome-check --write",
45
+ "test": "shipfox-vitest-run",
46
+ "type": "shipfox-tsc-check",
47
+ "type:emit": "shipfox-tsc-emit"
48
+ }
49
+ }