@treeseed/sdk 0.13.0-rc.64 → 0.13.0-rc.66

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 (34) hide show
  1. package/dist/.treeseed-build-complete.json +1 -1
  2. package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.d.ts +304 -0
  3. package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.js +44 -0
  4. package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.d.ts +9 -0
  5. package/dist/agent-capacity/contracts/capacity/assignments/context-pack-compiler.d.ts +25 -0
  6. package/dist/agent-capacity/contracts/capacity/assignments/context-pack-compiler.js +67 -0
  7. package/dist/agent-capacity/validation/agent-definition-schema.d.ts +36 -36
  8. package/dist/agent-capacity/validation/agent-definition-schema.js +2 -0
  9. package/dist/capacity/agents/agent-capacity.d.ts +2 -0
  10. package/dist/capacity/agents/agent-capacity.js +2 -0
  11. package/dist/capacity-provider/capability-ontology.d.ts +296 -7
  12. package/dist/capacity-provider/capability-ontology.js +23 -1
  13. package/dist/content/validation/agent-operational-content-schemas.d.ts +338 -16
  14. package/dist/content/validation/agent-operational-content-schemas.js +18 -3
  15. package/dist/content/validation/content-model-schemas.d.ts +428 -89
  16. package/dist/content/validation/portable-content-data.d.ts +26 -9
  17. package/dist/deployment/schemas.d.ts +352 -0
  18. package/dist/deployment/schemas.js +30 -0
  19. package/dist/entrypoints/clients/control-plane-client.js +5 -3
  20. package/dist/graph/context-query-contracts.d.ts +16 -1
  21. package/dist/graph/context-query-contracts.js +5 -0
  22. package/dist/model-registry/agent-operational-models.js +1 -1
  23. package/dist/operator-contracts/canonical-command-tree.js +16 -1
  24. package/dist/operator-contracts/catalog/communication-operations.d.ts +4 -4
  25. package/dist/operator-contracts/catalog/knowledge-share-operations.d.ts +127 -0
  26. package/dist/operator-contracts/catalog/knowledge-share-operations.js +25 -0
  27. package/dist/operator-contracts/communication/contracts.d.ts +12 -12
  28. package/dist/operator-contracts/control-plane-operations.d.ts +129 -4
  29. package/dist/operator-contracts/control-plane-operations.js +2 -0
  30. package/dist/operator-contracts/index.d.ts +1 -0
  31. package/dist/operator-contracts/index.js +1 -0
  32. package/dist/operator-contracts/knowledge/contracts.d.ts +130 -0
  33. package/dist/operator-contracts/knowledge/contracts.js +39 -0
  34. package/package.json +1 -1
@@ -637,14 +637,14 @@ export declare const capabilityDemandSchema: z.ZodObject<{
637
637
  requirement: "required" | "preferred";
638
638
  value?: unknown;
639
639
  }>;
640
- capabilityId: string;
641
640
  requirement: "required" | "preferred";
641
+ capabilityId: string;
642
642
  versionRange: string;
643
643
  alternativeGroup: string | null;
644
644
  requiredFeatures: string[];
645
645
  }, {
646
- capabilityId: string;
647
646
  requirement: "required" | "preferred";
647
+ capabilityId: string;
648
648
  versionRange: string;
649
649
  configuration?: Record<string, {
650
650
  requirement: "required" | "preferred";
@@ -711,8 +711,8 @@ export declare const capabilityDemandSchema: z.ZodObject<{
711
711
  requirement: "required" | "preferred";
712
712
  value?: unknown;
713
713
  }>;
714
- capabilityId: string;
715
714
  requirement: "required" | "preferred";
715
+ capabilityId: string;
716
716
  versionRange: string;
717
717
  alternativeGroup: string | null;
718
718
  requiredFeatures: string[];
@@ -741,8 +741,8 @@ export declare const capabilityDemandSchema: z.ZodObject<{
741
741
  contextModes: string[];
742
742
  ontologyGeneration: number;
743
743
  requirements: {
744
- capabilityId: string;
745
744
  requirement: "required" | "preferred";
745
+ capabilityId: string;
746
746
  versionRange: string;
747
747
  configuration?: Record<string, {
748
748
  requirement: "required" | "preferred";
@@ -859,8 +859,130 @@ export declare const capabilityConformanceSchema: z.ZodObject<{
859
859
  tier: "signed-attestation" | "automated-suite" | "reviewed-certification";
860
860
  evidenceDigest: string;
861
861
  }>;
862
+ export declare const providerContextCapacitySchema: z.ZodEffects<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
863
+ mode: z.ZodLiteral<"bounded">;
864
+ measurement: z.ZodEnum<["tokens", "bytes", "items"]>;
865
+ defaultInitial: z.ZodNumber;
866
+ maximum: z.ZodNumber;
867
+ reservedOutput: z.ZodDefault<z.ZodNumber>;
868
+ transportPayloadBytes: z.ZodNumber;
869
+ measurementProvenance: z.ZodObject<{
870
+ provider: z.ZodString;
871
+ implementation: z.ZodString;
872
+ version: z.ZodNullable<z.ZodString>;
873
+ }, "strict", z.ZodTypeAny, {
874
+ version: string | null;
875
+ provider: string;
876
+ implementation: string;
877
+ }, {
878
+ version: string | null;
879
+ provider: string;
880
+ implementation: string;
881
+ }>;
882
+ }, "strict", z.ZodTypeAny, {
883
+ maximum: number;
884
+ mode: "bounded";
885
+ measurement: "items" | "tokens" | "bytes";
886
+ defaultInitial: number;
887
+ reservedOutput: number;
888
+ transportPayloadBytes: number;
889
+ measurementProvenance: {
890
+ version: string | null;
891
+ provider: string;
892
+ implementation: string;
893
+ };
894
+ }, {
895
+ maximum: number;
896
+ mode: "bounded";
897
+ measurement: "items" | "tokens" | "bytes";
898
+ defaultInitial: number;
899
+ transportPayloadBytes: number;
900
+ measurementProvenance: {
901
+ version: string | null;
902
+ provider: string;
903
+ implementation: string;
904
+ };
905
+ reservedOutput?: number | undefined;
906
+ }>, z.ZodObject<{
907
+ mode: z.ZodLiteral<"unbounded">;
908
+ measurement: z.ZodDefault<z.ZodNullable<z.ZodEnum<["tokens", "bytes", "items"]>>>;
909
+ transportPayloadBytes: z.ZodNumber;
910
+ measurementProvenance: z.ZodObject<{
911
+ provider: z.ZodString;
912
+ implementation: z.ZodString;
913
+ version: z.ZodNullable<z.ZodString>;
914
+ }, "strict", z.ZodTypeAny, {
915
+ version: string | null;
916
+ provider: string;
917
+ implementation: string;
918
+ }, {
919
+ version: string | null;
920
+ provider: string;
921
+ implementation: string;
922
+ }>;
923
+ }, "strict", z.ZodTypeAny, {
924
+ mode: "unbounded";
925
+ measurement: "items" | "tokens" | "bytes" | null;
926
+ transportPayloadBytes: number;
927
+ measurementProvenance: {
928
+ version: string | null;
929
+ provider: string;
930
+ implementation: string;
931
+ };
932
+ }, {
933
+ mode: "unbounded";
934
+ transportPayloadBytes: number;
935
+ measurementProvenance: {
936
+ version: string | null;
937
+ provider: string;
938
+ implementation: string;
939
+ };
940
+ measurement?: "items" | "tokens" | "bytes" | null | undefined;
941
+ }>]>, {
942
+ maximum: number;
943
+ mode: "bounded";
944
+ measurement: "items" | "tokens" | "bytes";
945
+ defaultInitial: number;
946
+ reservedOutput: number;
947
+ transportPayloadBytes: number;
948
+ measurementProvenance: {
949
+ version: string | null;
950
+ provider: string;
951
+ implementation: string;
952
+ };
953
+ } | {
954
+ mode: "unbounded";
955
+ measurement: "items" | "tokens" | "bytes" | null;
956
+ transportPayloadBytes: number;
957
+ measurementProvenance: {
958
+ version: string | null;
959
+ provider: string;
960
+ implementation: string;
961
+ };
962
+ }, {
963
+ maximum: number;
964
+ mode: "bounded";
965
+ measurement: "items" | "tokens" | "bytes";
966
+ defaultInitial: number;
967
+ transportPayloadBytes: number;
968
+ measurementProvenance: {
969
+ version: string | null;
970
+ provider: string;
971
+ implementation: string;
972
+ };
973
+ reservedOutput?: number | undefined;
974
+ } | {
975
+ mode: "unbounded";
976
+ transportPayloadBytes: number;
977
+ measurementProvenance: {
978
+ version: string | null;
979
+ provider: string;
980
+ implementation: string;
981
+ };
982
+ measurement?: "items" | "tokens" | "bytes" | null | undefined;
983
+ }>;
862
984
  export declare const capabilityOfferSchema: z.ZodObject<{
863
- schemaVersion: z.ZodLiteral<"treeseed.capability-offer/v1">;
985
+ schemaVersion: z.ZodLiteral<"treeseed.capability-offer/v2">;
864
986
  offerId: z.ZodString;
865
987
  capabilities: z.ZodArray<z.ZodObject<{
866
988
  id: z.ZodString;
@@ -1010,6 +1132,128 @@ export declare const capabilityOfferSchema: z.ZodObject<{
1010
1132
  tier: "signed-attestation" | "automated-suite" | "reviewed-certification";
1011
1133
  evidenceDigest: string;
1012
1134
  }>, "many">;
1135
+ contextCapacity: z.ZodEffects<z.ZodDiscriminatedUnion<"mode", [z.ZodObject<{
1136
+ mode: z.ZodLiteral<"bounded">;
1137
+ measurement: z.ZodEnum<["tokens", "bytes", "items"]>;
1138
+ defaultInitial: z.ZodNumber;
1139
+ maximum: z.ZodNumber;
1140
+ reservedOutput: z.ZodDefault<z.ZodNumber>;
1141
+ transportPayloadBytes: z.ZodNumber;
1142
+ measurementProvenance: z.ZodObject<{
1143
+ provider: z.ZodString;
1144
+ implementation: z.ZodString;
1145
+ version: z.ZodNullable<z.ZodString>;
1146
+ }, "strict", z.ZodTypeAny, {
1147
+ version: string | null;
1148
+ provider: string;
1149
+ implementation: string;
1150
+ }, {
1151
+ version: string | null;
1152
+ provider: string;
1153
+ implementation: string;
1154
+ }>;
1155
+ }, "strict", z.ZodTypeAny, {
1156
+ maximum: number;
1157
+ mode: "bounded";
1158
+ measurement: "items" | "tokens" | "bytes";
1159
+ defaultInitial: number;
1160
+ reservedOutput: number;
1161
+ transportPayloadBytes: number;
1162
+ measurementProvenance: {
1163
+ version: string | null;
1164
+ provider: string;
1165
+ implementation: string;
1166
+ };
1167
+ }, {
1168
+ maximum: number;
1169
+ mode: "bounded";
1170
+ measurement: "items" | "tokens" | "bytes";
1171
+ defaultInitial: number;
1172
+ transportPayloadBytes: number;
1173
+ measurementProvenance: {
1174
+ version: string | null;
1175
+ provider: string;
1176
+ implementation: string;
1177
+ };
1178
+ reservedOutput?: number | undefined;
1179
+ }>, z.ZodObject<{
1180
+ mode: z.ZodLiteral<"unbounded">;
1181
+ measurement: z.ZodDefault<z.ZodNullable<z.ZodEnum<["tokens", "bytes", "items"]>>>;
1182
+ transportPayloadBytes: z.ZodNumber;
1183
+ measurementProvenance: z.ZodObject<{
1184
+ provider: z.ZodString;
1185
+ implementation: z.ZodString;
1186
+ version: z.ZodNullable<z.ZodString>;
1187
+ }, "strict", z.ZodTypeAny, {
1188
+ version: string | null;
1189
+ provider: string;
1190
+ implementation: string;
1191
+ }, {
1192
+ version: string | null;
1193
+ provider: string;
1194
+ implementation: string;
1195
+ }>;
1196
+ }, "strict", z.ZodTypeAny, {
1197
+ mode: "unbounded";
1198
+ measurement: "items" | "tokens" | "bytes" | null;
1199
+ transportPayloadBytes: number;
1200
+ measurementProvenance: {
1201
+ version: string | null;
1202
+ provider: string;
1203
+ implementation: string;
1204
+ };
1205
+ }, {
1206
+ mode: "unbounded";
1207
+ transportPayloadBytes: number;
1208
+ measurementProvenance: {
1209
+ version: string | null;
1210
+ provider: string;
1211
+ implementation: string;
1212
+ };
1213
+ measurement?: "items" | "tokens" | "bytes" | null | undefined;
1214
+ }>]>, {
1215
+ maximum: number;
1216
+ mode: "bounded";
1217
+ measurement: "items" | "tokens" | "bytes";
1218
+ defaultInitial: number;
1219
+ reservedOutput: number;
1220
+ transportPayloadBytes: number;
1221
+ measurementProvenance: {
1222
+ version: string | null;
1223
+ provider: string;
1224
+ implementation: string;
1225
+ };
1226
+ } | {
1227
+ mode: "unbounded";
1228
+ measurement: "items" | "tokens" | "bytes" | null;
1229
+ transportPayloadBytes: number;
1230
+ measurementProvenance: {
1231
+ version: string | null;
1232
+ provider: string;
1233
+ implementation: string;
1234
+ };
1235
+ }, {
1236
+ maximum: number;
1237
+ mode: "bounded";
1238
+ measurement: "items" | "tokens" | "bytes";
1239
+ defaultInitial: number;
1240
+ transportPayloadBytes: number;
1241
+ measurementProvenance: {
1242
+ version: string | null;
1243
+ provider: string;
1244
+ implementation: string;
1245
+ };
1246
+ reservedOutput?: number | undefined;
1247
+ } | {
1248
+ mode: "unbounded";
1249
+ transportPayloadBytes: number;
1250
+ measurementProvenance: {
1251
+ version: string | null;
1252
+ provider: string;
1253
+ implementation: string;
1254
+ };
1255
+ measurement?: "items" | "tokens" | "bytes" | null | undefined;
1256
+ }>;
1013
1257
  limits: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1014
1258
  commercial: z.ZodObject<{
1015
1259
  currency: z.ZodNullable<z.ZodString>;
@@ -1025,7 +1269,7 @@ export declare const capabilityOfferSchema: z.ZodObject<{
1025
1269
  trust: z.ZodArray<z.ZodString, "many">;
1026
1270
  offerDigest: z.ZodString;
1027
1271
  }, "strict", z.ZodTypeAny, {
1028
- schemaVersion: "treeseed.capability-offer/v1";
1272
+ schemaVersion: "treeseed.capability-offer/v2";
1029
1273
  capabilities: {
1030
1274
  id: string;
1031
1275
  version: string;
@@ -1076,6 +1320,28 @@ export declare const capabilityOfferSchema: z.ZodObject<{
1076
1320
  tier: "signed-attestation" | "automated-suite" | "reviewed-certification";
1077
1321
  evidenceDigest: string;
1078
1322
  }[];
1323
+ contextCapacity: {
1324
+ maximum: number;
1325
+ mode: "bounded";
1326
+ measurement: "items" | "tokens" | "bytes";
1327
+ defaultInitial: number;
1328
+ reservedOutput: number;
1329
+ transportPayloadBytes: number;
1330
+ measurementProvenance: {
1331
+ version: string | null;
1332
+ provider: string;
1333
+ implementation: string;
1334
+ };
1335
+ } | {
1336
+ mode: "unbounded";
1337
+ measurement: "items" | "tokens" | "bytes" | null;
1338
+ transportPayloadBytes: number;
1339
+ measurementProvenance: {
1340
+ version: string | null;
1341
+ provider: string;
1342
+ implementation: string;
1343
+ };
1344
+ };
1079
1345
  limits: Record<string, unknown>;
1080
1346
  commercial: {
1081
1347
  currency: string | null;
@@ -1084,7 +1350,7 @@ export declare const capabilityOfferSchema: z.ZodObject<{
1084
1350
  region: string | null;
1085
1351
  offerDigest: string;
1086
1352
  }, {
1087
- schemaVersion: "treeseed.capability-offer/v1";
1353
+ schemaVersion: "treeseed.capability-offer/v2";
1088
1354
  capabilities: {
1089
1355
  id: string;
1090
1356
  version: string;
@@ -1135,6 +1401,28 @@ export declare const capabilityOfferSchema: z.ZodObject<{
1135
1401
  tier: "signed-attestation" | "automated-suite" | "reviewed-certification";
1136
1402
  evidenceDigest: string;
1137
1403
  }[];
1404
+ contextCapacity: {
1405
+ maximum: number;
1406
+ mode: "bounded";
1407
+ measurement: "items" | "tokens" | "bytes";
1408
+ defaultInitial: number;
1409
+ transportPayloadBytes: number;
1410
+ measurementProvenance: {
1411
+ version: string | null;
1412
+ provider: string;
1413
+ implementation: string;
1414
+ };
1415
+ reservedOutput?: number | undefined;
1416
+ } | {
1417
+ mode: "unbounded";
1418
+ transportPayloadBytes: number;
1419
+ measurementProvenance: {
1420
+ version: string | null;
1421
+ provider: string;
1422
+ implementation: string;
1423
+ };
1424
+ measurement?: "items" | "tokens" | "bytes" | null | undefined;
1425
+ };
1138
1426
  limits: Record<string, unknown>;
1139
1427
  commercial: {
1140
1428
  currency: string | null;
@@ -1203,4 +1491,5 @@ export type CapabilityOntology = z.infer<typeof capabilityOntologySchema>;
1203
1491
  export type CapabilityDemand = z.infer<typeof capabilityDemandSchema>;
1204
1492
  export type CapabilityOffer = z.infer<typeof capabilityOfferSchema>;
1205
1493
  export type CapabilityConformance = z.infer<typeof capabilityConformanceSchema>;
1494
+ export type ProviderContextCapacity = z.infer<typeof providerContextCapacitySchema>;
1206
1495
  export type CapabilityNegotiationReceipt = z.infer<typeof capabilityNegotiationReceiptSchema>;
@@ -77,8 +77,28 @@ const capabilityConformanceSchema = z.object({
77
77
  expiresAt: z.string().datetime().nullable(),
78
78
  signature: z.object({ keyId: identifier, algorithm: z.literal("Ed25519"), value: z.string().min(1) }).strict()
79
79
  }).strict();
80
+ const providerContextCapacitySchema = z.discriminatedUnion("mode", [
81
+ z.object({
82
+ mode: z.literal("bounded"),
83
+ measurement: z.enum(["tokens", "bytes", "items"]),
84
+ defaultInitial: z.number().int().positive(),
85
+ maximum: z.number().int().positive(),
86
+ reservedOutput: z.number().int().nonnegative().default(0),
87
+ transportPayloadBytes: z.number().int().positive(),
88
+ measurementProvenance: z.object({ provider: identifier, implementation: z.string().min(1), version: z.string().min(1).nullable() }).strict()
89
+ }).strict(),
90
+ z.object({
91
+ mode: z.literal("unbounded"),
92
+ measurement: z.enum(["tokens", "bytes", "items"]).nullable().default(null),
93
+ transportPayloadBytes: z.number().int().positive(),
94
+ measurementProvenance: z.object({ provider: identifier, implementation: z.string().min(1), version: z.string().min(1).nullable() }).strict()
95
+ }).strict()
96
+ ]).superRefine((value, context) => {
97
+ if (value.mode === "bounded" && value.defaultInitial > value.maximum) context.addIssue({ code: z.ZodIssueCode.custom, path: ["defaultInitial"], message: "Default initial context cannot exceed the maximum." });
98
+ if (value.mode === "bounded" && value.measurement === "tokens" && value.reservedOutput >= value.maximum) context.addIssue({ code: z.ZodIssueCode.custom, path: ["reservedOutput"], message: "Reserved output must leave room for input context." });
99
+ });
80
100
  const capabilityOfferSchema = z.object({
81
- schemaVersion: z.literal("treeseed.capability-offer/v1"),
101
+ schemaVersion: z.literal("treeseed.capability-offer/v2"),
82
102
  offerId: identifier,
83
103
  capabilities: z.array(capabilityReferenceSchema).min(1),
84
104
  features: z.array(identifier),
@@ -89,6 +109,7 @@ const capabilityOfferSchema = z.object({
89
109
  outputContracts: z.array(artifactContractSchema),
90
110
  interactionModes: z.array(identifier),
91
111
  conformance: z.array(capabilityConformanceSchema).min(1),
112
+ contextCapacity: providerContextCapacitySchema,
92
113
  limits: z.record(z.unknown()),
93
114
  commercial: z.object({ currency: z.string().min(3).max(3).nullable(), estimatedCost: z.number().nonnegative().nullable() }).strict(),
94
115
  region: z.string().min(1).nullable(),
@@ -195,5 +216,6 @@ export {
195
216
  capabilityOntologySchema,
196
217
  capabilityReferenceSchema,
197
218
  negotiateCapabilityOffer,
219
+ providerContextCapacitySchema,
198
220
  semverSatisfies
199
221
  };