@uug-ai/models 1.6.1 → 1.6.3

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 (2) hide show
  1. package/dist/types.d.ts +356 -13
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -25431,6 +25431,45 @@ export interface paths {
25431
25431
  patch?: never;
25432
25432
  trace?: never;
25433
25433
  };
25434
+ "/internal/workflowdevice": {
25435
+ parameters: {
25436
+ query?: never;
25437
+ header?: never;
25438
+ path?: never;
25439
+ cookie?: never;
25440
+ };
25441
+ /**
25442
+ * Get WorkflowDevice (schema generation only)
25443
+ * @description Internal endpoint used only to ensure WorkflowDevice schema is generated in OpenAPI spec
25444
+ */
25445
+ get: {
25446
+ parameters: {
25447
+ query?: never;
25448
+ header?: never;
25449
+ path?: never;
25450
+ cookie?: never;
25451
+ };
25452
+ requestBody?: never;
25453
+ responses: {
25454
+ /** @description OK */
25455
+ 200: {
25456
+ headers: {
25457
+ [name: string]: unknown;
25458
+ };
25459
+ content: {
25460
+ "application/json": components["schemas"]["models.WorkflowDevice"];
25461
+ };
25462
+ };
25463
+ };
25464
+ };
25465
+ put?: never;
25466
+ post?: never;
25467
+ delete?: never;
25468
+ options?: never;
25469
+ head?: never;
25470
+ patch?: never;
25471
+ trace?: never;
25472
+ };
25434
25473
  "/internal/workflowedge": {
25435
25474
  parameters: {
25436
25475
  query?: never;
@@ -25509,6 +25548,45 @@ export interface paths {
25509
25548
  patch?: never;
25510
25549
  trace?: never;
25511
25550
  };
25551
+ "/internal/workflowrun": {
25552
+ parameters: {
25553
+ query?: never;
25554
+ header?: never;
25555
+ path?: never;
25556
+ cookie?: never;
25557
+ };
25558
+ /**
25559
+ * Get WorkflowRun (schema generation only)
25560
+ * @description Internal endpoint used only to ensure WorkflowRun schema is generated in OpenAPI spec
25561
+ */
25562
+ get: {
25563
+ parameters: {
25564
+ query?: never;
25565
+ header?: never;
25566
+ path?: never;
25567
+ cookie?: never;
25568
+ };
25569
+ requestBody?: never;
25570
+ responses: {
25571
+ /** @description OK */
25572
+ 200: {
25573
+ headers: {
25574
+ [name: string]: unknown;
25575
+ };
25576
+ content: {
25577
+ "application/json": components["schemas"]["models.WorkflowRun"];
25578
+ };
25579
+ };
25580
+ };
25581
+ };
25582
+ put?: never;
25583
+ post?: never;
25584
+ delete?: never;
25585
+ options?: never;
25586
+ head?: never;
25587
+ patch?: never;
25588
+ trace?: never;
25589
+ };
25512
25590
  "/internal/workflowstage": {
25513
25591
  parameters: {
25514
25592
  query?: never;
@@ -25548,6 +25626,45 @@ export interface paths {
25548
25626
  patch?: never;
25549
25627
  trace?: never;
25550
25628
  };
25629
+ "/internal/workflowstorage": {
25630
+ parameters: {
25631
+ query?: never;
25632
+ header?: never;
25633
+ path?: never;
25634
+ cookie?: never;
25635
+ };
25636
+ /**
25637
+ * Get WorkflowStorage (schema generation only)
25638
+ * @description Internal endpoint used only to ensure WorkflowStorage schema is generated in OpenAPI spec
25639
+ */
25640
+ get: {
25641
+ parameters: {
25642
+ query?: never;
25643
+ header?: never;
25644
+ path?: never;
25645
+ cookie?: never;
25646
+ };
25647
+ requestBody?: never;
25648
+ responses: {
25649
+ /** @description OK */
25650
+ 200: {
25651
+ headers: {
25652
+ [name: string]: unknown;
25653
+ };
25654
+ content: {
25655
+ "application/json": components["schemas"]["models.WorkflowStorage"];
25656
+ };
25657
+ };
25658
+ };
25659
+ };
25660
+ put?: never;
25661
+ post?: never;
25662
+ delete?: never;
25663
+ options?: never;
25664
+ head?: never;
25665
+ patch?: never;
25666
+ trace?: never;
25667
+ };
25551
25668
  "/internal/workflowtrigger": {
25552
25669
  parameters: {
25553
25670
  query?: never;
@@ -25587,6 +25704,45 @@ export interface paths {
25587
25704
  patch?: never;
25588
25705
  trace?: never;
25589
25706
  };
25707
+ "/internal/workflowuser": {
25708
+ parameters: {
25709
+ query?: never;
25710
+ header?: never;
25711
+ path?: never;
25712
+ cookie?: never;
25713
+ };
25714
+ /**
25715
+ * Get WorkflowUser (schema generation only)
25716
+ * @description Internal endpoint used only to ensure WorkflowUser schema is generated in OpenAPI spec
25717
+ */
25718
+ get: {
25719
+ parameters: {
25720
+ query?: never;
25721
+ header?: never;
25722
+ path?: never;
25723
+ cookie?: never;
25724
+ };
25725
+ requestBody?: never;
25726
+ responses: {
25727
+ /** @description OK */
25728
+ 200: {
25729
+ headers: {
25730
+ [name: string]: unknown;
25731
+ };
25732
+ content: {
25733
+ "application/json": components["schemas"]["models.WorkflowUser"];
25734
+ };
25735
+ };
25736
+ };
25737
+ };
25738
+ put?: never;
25739
+ post?: never;
25740
+ delete?: never;
25741
+ options?: never;
25742
+ head?: never;
25743
+ patch?: never;
25744
+ trace?: never;
25745
+ };
25590
25746
  "/media": {
25591
25747
  parameters: {
25592
25748
  query?: never;
@@ -31329,6 +31485,8 @@ export interface components {
31329
31485
  /** @description Add more fields as needed */
31330
31486
  user?: components["schemas"]["models.User"];
31331
31487
  };
31488
+ /** @enum {string} */
31489
+ "models.NeedsMode": "any" | "all";
31332
31490
  "models.NotificationSettings": {
31333
31491
  detections?: components["schemas"]["models.Detections"];
31334
31492
  devices?: components["schemas"]["models.Devices"];
@@ -31698,18 +31856,26 @@ export interface components {
31698
31856
  "models.StageCondition": {
31699
31857
  /** @description see the ConditionOp consts */
31700
31858
  op?: components["schemas"]["models.ConditionOp"];
31701
- /** @description dot-path into the upstream op's result */
31859
+ /** @description absolute dot-path into the run root (see type doc) */
31702
31860
  path?: string;
31703
31861
  /** @description comparison operand (unused for ConditionOpExists) */
31704
31862
  value?: unknown;
31705
31863
  };
31706
31864
  "models.StageDependency": {
31707
31865
  /**
31708
- * @description Condition is the predicate evaluated against the upstream's result. Nil
31709
- * means the dependency matches as soon as the upstream resolves.
31866
+ * @description Condition is the predicate evaluated against the run root. Nil means the
31867
+ * need matches as soon as its gate (if any) is satisfied.
31710
31868
  */
31711
31869
  condition?: components["schemas"]["models.StageCondition"];
31712
- /** @description Operation is the upstream stage this dependency waits on. */
31870
+ /**
31871
+ * @description Operation is the id of the operation whose presence gates this need: it must
31872
+ * be available on the run — present in Inputs or Results — before the need's
31873
+ * Condition is evaluated. It is an operation id, not necessarily a deployed
31874
+ * stage: the most common gate, "classify", is the analysis trigger (it arrives
31875
+ * in Inputs at open), not a stage. Empty means the need is ungated: a check on
31876
+ * the run root itself (device/user/identity, or an input present from open),
31877
+ * evaluated as soon as the run opens with nothing to wait for.
31878
+ */
31713
31879
  operation?: string;
31714
31880
  };
31715
31881
  "models.StageParam": {
@@ -32469,6 +32635,14 @@ export interface components {
32469
32635
  user_id?: string;
32470
32636
  username?: string;
32471
32637
  };
32638
+ "models.WorkflowDevice": {
32639
+ deviceKey?: string;
32640
+ deviceName?: string;
32641
+ /** @description media VideoProvider: where the media is served from */
32642
+ provider?: string;
32643
+ /** @description media StorageSolution: where the media is stored */
32644
+ storageSolution?: string;
32645
+ };
32472
32646
  "models.WorkflowEdge": {
32473
32647
  /**
32474
32648
  * @description Condition is the structured predicate evaluated against the source stage's
@@ -32519,6 +32693,134 @@ export interface components {
32519
32693
  x?: number;
32520
32694
  y?: number;
32521
32695
  };
32696
+ "models.WorkflowRun": {
32697
+ /**
32698
+ * @description Device identifies the recording the run derives from, with the few fields
32699
+ * vault-override resolution and logging need (device key/name and where the
32700
+ * media is stored/served from). Copied from the recording at hand-off time.
32701
+ * Wire-only.
32702
+ */
32703
+ device?: components["schemas"]["models.WorkflowDevice"];
32704
+ /**
32705
+ * @description Inputs is the immutable start context the run opens with, keyed by the
32706
+ * upstream operation that produced it (e.g. "classify" → the classification
32707
+ * result). Conditions and stages read upstream context from here; it is set
32708
+ * once by analysis and never mutated by the run. Persisted at open so a run
32709
+ * reloaded mid-flight still sees its start context.
32710
+ */
32711
+ inputs?: {
32712
+ [key: string]: unknown;
32713
+ };
32714
+ /**
32715
+ * @description Key is the media key the run is about: its natural identity, used to load
32716
+ * or open the run document. Copied from the recording at hand-off time.
32717
+ */
32718
+ key?: string;
32719
+ /**
32720
+ * @description Operation marks the message's role on the workflows queue (wire-only):
32721
+ * - "event": a fresh run hand-off from analysis. It opens the run and
32722
+ * carries the start context in Inputs (e.g. the classification result).
32723
+ * - any other value (e.g. "anpr"): either the engine dispatching that
32724
+ * stage to its worker (Storage populated), or the worker routing its
32725
+ * result back (Payload or Results populated). These never collide because the
32726
+ * workflows queue only ever carries the "event" open and worker results —
32727
+ * a dispatch goes to the worker's own queue — so the engine never has to
32728
+ * disambiguate a dispatch from a result.
32729
+ */
32730
+ operation?: string;
32731
+ /**
32732
+ * @description Payload is the self-describing block envelope a delegated-ingest worker
32733
+ * hands back for the platform to persist: one or more typed blocks (e.g. a
32734
+ * "detection" block carrying a PostDetectionsRequest, optionally followed by
32735
+ * "marker" blocks). It is the channel the shared ingest core reads from,
32736
+ * distinct from Results:
32737
+ *
32738
+ * - Results is the multi-operation, decoded routing/state ledger the
32739
+ * condition matcher reads and the run persists.
32740
+ * - Payload is one worker's block envelope for a single ingest hop.
32741
+ *
32742
+ * Lifecycle mirrors Storage and is one-directional (worker → engine):
32743
+ * - A delegated-ingest worker sets Payload on its result; the engine routes
32744
+ * it through ingest.IngestBlocks, persisting each block by its own type
32745
+ * into the platform-owned collection, and mirrors the envelope's blocks
32746
+ * grouped by type into Results[operation] (one array per block type, e.g.
32747
+ * results.<op>.detections) so a downstream conditional stage can test what
32748
+ * the stage produced. The engine targets the run's own recording
32749
+ * (Key/User/Device), so a payload that also carries its own recording
32750
+ * reference (e.g. a PostDetectionsRequest mediaKey/analysisId) has that
32751
+ * reference ignored on the queue path.
32752
+ * - A self-persisting worker writes its own collection and returns its
32753
+ * routing values in Results instead; Payload is empty.
32754
+ *
32755
+ * `bson:"-"` is load-bearing: the raw body is ingested into its own
32756
+ * collection, never duplicated into the run's persisted state. The engine
32757
+ * never sets it on an outbound dispatch, so it never travels engine → worker.
32758
+ */
32759
+ payload?: number[];
32760
+ /**
32761
+ * @description RecordingTimestamp is the recording's start time (unix seconds), copied
32762
+ * from the recording at hand-off time. It is denormalised onto any platform
32763
+ * artifact the engine ingests (see Payload) so cleanup expires the artifact
32764
+ * on the recording's retention clock rather than the post time. It is set on
32765
+ * the analysis hand-off and persisted on the run at open; the engine then
32766
+ * reads it from the run document when stamping an ingested artifact. It is
32767
+ * therefore engine-internal — NOT sent on the engine→worker dispatch and not
32768
+ * something a worker has to echo back, so it is not part of the stage
32769
+ * contract.
32770
+ */
32771
+ recordingTimestamp?: number;
32772
+ /**
32773
+ * @description Results is the run's accumulated stage outputs, keyed by operation. Each
32774
+ * stage worker writes its result under its operation on the way back, and
32775
+ * conditions / downstream stages read upstream outputs from here. It grows
32776
+ * as the run progresses; the engine records each result into it. Together
32777
+ * with Inputs it is the durable condition bag (Results wins on any overlap).
32778
+ */
32779
+ results?: {
32780
+ [key: string]: unknown;
32781
+ };
32782
+ /**
32783
+ * @description RunId is the run's identifier on the wire (the hex of the document Id). It
32784
+ * is empty on the analysis hand-off — the run is keyed by Key until the
32785
+ * engine opens it — and set on every engine→worker dispatch. The persisted
32786
+ * identity is Id, so RunId itself is wire-only.
32787
+ */
32788
+ runId?: string;
32789
+ /**
32790
+ * @description Storage carries the credentials a dispatched stage worker needs to fetch
32791
+ * the media (global Kerberos Storage plus any resolved per-recording vault
32792
+ * override). It is populated by the engine only on the engine→worker
32793
+ * dispatch hop and is empty on the analysis hand-off and the worker→engine
32794
+ * result. `bson:"-"` is load-bearing: credentials never sit in the run's
32795
+ * persisted state.
32796
+ */
32797
+ storage?: components["schemas"]["models.WorkflowStorage"];
32798
+ /** @description TraceId continues the distributed trace across the workflow tail. */
32799
+ traceId?: string;
32800
+ /**
32801
+ * @description User is the curated, secret-free account context a run needs: the
32802
+ * organisation that owns the recording (for logging/scoping) and the account
32803
+ * Storage block used to resolve a per-recording vault override. Copied (and
32804
+ * scrubbed) from the analysis monitor stage — credential/secret fields and the
32805
+ * individual user id never cross the boundary. Wire-only; the persisted scope
32806
+ * is UserId (which holds the organisation id).
32807
+ */
32808
+ user?: components["schemas"]["models.WorkflowUser"];
32809
+ /**
32810
+ * @description WorkflowId is the id of the Workflow definition (models.Workflow) this run
32811
+ * executes — the authored graph (nodes/edges/trigger) the run is an execution
32812
+ * of, as opposed to the global stage registry. Forward-looking: it is set once
32813
+ * the engine executes Workflow graphs; while the engine is driven by the flat
32814
+ * stage registry it is empty.
32815
+ */
32816
+ workflowId?: string;
32817
+ /**
32818
+ * @description WorkflowName is the human-readable name of that Workflow, carried so a
32819
+ * dispatch/result is legible in worker context and logs without a lookup.
32820
+ * Populated alongside WorkflowId.
32821
+ */
32822
+ workflowName?: string;
32823
+ };
32522
32824
  "models.WorkflowStage": {
32523
32825
  /** @description Description explains what the stage does, for the catalog UI. */
32524
32826
  description?: string;
@@ -32549,19 +32851,43 @@ export interface components {
32549
32851
  /** @description Name is a human-friendly catalog name shown in the stage library. */
32550
32852
  name?: string;
32551
32853
  /**
32552
- * @description Needs lists the upstream dependencies of a conditional stage — its fan-in.
32553
- * It is the compiled, runtime-authoritative projection of the workflow's
32554
- * incoming edges (one entry per edge), not an independently editable field. At
32555
- * least one entry is required when Dispatch is DispatchConditional; ignored
32556
- * otherwise. The runtime re-evaluates the stage whenever any listed upstream
32557
- * resolves, and the stage fires for the first dependency whose Condition
32558
- * matches that upstream's result (a nil Condition matches unconditionally).
32854
+ * @description Needs lists the dependencies of a conditional stage — its fan-in. It is the
32855
+ * compiled, runtime-authoritative projection of the workflow's incoming edges
32856
+ * (one entry per edge), not an independently editable field. At least one
32857
+ * entry is required when Dispatch is DispatchConditional; ignored otherwise.
32858
+ * The runtime re-evaluates the stage against the run root whenever the run
32859
+ * progresses; each need's Operation gates when its Condition may be read (an
32860
+ * empty Operation is ungated, evaluated at open) and the stage fires for the
32861
+ * first need whose Condition matches (a nil Condition matches unconditionally).
32559
32862
  */
32560
32863
  needs?: components["schemas"]["models.StageDependency"][];
32864
+ /**
32865
+ * @description NeedsMode controls how multiple Needs combine into a dispatch decision:
32866
+ * NeedsModeAny (the default) fires the stage as soon as one need is satisfied
32867
+ * (its gate operation available and its condition matching); NeedsModeAll
32868
+ * fires the stage only once every need is satisfied (a join). It is
32869
+ * meaningful only when Dispatch is DispatchConditional and there is more than
32870
+ * one need; with a single need both modes behave identically. Empty defaults
32871
+ * to NeedsModeAny.
32872
+ */
32873
+ needsMode?: components["schemas"]["models.NeedsMode"];
32561
32874
  /**
32562
32875
  * @description Operation uniquely identifies the stage and binds its queue, dispatch and
32563
- * resolution. It is the key that workflow nodes reference. Two stages may
32564
- * never share an operation.
32876
+ * resolution. It is the key workflow nodes reference, and the key under which
32877
+ * the stage's result is filed in a run's Inputs/Results. Two stages may never
32878
+ * share an operation.
32879
+ *
32880
+ * Stage vs. operation — they are not synonyms:
32881
+ * - a STAGE is this definition: a deployed worker with a queue and a
32882
+ * dispatch rule.
32883
+ * - an OPERATION is the id string. It names this stage, and it is also the
32884
+ * key results are filed under on a run.
32885
+ * Every deployed stage has an operation, but a run's operation keyspace is
32886
+ * wider than its stages: it also includes the trigger analysis hands off
32887
+ * (e.g. "classify"), which seeds Inputs and can gate a need or be read by a
32888
+ * condition, yet is not itself a deployed stage. That is why routing —
32889
+ * Needs/gates, conditions, and the run's dispatched/resolved tiers — is keyed
32890
+ * by operation (the wider id space), while deployment talks in stages.
32565
32891
  */
32566
32892
  operation?: string;
32567
32893
  outputs?: components["schemas"]["models.StagePort"][];
@@ -32587,6 +32913,15 @@ export interface components {
32587
32913
  /** @description Tag is the image tag deployed for the stage. */
32588
32914
  tag?: string;
32589
32915
  };
32916
+ "models.WorkflowStorage": {
32917
+ accessKey?: string;
32918
+ secret?: string;
32919
+ uri?: string;
32920
+ vaultOverrideAccessKey?: string;
32921
+ vaultOverrideProvider?: string;
32922
+ vaultOverrideSecret?: string;
32923
+ vaultOverrideUri?: string;
32924
+ };
32590
32925
  "models.WorkflowTrigger": {
32591
32926
  endAt?: string;
32592
32927
  /** @description Selection is the set of devices/streams the workflow applies to. */
@@ -32596,6 +32931,10 @@ export interface components {
32596
32931
  /** @description Weekdays restricts the workflow to the listed days of week. */
32597
32932
  weekdays?: number[];
32598
32933
  };
32934
+ "models.WorkflowUser": {
32935
+ organisationId?: string;
32936
+ storage?: components["schemas"]["models.Storage"];
32937
+ };
32599
32938
  };
32600
32939
  responses: never;
32601
32940
  parameters: never;
@@ -32854,10 +33193,14 @@ export declare namespace models {
32854
33193
  type Webhook = components['schemas']['models.Webhook'];
32855
33194
  type WeeklySchedule = components['schemas']['models.WeeklySchedule'];
32856
33195
  type Workflow = components['schemas']['models.Workflow'];
33196
+ type WorkflowDevice = components['schemas']['models.WorkflowDevice'];
32857
33197
  type WorkflowEdge = components['schemas']['models.WorkflowEdge'];
32858
33198
  type WorkflowNode = components['schemas']['models.WorkflowNode'];
33199
+ type WorkflowRun = components['schemas']['models.WorkflowRun'];
32859
33200
  type WorkflowStage = components['schemas']['models.WorkflowStage'];
33201
+ type WorkflowStorage = components['schemas']['models.WorkflowStorage'];
32860
33202
  type WorkflowTrigger = components['schemas']['models.WorkflowTrigger'];
33203
+ type WorkflowUser = components['schemas']['models.WorkflowUser'];
32861
33204
  }
32862
33205
  export declare namespace api {
32863
33206
  type AddAccessTokenErrorResponse = components['schemas']['api.AddAccessTokenErrorResponse'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uug-ai/models",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "TypeScript type definitions for Go models",
5
5
  "main": "dist/types.js",
6
6
  "types": "dist/types.d.ts",