@you-agent-factory/client 0.0.2 → 0.0.6

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.
@@ -19,6 +19,7 @@ export declare const FACTORY_EVENT_TYPES: {
19
19
  readonly FactoryEventTypeWorkRequest: "WORK_REQUEST";
20
20
  readonly FactoryEventTypeRelationshipChangeRequest: "RELATIONSHIP_CHANGE_REQUEST";
21
21
  readonly FactoryEventTypeDispatchRequest: "DISPATCH_REQUEST";
22
+ readonly FactoryEventTypeDispatchWorkerSessionAssociation: "DISPATCH_WORKER_SESSION_ASSOCIATION";
22
23
  readonly FactoryEventTypeModelRequest: "MODEL_REQUEST";
23
24
  readonly FactoryEventTypeModelResponse: "MODEL_RESPONSE";
24
25
  readonly FactoryEventTypeInferenceRequest: "INFERENCE_REQUEST";
@@ -515,10 +515,40 @@
515
515
  ],
516
516
  "type": "object"
517
517
  },
518
+ "DispatchWorkerSessionAssociationEventPayload": {
519
+ "additionalProperties": false,
520
+ "description": "Canonical association between one Factory dispatch and the Worker Session allocated to execute it. Dispatch identity remains authoritative in FactoryEvent.context.dispatchId and is not repeated in this payload.",
521
+ "properties": {
522
+ "workerSessionId": {
523
+ "description": "Non-empty Worker Session identity allocated for the dispatch.",
524
+ "minLength": 1,
525
+ "type": "string"
526
+ }
527
+ },
528
+ "required": [
529
+ "workerSessionId"
530
+ ],
531
+ "type": "object"
532
+ },
518
533
  "Factory": {
519
534
  "additionalProperties": false,
520
535
  "description": "Top-level factory.json contract. Declare the work types, resources, portability resources, workers, and workstations that make up one authored factory here. Guarded loop breakers should be authored as guarded LOGICAL_MOVE workstations using VISIT_COUNT guards instead of a top-level exhaustion-rules field.",
521
536
  "properties": {
537
+ "description": {
538
+ "allOf": [
539
+ {
540
+ "$ref": "#/$defs/NameValue"
541
+ }
542
+ ],
543
+ "description": "Optional localized customer-facing explanation of this Factory."
544
+ },
545
+ "examples": {
546
+ "description": "Ordered runnable invocation examples. Canonical Factory documents write examples here; legacy invocationSignature.examples are accepted only by the Factory input compatibility mapper.",
547
+ "items": {
548
+ "$ref": "#/$defs/FactoryInvocationExample"
549
+ },
550
+ "type": "array"
551
+ },
522
552
  "factoryDirectory": {
523
553
  "description": "Directory that contained the factory.json used for this serialized runtime config.",
524
554
  "type": "string"
@@ -1002,6 +1032,7 @@
1002
1032
  "WORK_REQUEST",
1003
1033
  "RELATIONSHIP_CHANGE_REQUEST",
1004
1034
  "DISPATCH_REQUEST",
1035
+ "DISPATCH_WORKER_SESSION_ASSOCIATION",
1005
1036
  "MODEL_REQUEST",
1006
1037
  "MODEL_RESPONSE",
1007
1038
  "INFERENCE_REQUEST",
@@ -1041,7 +1072,7 @@
1041
1072
  "modelProvider": {
1042
1073
  "allOf": [
1043
1074
  {
1044
- "$ref": "#/$defs/WorkerModelProvider"
1075
+ "$ref": "#/$defs/ProviderIdentity"
1045
1076
  }
1046
1077
  ],
1047
1078
  "description": "Provider whose inference-throttle history controls this factory-level guard."
@@ -1073,32 +1104,53 @@
1073
1104
  ],
1074
1105
  "type": "string"
1075
1106
  },
1107
+ "FactoryInvocationArguments": {
1108
+ "additionalProperties": {
1109
+ "oneOf": [
1110
+ {
1111
+ "type": "string"
1112
+ },
1113
+ {
1114
+ "items": {
1115
+ "type": "string"
1116
+ },
1117
+ "type": "array"
1118
+ }
1119
+ ]
1120
+ },
1121
+ "description": "Structured Factory invocation arguments keyed by parameter name, external name, or alias. Each value is either one string or an ordered array of strings.",
1122
+ "type": "object"
1123
+ },
1076
1124
  "FactoryInvocationExample": {
1077
1125
  "additionalProperties": false,
1078
1126
  "description": "One example invocation for docs, help, and packaged-factory inspection.",
1079
1127
  "properties": {
1080
- "argv": {
1081
- "description": "CLI-style argument vector rendered after factory selection.",
1082
- "items": {
1083
- "type": "string"
1084
- },
1085
- "type": "array"
1128
+ "args": {
1129
+ "allOf": [
1130
+ {
1131
+ "$ref": "#/$defs/FactoryInvocationArguments"
1132
+ }
1133
+ ],
1134
+ "description": "Structured invocation arguments; values are never parsed or executed while loading the Factory."
1086
1135
  },
1087
1136
  "description": {
1088
- "description": "Customer-facing explanation of what the example does.",
1089
- "type": "string"
1137
+ "allOf": [
1138
+ {
1139
+ "$ref": "#/$defs/NameValue"
1140
+ }
1141
+ ],
1142
+ "description": "Localized customer-facing explanation of what the example does."
1090
1143
  },
1091
1144
  "name": {
1092
1145
  "description": "Stable example name.",
1093
- "type": "string"
1094
- },
1095
- "stdin": {
1096
- "description": "Example stdin payload when the signature routes stdin into one parameter.",
1146
+ "minLength": 1,
1097
1147
  "type": "string"
1098
1148
  }
1099
1149
  },
1100
1150
  "required": [
1101
- "name"
1151
+ "name",
1152
+ "description",
1153
+ "args"
1102
1154
  ],
1103
1155
  "type": "object"
1104
1156
  },
@@ -1279,13 +1331,6 @@
1279
1331
  "additionalProperties": false,
1280
1332
  "description": "Canonical callable argument contract for invoking one factory. When present, CLI, API, dashboard, docs, and packaged-factory surfaces should discover and normalize invocation inputs from this shared schema instead of transport- or factory-specific argument definitions.",
1281
1333
  "properties": {
1282
- "examples": {
1283
- "description": "Example invocations rendered in docs, help, and inspection surfaces.",
1284
- "items": {
1285
- "$ref": "#/$defs/FactoryInvocationExample"
1286
- },
1287
- "type": "array"
1288
- },
1289
1334
  "outputContract": {
1290
1335
  "allOf": [
1291
1336
  {
@@ -2982,6 +3027,9 @@
2982
3027
  "description": "Worker-declared model locality, such as LOCAL or CLOUD.",
2983
3028
  "type": "string"
2984
3029
  },
3030
+ "providerSession": {
3031
+ "$ref": "#/$defs/ProviderSessionMetadata"
3032
+ },
2985
3033
  "resourceAcquired": {
2986
3034
  "description": "Whether the invocation acquired the required local model resources.",
2987
3035
  "type": "boolean"
@@ -3016,6 +3064,49 @@
3016
3064
  ],
3017
3065
  "type": "object"
3018
3066
  },
3067
+ "NameValue": {
3068
+ "additionalProperties": false,
3069
+ "description": "A customer-facing value with a required base fallback and optional exact locale overrides. Locale tags must use their canonical BCP 47 spelling.",
3070
+ "properties": {
3071
+ "id": {
3072
+ "description": "Optional stable metadata identifier; consumers must not render it as display copy.",
3073
+ "type": "string"
3074
+ },
3075
+ "locales": {
3076
+ "description": "Canonical BCP 47 locales for which the base value was authored.",
3077
+ "items": {
3078
+ "minLength": 2,
3079
+ "type": "string"
3080
+ },
3081
+ "type": "array",
3082
+ "uniqueItems": true
3083
+ },
3084
+ "type": {
3085
+ "description": "Discriminator for localized customer-facing metadata.",
3086
+ "enum": [
3087
+ "LOCALIZABLE_ASSET"
3088
+ ],
3089
+ "type": "string"
3090
+ },
3091
+ "value": {
3092
+ "description": "Required base value returned when no exact locale override exists.",
3093
+ "minLength": 1,
3094
+ "type": "string"
3095
+ },
3096
+ "values": {
3097
+ "additionalProperties": {
3098
+ "type": "string"
3099
+ },
3100
+ "description": "Exact canonical BCP 47 locale tags mapped to localized overrides.",
3101
+ "type": "object"
3102
+ }
3103
+ },
3104
+ "required": [
3105
+ "type",
3106
+ "value"
3107
+ ],
3108
+ "type": "object"
3109
+ },
3019
3110
  "OrchestratorCheckpointWrittenEventPayload": {
3020
3111
  "additionalProperties": false,
3021
3112
  "description": "Orchestrator checkpoint reference recorded on the canonical factory event stream. Checkpoint identity lives in FactoryEvent.context and raw VM bodies remain orchestrator-owned.",
@@ -3131,6 +3222,13 @@
3131
3222
  },
3132
3223
  "type": "object"
3133
3224
  },
3225
+ "ProviderIdentity": {
3226
+ "description": "Open provider identity used by authored modelProvider fields. Extension identities use lowercase letters and digits separated by dots or hyphens. Built-in identities and documented legacy aliases remain accepted compatibility spellings. For example, `customer.provider` is a valid extension identity.",
3227
+ "maxLength": 128,
3228
+ "minLength": 1,
3229
+ "pattern": "^(?:[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*|ANTIGRAVITY|ANTHROPIC|CLAUDE|CODEX|OPENAI)$",
3230
+ "type": "string"
3231
+ },
3134
3232
  "ProviderSessionMetadata": {
3135
3233
  "additionalProperties": false,
3136
3234
  "properties": {
@@ -3146,6 +3244,11 @@
3146
3244
  },
3147
3245
  "type": "object"
3148
3246
  },
3247
+ "ReasoningEffort": {
3248
+ "description": "Optional provider-neutral reasoning effort. Surrounding whitespace and letter case are normalized. Omit the field to preserve the selected provider and model default. Factory definitions may use an exact invocation-parameter placeholder such as `${executorReasoningEffort}`.",
3249
+ "pattern": "^(?:[\t-\r …   - \u2028\u2029   ]*(?:[mM][iI][nN][iI][mM][aA][lL]|[lL][oO][wW]|[mM][eE][dD][iI][uU][mM]|[hH][iI][gG][hH]|[xX][hH][iI][gG][hH]|[mM][aA][xX])?[\t-\r …   - \u2028\u2029   ]*|\\$\\{[A-Za-z0-9_.-]+\\})$",
3250
+ "type": "string"
3251
+ },
3149
3252
  "Relation": {
3150
3253
  "additionalProperties": false,
3151
3254
  "properties": {
@@ -3409,11 +3512,8 @@
3409
3512
  "description": "Stable built-in runner identifiers supported by factory and workstation runner selection.",
3410
3513
  "enum": [
3411
3514
  "codex",
3412
- "gemini",
3413
- "kiro",
3414
- "cursor-cli",
3415
- "opencode",
3416
- "pi"
3515
+ "claude",
3516
+ "antigravity"
3417
3517
  ],
3418
3518
  "type": "string"
3419
3519
  },
@@ -4328,6 +4428,14 @@
4328
4428
  "additionalProperties": false,
4329
4429
  "description": "A named category of work that can move through the factory. Each work type declares the lifecycle states its work items can occupy.",
4330
4430
  "properties": {
4431
+ "description": {
4432
+ "allOf": [
4433
+ {
4434
+ "$ref": "#/$defs/NameValue"
4435
+ }
4436
+ ],
4437
+ "description": "Optional localized customer-facing explanation of this work type."
4438
+ },
4331
4439
  "handlingBehavior": {
4332
4440
  "description": "Optional CLI routing markers for this work type. Factories used with you run --factory must declare handlingBehavior DEFAULT on exactly one work type.",
4333
4441
  "items": {
@@ -4399,13 +4507,21 @@
4399
4507
  "description": "Command to execute when this worker runs through a command or script provider.",
4400
4508
  "type": "string"
4401
4509
  },
4510
+ "description": {
4511
+ "allOf": [
4512
+ {
4513
+ "$ref": "#/$defs/NameValue"
4514
+ }
4515
+ ],
4516
+ "description": "Optional localized customer-facing explanation of this worker."
4517
+ },
4402
4518
  "executorProvider": {
4403
4519
  "allOf": [
4404
4520
  {
4405
4521
  "$ref": "#/$defs/WorkerProvider"
4406
4522
  }
4407
4523
  ],
4408
- "description": "Canonical executor adapter identifier used to select the worker execution provider or wrapper. The current public built-in value is `SCRIPT_WRAP`."
4524
+ "description": "Execution mechanism. Use `ACP` for ACP-backed workers and put the configured integration identity (for example `cursor-acp`) in modelProvider. `SCRIPT_WRAP` remains the command-wrapper compatibility value; legacy named executor identities remain accepted during migration."
4409
4525
  },
4410
4526
  "id": {
4411
4527
  "description": "Optional durable public identifier for this worker. When present, graph and layout references should use this id instead of the mutable name.",
@@ -4432,21 +4548,21 @@
4432
4548
  "description": "Provider locality for this model capability declaration. Use `LOCAL` for embedded or host-managed inference and `CLOUD` for remote provider execution."
4433
4549
  },
4434
4550
  "modelProvider": {
4435
- "allOf": [
4551
+ "description": "Canonical provider identity used for model routing and provider diagnostics, or an exact invocation-parameter placeholder such as `${modelProvider}`. For `executorProvider: ACP`, this names the configured ACP integration, such as `cursor-acp`. Extension identities use lowercase standardized syntax; built-in values such as `CLAUDE` and `CODEX` remain compatibility conveniences.",
4552
+ "oneOf": [
4553
+ {
4554
+ "$ref": "#/$defs/ProviderIdentity"
4555
+ },
4436
4556
  {
4437
- "$ref": "#/$defs/WorkerModelProvider"
4557
+ "pattern": "^\\$\\{[A-Za-z0-9_.-]+\\}$",
4558
+ "type": "string"
4438
4559
  }
4439
- ],
4440
- "description": "Canonical model-provider identifier used for model routing and provider diagnostics. Current public built-in values are `CLAUDE` and `CODEX`; the runtime maps them onto the underlying provider command IDs."
4560
+ ]
4441
4561
  },
4442
4562
  "name": {
4443
4563
  "description": "Worker name referenced by Workstation.worker.",
4444
4564
  "type": "string"
4445
4565
  },
4446
- "openCodeAgent": {
4447
- "description": "Optional OpenCode agent profile name for model workers that dispatch through the OpenCode runner. When set, OpenCode dispatches invoke `opencode run --agent \u003cname\u003e`. Discover agent names with `opencode agent list` (see https://opencode.ai/docs/cli/).",
4448
- "type": "string"
4449
- },
4450
4566
  "operations": {
4451
4567
  "description": "Provider-agnostic model operations that this worker can execute, including named input and output slots.",
4452
4568
  "items": {
@@ -4462,6 +4578,9 @@
4462
4578
  ],
4463
4579
  "description": "Built-in hosted provider identity when this worker uses repository-owned hosted execution."
4464
4580
  },
4581
+ "reasoningEffort": {
4582
+ "$ref": "#/$defs/ReasoningEffort"
4583
+ },
4465
4584
  "resources": {
4466
4585
  "description": "Resource capacity this worker requires before it can be dispatched.",
4467
4586
  "items": {
@@ -4503,25 +4622,11 @@
4503
4622
  ],
4504
4623
  "type": "string"
4505
4624
  },
4506
- "WorkerModelProvider": {
4507
- "description": "Canonical model-provider identifiers supported by model workers in factory config.",
4508
- "enum": [
4509
- "CLAUDE",
4510
- "CODEX",
4511
- "CURSOR",
4512
- "GEMINI",
4513
- "KIRO",
4514
- "OPENCODE",
4515
- "PI",
4516
- "AGY"
4517
- ],
4518
- "type": "string"
4519
- },
4520
4625
  "WorkerProvider": {
4521
- "description": "Concrete worker-provider wrappers supported by the public factory-config contract.",
4522
- "enum": [
4523
- "SCRIPT_WRAP"
4524
- ],
4626
+ "description": "Worker execution mechanism. Canonical values are ACP and SCRIPT_WRAP; extensible lowercase identities remain accepted for compatibility with existing factories.",
4627
+ "maxLength": 128,
4628
+ "minLength": 1,
4629
+ "pattern": "^(?:ACP|SCRIPT_WRAP|\\$\\{[A-Za-z0-9_.-]+\\}|[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*)$",
4525
4630
  "type": "string"
4526
4631
  },
4527
4632
  "WorkerType": {
@@ -4571,6 +4676,14 @@
4571
4676
  ],
4572
4677
  "description": "Cron trigger configuration for workstations whose behavior is CRON."
4573
4678
  },
4679
+ "description": {
4680
+ "allOf": [
4681
+ {
4682
+ "$ref": "#/$defs/NameValue"
4683
+ }
4684
+ ],
4685
+ "description": "Optional localized customer-facing explanation of this workstation."
4686
+ },
4574
4687
  "env": {
4575
4688
  "allOf": [
4576
4689
  {
@@ -4630,10 +4743,6 @@
4630
4743
  },
4631
4744
  "type": "array"
4632
4745
  },
4633
- "openCodeAgent": {
4634
- "description": "Optional OpenCode agent profile override for this workstation. When set, overrides the worker default for OpenCode dispatches and invokes `opencode run --agent \u003cname\u003e`. Discover agent names with `opencode agent list` (see https://opencode.ai/docs/cli/).",
4635
- "type": "string"
4636
- },
4637
4746
  "operation": {
4638
4747
  "allOf": [
4639
4748
  {
@@ -4732,8 +4841,12 @@
4732
4841
  },
4733
4842
  "WorkstationCron": {
4734
4843
  "additionalProperties": false,
4735
- "description": "Trigger timing for cron workstations. Cron workstations use a schedule expression; interval triggers are not supported.",
4844
+ "description": "Trigger timing for scheduled workstations. Provide exactly one of a five-field cron schedule or a positive duration in every; Factory validation enforces the exclusive choice.",
4736
4845
  "properties": {
4846
+ "every": {
4847
+ "description": "Positive Go duration interval, such as 30s, 5m, 1h, or 1h30m, used instead of schedule.",
4848
+ "type": "string"
4849
+ },
4737
4850
  "expiryWindow": {
4738
4851
  "description": "Positive Go duration after due_at before a stale cron time token expires and can be consumed by the system expiry transition. Defaults to the duration until the next scheduled cron fire when omitted.",
4739
4852
  "type": "string"
@@ -4752,9 +4865,6 @@
4752
4865
  "type": "boolean"
4753
4866
  }
4754
4867
  },
4755
- "required": [
4756
- "schedule"
4757
- ],
4758
4868
  "type": "object"
4759
4869
  },
4760
4870
  "WorkstationGuard": {
@@ -4774,10 +4884,14 @@
4774
4884
  "type": "string"
4775
4885
  },
4776
4886
  "maxVisits": {
4777
- "description": "For `VISIT_COUNT` guards, the visit threshold.",
4887
+ "description": "For `VISIT_COUNT` guards, the fixed visit ceiling.",
4778
4888
  "minimum": 1,
4779
4889
  "type": "integer"
4780
4890
  },
4891
+ "maxVisitsArgument": {
4892
+ "description": "Optional invocation argument whose positive integer value tightens the fixed visit ceiling.",
4893
+ "type": "string"
4894
+ },
4781
4895
  "parentInput": {
4782
4896
  "description": "For parent-aware input guards, the parent workType name from another input in the same workstation.",
4783
4897
  "type": "string"
@@ -4857,6 +4971,20 @@
4857
4971
  "description": "Go duration limit for one dispatch attempt before it times out.",
4858
4972
  "type": "string"
4859
4973
  },
4974
+ "maxGeneratedWorkItems": {
4975
+ "description": "Fixed maximum number of Work items one accepted worker-emitted FACTORY_REQUEST_BATCH may contain.",
4976
+ "minimum": 1,
4977
+ "type": "integer"
4978
+ },
4979
+ "maxGeneratedWorkItemsArgument": {
4980
+ "description": "Optional invocation argument whose positive integer value tightens the fixed generated-Work ceiling.",
4981
+ "type": "string"
4982
+ },
4983
+ "maxGeneratedWorkItemsArgumentOffset": {
4984
+ "description": "Offset added to the invocation argument before applying the generated-Work ceiling.",
4985
+ "minimum": 0,
4986
+ "type": "integer"
4987
+ },
4860
4988
  "maxRetries": {
4861
4989
  "description": "Maximum number of retry attempts after a failed dispatch before the workstation gives up.",
4862
4990
  "type": "integer"
@@ -4964,6 +5092,7 @@
4964
5092
  "DISPATCH_RECONCILED": "#/$defs/DispatchReconciledEventPayload",
4965
5093
  "DISPATCH_REQUEST": "#/$defs/DispatchRequestEventPayload",
4966
5094
  "DISPATCH_RESPONSE": "#/$defs/DispatchResponseEventPayload",
5095
+ "DISPATCH_WORKER_SESSION_ASSOCIATION": "#/$defs/DispatchWorkerSessionAssociationEventPayload",
4967
5096
  "FACTORY_CHANGE": "#/$defs/FactoryChangeEventPayload",
4968
5097
  "FACTORY_STATE_RESPONSE": "#/$defs/FactoryStateResponseEventPayload",
4969
5098
  "INFERENCE_REQUEST": "#/$defs/InferenceRequestEventPayload",
@@ -4991,6 +5120,35 @@
4991
5120
  },
4992
5121
  "propertyName": "type"
4993
5122
  },
5123
+ "not": {
5124
+ "properties": {
5125
+ "context": {
5126
+ "not": {
5127
+ "properties": {
5128
+ "dispatchId": {
5129
+ "minLength": 1,
5130
+ "type": "string"
5131
+ }
5132
+ },
5133
+ "required": [
5134
+ "dispatchId"
5135
+ ],
5136
+ "type": "object"
5137
+ }
5138
+ },
5139
+ "type": {
5140
+ "enum": [
5141
+ "DISPATCH_WORKER_SESSION_ASSOCIATION"
5142
+ ],
5143
+ "type": "string"
5144
+ }
5145
+ },
5146
+ "required": [
5147
+ "type",
5148
+ "context"
5149
+ ],
5150
+ "type": "object"
5151
+ },
4994
5152
  "oneOf": [
4995
5153
  {
4996
5154
  "properties": {
@@ -5082,6 +5240,21 @@
5082
5240
  ],
5083
5241
  "type": "object"
5084
5242
  },
5243
+ {
5244
+ "properties": {
5245
+ "payload": {
5246
+ "$ref": "#/$defs/DispatchWorkerSessionAssociationEventPayload"
5247
+ },
5248
+ "type": {
5249
+ "const": "DISPATCH_WORKER_SESSION_ASSOCIATION"
5250
+ }
5251
+ },
5252
+ "required": [
5253
+ "type",
5254
+ "payload"
5255
+ ],
5256
+ "type": "object"
5257
+ },
5085
5258
  {
5086
5259
  "properties": {
5087
5260
  "payload": {