@lessly/sdk-app 67.3.0 → 67.5.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.
@@ -111051,6 +111051,57 @@ has_more: boolean
111051
111051
  next_cursor: (string | null)
111052
111052
  }
111053
111053
 
111054
+ export interface WorkflowCapListInput {
111055
+
111056
+ }
111057
+
111058
+ export interface WorkflowCapListOutput {
111059
+ items: {
111060
+ /**
111061
+ * Spent in the window running now. Null when the key is contested — the runs spent against several different windows and no one number is the truth.
111062
+ */
111063
+ used: (number | null)
111064
+ /**
111065
+ * Null when the declarations disagree.
111066
+ */
111067
+ limit: (number | null)
111068
+ /**
111069
+ * Null when the declarations disagree: no single window is true for the key.
111070
+ */
111071
+ window: (string | null)
111072
+ cap_key: string
111073
+ /**
111074
+ * `limit - used`, or null when either is unknown.
111075
+ */
111076
+ remaining: (number | null)
111077
+ /**
111078
+ * Who shares this budget. Empty for a key that has counters but no live declaration.
111079
+ */
111080
+ workflows: {
111081
+ name: string
111082
+ /**
111083
+ * What THIS workflow declared.
111084
+ */
111085
+ limit: number
111086
+ /**
111087
+ * What THIS workflow declared. Always true, even when the key is contested.
111088
+ */
111089
+ window: string
111090
+ /**
111091
+ * The cap node in that workflow’s live version, loop bodies included.
111092
+ */
111093
+ node_id: string
111094
+ version: number
111095
+ workflow_id: string
111096
+ }[]
111097
+ /**
111098
+ * Two live workflows declare different budgets under this one key.
111099
+ */
111100
+ conflicting: boolean
111101
+ window_start: (string | null)
111102
+ }[]
111103
+ }
111104
+
111054
111105
  export interface WorkflowCapabilityGetInput {
111055
111106
  /**
111056
111107
  * Tool name of an action (e.g. "mail_email_send") or event name of a trigger.
@@ -111064,7 +111115,7 @@ http?: ({
111064
111115
  path: string
111065
111116
  method: string
111066
111117
  } | null)
111067
- kind: ("action" | "event" | "schedule" | "manual")
111118
+ kind: ("action" | "event" | "schedule" | "batch" | "manual")
111068
111119
  title: string
111069
111120
  schema?: {
111070
111121
  [k: string]: unknown
@@ -111118,7 +111169,7 @@ http?: ({
111118
111169
  path: string
111119
111170
  method: string
111120
111171
  } | null)
111121
- kind: ("action" | "event" | "schedule" | "manual")
111172
+ kind: ("action" | "event" | "schedule" | "batch" | "manual")
111122
111173
  title: string
111123
111174
  schema?: {
111124
111175
  [k: string]: unknown
@@ -111524,6 +111575,37 @@ description: (string | null)
111524
111575
  live_version: (number | null)
111525
111576
  }
111526
111577
 
111578
+ export interface WorkflowDefinitionEstimateInput {
111579
+ /**
111580
+ * A workflow definition: trigger, nodes, edges, grants, config_refs.
111581
+ */
111582
+ definition?: {
111583
+ [k: string]: unknown
111584
+ }
111585
+ workflow_id?: string
111586
+ }
111587
+
111588
+ /**
111589
+ * There is deliberately no `count` on `unavailable`: "we could not ask" and "nobody is in the audience" are opposite facts. `grant_missing` is the ordinary answer for an unpublished draft — the source's grant arrives at publish.
111590
+ */
111591
+ export type WorkflowDefinitionEstimateOutput = ({
111592
+ /**
111593
+ * Runs one tick would start: the trigger filter is applied. A floor when `exact` is false.
111594
+ */
111595
+ count: number
111596
+ /**
111597
+ * False when the page budget ran out before the source did; `count` is then "at least this many".
111598
+ */
111599
+ exact: boolean
111600
+ status: "counted"
111601
+ counted_pages: number
111602
+ page_limit_reached: boolean
111603
+ } | {
111604
+ reason: ("unknown_tool" | "not_a_batch_trigger" | "source_failed" | "grant_missing")
111605
+ status: "unavailable"
111606
+ counted_pages: number
111607
+ })
111608
+
111527
111609
  export interface WorkflowDefinitionExportInput {
111528
111610
  /**
111529
111611
  * Defaults to the live version.
@@ -112422,6 +112504,10 @@ started_at: (string | null)
112422
112504
  held_reason?: {
112423
112505
  [k: string]: unknown
112424
112506
  }
112507
+ /**
112508
+ * Who this run is about, rendered once from the definition’s `subject` at run start and frozen. Null when the workflow declares no subject.
112509
+ */
112510
+ subject_key: (string | null)
112425
112511
  workflow_id: string
112426
112512
  trigger_event_id: string
112427
112513
  replay_generation: number
@@ -112449,6 +112535,10 @@ started_at: (string | null)
112449
112535
  held_reason?: {
112450
112536
  [k: string]: unknown
112451
112537
  }
112538
+ /**
112539
+ * Who this run is about, rendered once from the definition’s `subject` at run start and frozen. Null when the workflow declares no subject.
112540
+ */
112541
+ subject_key: (string | null)
112452
112542
  workflow_id: string
112453
112543
  trigger_event_id: string
112454
112544
  replay_generation: number
@@ -112496,6 +112586,10 @@ limit?: number
112496
112586
  */
112497
112587
  cursor?: string
112498
112588
  status?: ("created" | "queued" | "running" | "waiting" | "succeeded" | "failed" | "held" | "cancelled" | "paused_ceiling")
112589
+ /**
112590
+ * Every run about one subject — the frozen key, not the template.
112591
+ */
112592
+ subject_key?: string
112499
112593
  workflow_id?: string
112500
112594
  }
112501
112595
 
@@ -112517,6 +112611,10 @@ started_at: (string | null)
112517
112611
  held_reason?: {
112518
112612
  [k: string]: unknown
112519
112613
  }
112614
+ /**
112615
+ * Who this run is about, rendered once from the definition’s `subject` at run start and frozen. Null when the workflow declares no subject.
112616
+ */
112617
+ subject_key: (string | null)
112520
112618
  workflow_id: string
112521
112619
  trigger_event_id: string
112522
112620
  replay_generation: number
@@ -112549,6 +112647,10 @@ started_at: (string | null)
112549
112647
  held_reason?: {
112550
112648
  [k: string]: unknown
112551
112649
  }
112650
+ /**
112651
+ * Who this run is about, rendered once from the definition’s `subject` at run start and frozen. Null when the workflow declares no subject.
112652
+ */
112653
+ subject_key: (string | null)
112552
112654
  workflow_id: string
112553
112655
  trigger_event_id: string
112554
112656
  replay_generation: number
@@ -112685,11 +112787,213 @@ started_at: (string | null)
112685
112787
  held_reason?: {
112686
112788
  [k: string]: unknown
112687
112789
  }
112790
+ /**
112791
+ * Who this run is about, rendered once from the definition’s `subject` at run start and frozen. Null when the workflow declares no subject.
112792
+ */
112793
+ subject_key: (string | null)
112688
112794
  workflow_id: string
112689
112795
  trigger_event_id: string
112690
112796
  replay_generation: number
112691
112797
  }
112692
112798
 
112799
+ export interface WorkflowTemplateApplyInput {
112800
+ /**
112801
+ * Defaults to the template's own name.
112802
+ */
112803
+ name?: string
112804
+ template_id: string
112805
+ }
112806
+
112807
+ export interface WorkflowTemplateApplyOutput {
112808
+ live: ({
112809
+ note: (string | null)
112810
+ version: number
112811
+ published_at: (string | null)
112812
+ } | null)
112813
+ draft: ({
112814
+ [k: string]: unknown
112815
+ } | null)
112816
+ /**
112817
+ * The workflow principal's grants; null when Governance could not be reached.
112818
+ */
112819
+ grants: ({
112820
+ /**
112821
+ * What to do next, when something needs doing; null when nothing does.
112822
+ */
112823
+ hint: (string | null)
112824
+ grants: {
112825
+ /**
112826
+ * "approved" is the only status a call gets through on.
112827
+ */
112828
+ status: ("pending" | "approved" | "revoked" | "needs_sponsor")
112829
+ tool_key: string
112830
+ approved_at: (string | null)
112831
+ /**
112832
+ * The member who vouches for the grant.
112833
+ */
112834
+ sponsor_member_id: (string | null)
112835
+ }[]
112836
+ /**
112837
+ * Tool keys asked for and waiting on a human.
112838
+ */
112839
+ pending: string[]
112840
+ /**
112841
+ * Tool keys a human withdrew. Approving one again is not enough: Governance does not resurrect a revoked grant, so it has to be asked for first.
112842
+ */
112843
+ revoked: string[]
112844
+ /**
112845
+ * Tool keys the workflow may call right now.
112846
+ */
112847
+ effective: string[]
112848
+ /**
112849
+ * Tool keys that were approved and lost their sponsor.
112850
+ */
112851
+ needs_sponsor: string[]
112852
+ } | null)
112853
+ /**
112854
+ * What the dependency check found; null when nothing is unknown.
112855
+ */
112856
+ health: ({
112857
+ unknown: {
112858
+ kind: ("trigger" | "action")
112859
+ name: string
112860
+ reason: ("missing" | "schema_changed")
112861
+ node_id?: string
112862
+ toolkit: string
112863
+ }[]
112864
+ /**
112865
+ * What a recovery restores.
112866
+ */
112867
+ previous_status?: ("draft" | "enabled" | "disabled")
112868
+ } | null)
112869
+ /**
112870
+ * Validation of the draft as it stands right now.
112871
+ */
112872
+ issues: {
112873
+ /**
112874
+ * A documented issue code; repair by reacting to this, not to prose.
112875
+ */
112876
+ code: string
112877
+ hint?: string
112878
+ /**
112879
+ * JSON Pointer into the definition.
112880
+ */
112881
+ path: string
112882
+ actual?: string
112883
+ node_id?: string
112884
+ expected?: string
112885
+ severity: ("error" | "warning")
112886
+ }[]
112887
+ /**
112888
+ * The last 20 health entries, newest first; `workflow_health_list` pages the rest.
112889
+ */
112890
+ timeline: {
112891
+ at: string
112892
+ fix?: unknown
112893
+ /**
112894
+ * `broken`, `recovered`, `grants_pending`, `grant_revoked`, `sponsor_gone`, `grants_ok` and whatever the dispatcher and the executor record beside them.
112895
+ */
112896
+ kind: string
112897
+ detail?: unknown
112898
+ }[]
112899
+ workflow: {
112900
+ id: string
112901
+ name: string
112902
+ /**
112903
+ * `broken` is the dependency check's, not an operator's: a capability is gone.
112904
+ */
112905
+ status: ("draft" | "enabled" | "disabled" | "broken")
112906
+ /**
112907
+ * What starts this workflow and how big it is, without fetching the definition. Taken from the live version when one is live, from the draft otherwise.
112908
+ */
112909
+ summary: {
112910
+ /**
112911
+ * What starts the workflow; null when the definition declares no trigger.
112912
+ */
112913
+ trigger: ({
112914
+ /**
112915
+ * Set for `schedule` and `batch`; null otherwise.
112916
+ */
112917
+ cron: (string | null)
112918
+ kind: ("event" | "schedule" | "batch" | "manual")
112919
+ /**
112920
+ * The event name for `event`, the source tool for `batch`; null otherwise.
112921
+ */
112922
+ name: (string | null)
112923
+ } | null)
112924
+ /**
112925
+ * Steps in the graph; a loop counts as one.
112926
+ */
112927
+ node_count: number
112928
+ }
112929
+ /**
112930
+ * What is stopping an otherwise published workflow; null when nothing is.
112931
+ */
112932
+ attention: ({
112933
+ code: ("grants_pending" | "sponsor_gone" | "grant_revoked" | "rate_limited" | "auto_disable_warning")
112934
+ detail: {
112935
+ /**
112936
+ * Set instead when Governance could not be asked.
112937
+ */
112938
+ error?: string
112939
+ /**
112940
+ * The tools still waiting on a sponsor.
112941
+ */
112942
+ tools?: string[]
112943
+ }
112944
+ } | null)
112945
+ created_at: string
112946
+ updated_at: string
112947
+ description: (string | null)
112948
+ live_version: (number | null)
112949
+ }
112950
+ /**
112951
+ * What the live version was validated against, with the hashes it saw.
112952
+ */
112953
+ dependencies: {
112954
+ kind: ("trigger" | "action")
112955
+ /**
112956
+ * The event name of the trigger, or the tool name of the action.
112957
+ */
112958
+ name: string
112959
+ toolkit: string
112960
+ /**
112961
+ * The hash the capability had at publish; a drift means broken.
112962
+ */
112963
+ schema_hash: string
112964
+ }[]
112965
+ }
112966
+
112967
+ export interface WorkflowTemplateListInput {
112968
+
112969
+ }
112970
+
112971
+ export interface WorkflowTemplateListOutput {
112972
+ items: {
112973
+ id: string
112974
+ name: string
112975
+ /**
112976
+ * Empty when applicable. An inapplicable template is shown with this, never hidden.
112977
+ */
112978
+ missing: {
112979
+ /**
112980
+ * The tool name or event name the template needs.
112981
+ */
112982
+ key: string
112983
+ kind: ("tool" | "event")
112984
+ /**
112985
+ * Why this template cannot work without it, as a sentence to show a person.
112986
+ */
112987
+ reason: string
112988
+ }[]
112989
+ /**
112990
+ * False when something in `missing` is not registered on this Product.
112991
+ */
112992
+ applicable: boolean
112993
+ description: string
112994
+ }[]
112995
+ }
112996
+
112693
112997
  export interface WorkflowVersionGetInput {
112694
112998
  /**
112695
112999
  * 0 is the draft.
@@ -1,3 +1,3 @@
1
1
  // AUTOGENERATED by scripts/generate.ts — do not edit.
2
2
  export * from './queryOptions.gen';
3
- export type { WorkflowCapabilityGetInput, WorkflowCapabilityGetOutput, WorkflowCapabilityListInput, WorkflowCapabilityListOutput, WorkflowConfigDeleteInput, WorkflowConfigDeleteOutput, WorkflowConfigListInput, WorkflowConfigListOutput, WorkflowConfigSetInput, WorkflowConfigSetOutput, WorkflowDefinitionCreateInput, WorkflowDefinitionCreateOutput, WorkflowDefinitionDisableInput, WorkflowDefinitionDisableOutput, WorkflowDefinitionDryrunInput, WorkflowDefinitionDryrunOutput, WorkflowDefinitionEnableInput, WorkflowDefinitionEnableOutput, WorkflowDefinitionExportInput, WorkflowDefinitionExportOutput, WorkflowDefinitionGetInput, WorkflowDefinitionGetOutput, WorkflowDefinitionImportInput, WorkflowDefinitionImportOutput, WorkflowDefinitionListInput, WorkflowDefinitionListOutput, WorkflowDefinitionPublishInput, WorkflowDefinitionPublishOutput, WorkflowDefinitionUpdateInput, WorkflowDefinitionUpdateOutput, WorkflowDefinitionValidateInput, WorkflowDefinitionValidateOutput, WorkflowDependencyListInput, WorkflowDependencyListOutput, WorkflowGrantListInput, WorkflowGrantListOutput, WorkflowGrantRequestInput, WorkflowGrantRequestOutput, WorkflowHealthListInput, WorkflowHealthListOutput, WorkflowHealthPingInput, WorkflowHealthPingOutput, WorkflowKillswitchGetInput, WorkflowKillswitchGetOutput, WorkflowKillswitchSetInput, WorkflowKillswitchSetOutput, WorkflowRunCancelInput, WorkflowRunCancelOutput, WorkflowRunGetInput, WorkflowRunGetOutput, WorkflowRunListInput, WorkflowRunListOutput, WorkflowRunReplayAllInput, WorkflowRunReplayAllOutput, WorkflowRunReplayInput, WorkflowRunReplayOutput, WorkflowRunStartInput, WorkflowRunStartOutput, WorkflowRunStatsInput, WorkflowRunStatsOutput, WorkflowRunTestInput, WorkflowRunTestOutput, WorkflowVersionGetInput, WorkflowVersionGetOutput, WorkflowVersionListInput, WorkflowVersionListOutput, WorkflowWaitGetInput, WorkflowWaitGetOutput, WorkflowWaitListAllInput, WorkflowWaitListAllOutput, WorkflowWaitListInput, WorkflowWaitListOutput, WorkflowWaitResolveInput, WorkflowWaitResolveOutput } from '../types.gen';
3
+ export type { WorkflowCapListInput, WorkflowCapListOutput, WorkflowCapabilityGetInput, WorkflowCapabilityGetOutput, WorkflowCapabilityListInput, WorkflowCapabilityListOutput, WorkflowConfigDeleteInput, WorkflowConfigDeleteOutput, WorkflowConfigListInput, WorkflowConfigListOutput, WorkflowConfigSetInput, WorkflowConfigSetOutput, WorkflowDefinitionCreateInput, WorkflowDefinitionCreateOutput, WorkflowDefinitionDisableInput, WorkflowDefinitionDisableOutput, WorkflowDefinitionDryrunInput, WorkflowDefinitionDryrunOutput, WorkflowDefinitionEnableInput, WorkflowDefinitionEnableOutput, WorkflowDefinitionEstimateInput, WorkflowDefinitionEstimateOutput, WorkflowDefinitionExportInput, WorkflowDefinitionExportOutput, WorkflowDefinitionGetInput, WorkflowDefinitionGetOutput, WorkflowDefinitionImportInput, WorkflowDefinitionImportOutput, WorkflowDefinitionListInput, WorkflowDefinitionListOutput, WorkflowDefinitionPublishInput, WorkflowDefinitionPublishOutput, WorkflowDefinitionUpdateInput, WorkflowDefinitionUpdateOutput, WorkflowDefinitionValidateInput, WorkflowDefinitionValidateOutput, WorkflowDependencyListInput, WorkflowDependencyListOutput, WorkflowGrantListInput, WorkflowGrantListOutput, WorkflowGrantRequestInput, WorkflowGrantRequestOutput, WorkflowHealthListInput, WorkflowHealthListOutput, WorkflowHealthPingInput, WorkflowHealthPingOutput, WorkflowKillswitchGetInput, WorkflowKillswitchGetOutput, WorkflowKillswitchSetInput, WorkflowKillswitchSetOutput, WorkflowRunCancelInput, WorkflowRunCancelOutput, WorkflowRunGetInput, WorkflowRunGetOutput, WorkflowRunListInput, WorkflowRunListOutput, WorkflowRunReplayAllInput, WorkflowRunReplayAllOutput, WorkflowRunReplayInput, WorkflowRunReplayOutput, WorkflowRunStartInput, WorkflowRunStartOutput, WorkflowRunStatsInput, WorkflowRunStatsOutput, WorkflowRunTestInput, WorkflowRunTestOutput, WorkflowTemplateApplyInput, WorkflowTemplateApplyOutput, WorkflowTemplateListInput, WorkflowTemplateListOutput, WorkflowVersionGetInput, WorkflowVersionGetOutput, WorkflowVersionListInput, WorkflowVersionListOutput, WorkflowWaitGetInput, WorkflowWaitGetOutput, WorkflowWaitListAllInput, WorkflowWaitListAllOutput, WorkflowWaitListInput, WorkflowWaitListOutput, WorkflowWaitResolveInput, WorkflowWaitResolveOutput } from '../types.gen';
@@ -1,6 +1,8 @@
1
1
  // AUTOGENERATED by scripts/generate.ts — do not edit.
2
2
  import type { GeneratedClient } from '../client.gen';
3
3
  import type {
4
+ WorkflowCapListInput,
5
+ WorkflowCapListOutput,
4
6
  WorkflowCapabilityGetInput,
5
7
  WorkflowCapabilityGetOutput,
6
8
  WorkflowCapabilityListInput,
@@ -14,6 +16,8 @@ import type {
14
16
  WorkflowDefinitionDryrunInput,
15
17
  WorkflowDefinitionDryrunOutput,
16
18
  WorkflowDefinitionEnableInput,
19
+ WorkflowDefinitionEstimateInput,
20
+ WorkflowDefinitionEstimateOutput,
17
21
  WorkflowDefinitionExportInput,
18
22
  WorkflowDefinitionExportOutput,
19
23
  WorkflowDefinitionGetInput,
@@ -48,6 +52,9 @@ import type {
48
52
  WorkflowRunStatsInput,
49
53
  WorkflowRunStatsOutput,
50
54
  WorkflowRunTestInput,
55
+ WorkflowTemplateApplyInput,
56
+ WorkflowTemplateListInput,
57
+ WorkflowTemplateListOutput,
51
58
  WorkflowVersionGetInput,
52
59
  WorkflowVersionGetOutput,
53
60
  WorkflowVersionListInput,
@@ -61,6 +68,11 @@ import type {
61
68
  WorkflowWaitResolveInput,
62
69
  } from '../types.gen';
63
70
 
71
+ export const workflowCapListQueryOptions = (sdk: GeneratedClient, input: WorkflowCapListInput) => ({
72
+ queryKey: ['workflow', 'cap', 'list', input] as const,
73
+ queryFn: () => sdk['workflow']['cap']['list'](input),
74
+ });
75
+
64
76
  export const workflowCapabilityGetQueryOptions = (sdk: GeneratedClient, input: WorkflowCapabilityGetInput) => ({
65
77
  queryKey: ['workflow', 'capability', 'get', input] as const,
66
78
  queryFn: () => sdk['workflow']['capability']['get'](input),
@@ -106,6 +118,11 @@ export const workflowDefinitionEnableMutationOptions = (sdk: GeneratedClient) =>
106
118
  mutationFn: (input: WorkflowDefinitionEnableInput) => sdk['workflow']['definition']['enable'](input),
107
119
  });
108
120
 
121
+ export const workflowDefinitionEstimateQueryOptions = (sdk: GeneratedClient, input: WorkflowDefinitionEstimateInput) => ({
122
+ queryKey: ['workflow', 'definition', 'estimate', input] as const,
123
+ queryFn: () => sdk['workflow']['definition']['estimate'](input),
124
+ });
125
+
109
126
  export const workflowDefinitionExportQueryOptions = (sdk: GeneratedClient, input: WorkflowDefinitionExportInput) => ({
110
127
  queryKey: ['workflow', 'definition', 'export', input] as const,
111
128
  queryFn: () => sdk['workflow']['definition']['export'](input),
@@ -216,6 +233,16 @@ export const workflowRunTestMutationOptions = (sdk: GeneratedClient) => ({
216
233
  mutationFn: (input: WorkflowRunTestInput) => sdk['workflow']['run']['test'](input),
217
234
  });
218
235
 
236
+ export const workflowTemplateApplyMutationOptions = (sdk: GeneratedClient) => ({
237
+ mutationKey: ['workflow', 'template', 'apply'],
238
+ mutationFn: (input: WorkflowTemplateApplyInput) => sdk['workflow']['template']['apply'](input),
239
+ });
240
+
241
+ export const workflowTemplateListQueryOptions = (sdk: GeneratedClient, input: WorkflowTemplateListInput) => ({
242
+ queryKey: ['workflow', 'template', 'list', input] as const,
243
+ queryFn: () => sdk['workflow']['template']['list'](input),
244
+ });
245
+
219
246
  export const workflowVersionGetQueryOptions = (sdk: GeneratedClient, input: WorkflowVersionGetInput) => ({
220
247
  queryKey: ['workflow', 'version', 'get', input] as const,
221
248
  queryFn: () => sdk['workflow']['version']['get'](input),