syllable-sdk 1.0.13-rc.3 → 1.0.13-rc.4
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.
- package/bin/mcp-server.js +866 -801
- package/bin/mcp-server.js.map +10 -8
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/components/context.d.ts +36 -0
- package/models/components/context.d.ts.map +1 -0
- package/models/components/context.js +72 -0
- package/models/components/context.js.map +1 -0
- package/models/components/contexttask.d.ts +32 -0
- package/models/components/contexttask.d.ts.map +1 -0
- package/models/components/contexttask.js +69 -0
- package/models/components/contexttask.js.map +1 -0
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/tooldefinition.d.ts +6 -0
- package/models/components/tooldefinition.d.ts.map +1 -1
- package/models/components/tooldefinition.js +3 -0
- package/models/components/tooldefinition.js.map +1 -1
- package/openapi.json +101 -33
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/context.ts +88 -0
- package/src/models/components/contexttask.ts +78 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/tooldefinition.ts +13 -0
- package/src/types/enums.ts +1 -21
- package/src/types/index.ts +2 -1
- package/src/types/unrecognized.ts +27 -0
- package/types/enums.d.ts +1 -8
- package/types/enums.d.ts.map +1 -1
- package/types/enums.js +3 -21
- package/types/enums.js.map +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/index.js +15 -0
- package/types/index.js.map +1 -1
- package/types/unrecognized.d.ts +10 -0
- package/types/unrecognized.d.ts.map +1 -0
- package/types/unrecognized.js +26 -0
- package/types/unrecognized.js.map +1 -0
package/openapi.json
CHANGED
|
@@ -13781,7 +13781,7 @@
|
|
|
13781
13781
|
"title": "Batch Id",
|
|
13782
13782
|
"description": "Unique ID for conversation batch",
|
|
13783
13783
|
"examples": [
|
|
13784
|
-
"
|
|
13784
|
+
"20251121.9"
|
|
13785
13785
|
]
|
|
13786
13786
|
},
|
|
13787
13787
|
"campaign_id": {
|
|
@@ -13805,7 +13805,7 @@
|
|
|
13805
13805
|
"title": "Expires On",
|
|
13806
13806
|
"description": "Timestamp of batch expiration",
|
|
13807
13807
|
"examples": [
|
|
13808
|
-
"2025-11-
|
|
13808
|
+
"2025-11-22T00:00:00Z"
|
|
13809
13809
|
]
|
|
13810
13810
|
},
|
|
13811
13811
|
"paused": {
|
|
@@ -13858,7 +13858,7 @@
|
|
|
13858
13858
|
"title": "Created At",
|
|
13859
13859
|
"description": "Timestamp of batch creation",
|
|
13860
13860
|
"examples": [
|
|
13861
|
-
"2025-11-
|
|
13861
|
+
"2025-11-21T00:00:00Z"
|
|
13862
13862
|
]
|
|
13863
13863
|
},
|
|
13864
13864
|
"deleted_at": {
|
|
@@ -13874,7 +13874,7 @@
|
|
|
13874
13874
|
"title": "Deleted At",
|
|
13875
13875
|
"description": "Timestamp of batch deletion",
|
|
13876
13876
|
"examples": [
|
|
13877
|
-
"2025-11-
|
|
13877
|
+
"2025-11-21T00:00:00Z"
|
|
13878
13878
|
]
|
|
13879
13879
|
},
|
|
13880
13880
|
"deleted_reason": {
|
|
@@ -13905,7 +13905,7 @@
|
|
|
13905
13905
|
"title": "Last Updated At",
|
|
13906
13906
|
"description": "Timestamp of last change to batch",
|
|
13907
13907
|
"examples": [
|
|
13908
|
-
"2025-11-
|
|
13908
|
+
"2025-11-21T00:00:00Z"
|
|
13909
13909
|
]
|
|
13910
13910
|
},
|
|
13911
13911
|
"last_updated_by": {
|
|
@@ -14661,7 +14661,7 @@
|
|
|
14661
14661
|
"title": "Batch Id",
|
|
14662
14662
|
"description": "Unique ID for conversation batch",
|
|
14663
14663
|
"examples": [
|
|
14664
|
-
"
|
|
14664
|
+
"20251121.9"
|
|
14665
14665
|
]
|
|
14666
14666
|
},
|
|
14667
14667
|
"campaign_id": {
|
|
@@ -14685,7 +14685,7 @@
|
|
|
14685
14685
|
"title": "Expires On",
|
|
14686
14686
|
"description": "Timestamp of batch expiration",
|
|
14687
14687
|
"examples": [
|
|
14688
|
-
"2025-11-
|
|
14688
|
+
"2025-11-22T00:00:00Z"
|
|
14689
14689
|
]
|
|
14690
14690
|
},
|
|
14691
14691
|
"paused": {
|
|
@@ -14738,7 +14738,7 @@
|
|
|
14738
14738
|
"title": "Created At",
|
|
14739
14739
|
"description": "Timestamp of batch creation",
|
|
14740
14740
|
"examples": [
|
|
14741
|
-
"2025-11-
|
|
14741
|
+
"2025-11-21T00:00:00Z"
|
|
14742
14742
|
]
|
|
14743
14743
|
},
|
|
14744
14744
|
"deleted_at": {
|
|
@@ -14754,7 +14754,7 @@
|
|
|
14754
14754
|
"title": "Deleted At",
|
|
14755
14755
|
"description": "Timestamp of batch deletion",
|
|
14756
14756
|
"examples": [
|
|
14757
|
-
"2025-11-
|
|
14757
|
+
"2025-11-21T00:00:00Z"
|
|
14758
14758
|
]
|
|
14759
14759
|
},
|
|
14760
14760
|
"deleted_reason": {
|
|
@@ -14785,7 +14785,7 @@
|
|
|
14785
14785
|
"title": "Last Updated At",
|
|
14786
14786
|
"description": "Timestamp of last change to batch",
|
|
14787
14787
|
"examples": [
|
|
14788
|
-
"2025-11-
|
|
14788
|
+
"2025-11-21T00:00:00Z"
|
|
14789
14789
|
]
|
|
14790
14790
|
},
|
|
14791
14791
|
"last_updated_by": {
|
|
@@ -14828,7 +14828,7 @@
|
|
|
14828
14828
|
"title": "Batch Id",
|
|
14829
14829
|
"description": "Unique ID for conversation batch",
|
|
14830
14830
|
"examples": [
|
|
14831
|
-
"
|
|
14831
|
+
"20251121.9"
|
|
14832
14832
|
]
|
|
14833
14833
|
},
|
|
14834
14834
|
"campaign_id": {
|
|
@@ -14852,7 +14852,7 @@
|
|
|
14852
14852
|
"title": "Expires On",
|
|
14853
14853
|
"description": "Timestamp of batch expiration",
|
|
14854
14854
|
"examples": [
|
|
14855
|
-
"2025-11-
|
|
14855
|
+
"2025-11-22T00:00:00Z"
|
|
14856
14856
|
]
|
|
14857
14857
|
},
|
|
14858
14858
|
"paused": {
|
|
@@ -15001,7 +15001,7 @@
|
|
|
15001
15001
|
"title": "Created At",
|
|
15002
15002
|
"description": "Timestamp of request creation",
|
|
15003
15003
|
"examples": [
|
|
15004
|
-
"2025-11-
|
|
15004
|
+
"2025-11-20T00:00:00Z"
|
|
15005
15005
|
]
|
|
15006
15006
|
},
|
|
15007
15007
|
"sent_at": {
|
|
@@ -15017,7 +15017,7 @@
|
|
|
15017
15017
|
"title": "Sent At",
|
|
15018
15018
|
"description": "Timestamp at which request was sent",
|
|
15019
15019
|
"examples": [
|
|
15020
|
-
"2025-11-
|
|
15020
|
+
"2025-11-21T00:00:00Z"
|
|
15021
15021
|
]
|
|
15022
15022
|
},
|
|
15023
15023
|
"attempt_count": {
|
|
@@ -15137,6 +15137,63 @@
|
|
|
15137
15137
|
],
|
|
15138
15138
|
"title": "CommunicationRequestResult"
|
|
15139
15139
|
},
|
|
15140
|
+
"Context": {
|
|
15141
|
+
"properties": {
|
|
15142
|
+
"task": {
|
|
15143
|
+
"anyOf": [
|
|
15144
|
+
{
|
|
15145
|
+
"$ref": "#/components/schemas/ContextTask"
|
|
15146
|
+
},
|
|
15147
|
+
{
|
|
15148
|
+
"items": {
|
|
15149
|
+
"$ref": "#/components/schemas/ContextTask"
|
|
15150
|
+
},
|
|
15151
|
+
"type": "array"
|
|
15152
|
+
},
|
|
15153
|
+
{
|
|
15154
|
+
"type": "null"
|
|
15155
|
+
}
|
|
15156
|
+
],
|
|
15157
|
+
"title": "Task",
|
|
15158
|
+
"description": "Task implementation details"
|
|
15159
|
+
}
|
|
15160
|
+
},
|
|
15161
|
+
"type": "object",
|
|
15162
|
+
"title": "Context",
|
|
15163
|
+
"description": "Context configuration carried alongside a context tool call."
|
|
15164
|
+
},
|
|
15165
|
+
"ContextTask": {
|
|
15166
|
+
"properties": {
|
|
15167
|
+
"type": {
|
|
15168
|
+
"anyOf": [
|
|
15169
|
+
{
|
|
15170
|
+
"type": "string"
|
|
15171
|
+
},
|
|
15172
|
+
{
|
|
15173
|
+
"type": "null"
|
|
15174
|
+
}
|
|
15175
|
+
],
|
|
15176
|
+
"title": "Type",
|
|
15177
|
+
"description": "The type of the task."
|
|
15178
|
+
},
|
|
15179
|
+
"id": {
|
|
15180
|
+
"anyOf": [
|
|
15181
|
+
{
|
|
15182
|
+
"type": "string"
|
|
15183
|
+
},
|
|
15184
|
+
{
|
|
15185
|
+
"type": "null"
|
|
15186
|
+
}
|
|
15187
|
+
],
|
|
15188
|
+
"title": "Id",
|
|
15189
|
+
"description": "A unique identifier for the task."
|
|
15190
|
+
}
|
|
15191
|
+
},
|
|
15192
|
+
"additionalProperties": true,
|
|
15193
|
+
"type": "object",
|
|
15194
|
+
"title": "ContextTask",
|
|
15195
|
+
"description": "Metadata describing a context task driven by a tool call."
|
|
15196
|
+
},
|
|
15140
15197
|
"Conversation": {
|
|
15141
15198
|
"properties": {
|
|
15142
15199
|
"timestamp": {
|
|
@@ -17273,7 +17330,7 @@
|
|
|
17273
17330
|
"title": "Created At",
|
|
17274
17331
|
"description": "Timestamp at which insight upload folder was created",
|
|
17275
17332
|
"examples": [
|
|
17276
|
-
"2025-11-
|
|
17333
|
+
"2025-11-20T00:00:00Z"
|
|
17277
17334
|
]
|
|
17278
17335
|
},
|
|
17279
17336
|
"updated_at": {
|
|
@@ -17282,7 +17339,7 @@
|
|
|
17282
17339
|
"title": "Updated At",
|
|
17283
17340
|
"description": "Timestamp at which insight upload folder was last updated",
|
|
17284
17341
|
"examples": [
|
|
17285
|
-
"2025-11-
|
|
17342
|
+
"2025-11-21T00:00:00Z"
|
|
17286
17343
|
]
|
|
17287
17344
|
},
|
|
17288
17345
|
"last_updated_by": {
|
|
@@ -17968,7 +18025,7 @@
|
|
|
17968
18025
|
"title": "Created At",
|
|
17969
18026
|
"description": "Timestamp of at which insight tool configuration was created",
|
|
17970
18027
|
"examples": [
|
|
17971
|
-
"2025-11-
|
|
18028
|
+
"2025-11-20T00:00:00Z"
|
|
17972
18029
|
]
|
|
17973
18030
|
},
|
|
17974
18031
|
"updated_at": {
|
|
@@ -17977,7 +18034,7 @@
|
|
|
17977
18034
|
"title": "Updated At",
|
|
17978
18035
|
"description": "Timestamp at which insight tool configuration was last updated",
|
|
17979
18036
|
"examples": [
|
|
17980
|
-
"2025-11-
|
|
18037
|
+
"2025-11-21T00:00:00Z"
|
|
17981
18038
|
]
|
|
17982
18039
|
},
|
|
17983
18040
|
"last_updated_by": {
|
|
@@ -18358,7 +18415,7 @@
|
|
|
18358
18415
|
"title": "Start Datetime",
|
|
18359
18416
|
"description": "Target session timestamp the workflow (backfill) should start. An empty value indicates start on activation - live sessions only",
|
|
18360
18417
|
"examples": [
|
|
18361
|
-
"2025-11-
|
|
18418
|
+
"2025-11-20T00:00:00Z"
|
|
18362
18419
|
]
|
|
18363
18420
|
},
|
|
18364
18421
|
"end_datetime": {
|
|
@@ -18374,7 +18431,7 @@
|
|
|
18374
18431
|
"title": "End Datetime",
|
|
18375
18432
|
"description": "Target session timestamp the workflow (backfill) should end. An empty value indicates no end, i.e., include live sessions until deactivation",
|
|
18376
18433
|
"examples": [
|
|
18377
|
-
"2025-11-
|
|
18434
|
+
"2025-11-21T00:00:00Z"
|
|
18378
18435
|
]
|
|
18379
18436
|
}
|
|
18380
18437
|
},
|
|
@@ -18449,7 +18506,7 @@
|
|
|
18449
18506
|
"title": "Start Datetime",
|
|
18450
18507
|
"description": "Target session timestamp the workflow (backfill) should start. An empty value indicates start on activation - live sessions only",
|
|
18451
18508
|
"examples": [
|
|
18452
|
-
"2025-11-
|
|
18509
|
+
"2025-11-20T00:00:00Z"
|
|
18453
18510
|
]
|
|
18454
18511
|
},
|
|
18455
18512
|
"end_datetime": {
|
|
@@ -18465,7 +18522,7 @@
|
|
|
18465
18522
|
"title": "End Datetime",
|
|
18466
18523
|
"description": "Target session timestamp the workflow (backfill) should end. An empty value indicates no end, i.e., include live sessions until deactivation",
|
|
18467
18524
|
"examples": [
|
|
18468
|
-
"2025-11-
|
|
18525
|
+
"2025-11-21T00:00:00Z"
|
|
18469
18526
|
]
|
|
18470
18527
|
},
|
|
18471
18528
|
"id": {
|
|
@@ -18518,7 +18575,7 @@
|
|
|
18518
18575
|
"title": "Created At",
|
|
18519
18576
|
"description": "Timestamp at which the insight workflow was created",
|
|
18520
18577
|
"examples": [
|
|
18521
|
-
"2025-11-
|
|
18578
|
+
"2025-11-20T00:00:00Z"
|
|
18522
18579
|
]
|
|
18523
18580
|
},
|
|
18524
18581
|
"updated_at": {
|
|
@@ -18527,7 +18584,7 @@
|
|
|
18527
18584
|
"title": "Updated At",
|
|
18528
18585
|
"description": "Timestamp of most recent update to the insight workflow",
|
|
18529
18586
|
"examples": [
|
|
18530
|
-
"2025-11-
|
|
18587
|
+
"2025-11-21T00:00:00Z"
|
|
18531
18588
|
]
|
|
18532
18589
|
},
|
|
18533
18590
|
"last_updated_by": {
|
|
@@ -18623,7 +18680,7 @@
|
|
|
18623
18680
|
"title": "Created At",
|
|
18624
18681
|
"description": "Timestamp at which insight upload folder was created",
|
|
18625
18682
|
"examples": [
|
|
18626
|
-
"2025-11-
|
|
18683
|
+
"2025-11-20T00:00:00Z"
|
|
18627
18684
|
]
|
|
18628
18685
|
},
|
|
18629
18686
|
"updated_at": {
|
|
@@ -18632,7 +18689,7 @@
|
|
|
18632
18689
|
"title": "Updated At",
|
|
18633
18690
|
"description": "Timestamp at which insight upload folder was last updated",
|
|
18634
18691
|
"examples": [
|
|
18635
|
-
"2025-11-
|
|
18692
|
+
"2025-11-21T00:00:00Z"
|
|
18636
18693
|
]
|
|
18637
18694
|
},
|
|
18638
18695
|
"last_updated_by": {
|
|
@@ -18867,7 +18924,7 @@
|
|
|
18867
18924
|
"title": "Created At",
|
|
18868
18925
|
"description": "Timestamp at which insight tool result was created",
|
|
18869
18926
|
"examples": [
|
|
18870
|
-
"2025-11-
|
|
18927
|
+
"2025-11-20T00:00:00Z"
|
|
18871
18928
|
]
|
|
18872
18929
|
},
|
|
18873
18930
|
"updated_at": {
|
|
@@ -18876,7 +18933,7 @@
|
|
|
18876
18933
|
"title": "Updated At",
|
|
18877
18934
|
"description": "Timestamp at which insight tool result was last updated",
|
|
18878
18935
|
"examples": [
|
|
18879
|
-
"2025-11-
|
|
18936
|
+
"2025-11-21T00:00:00Z"
|
|
18880
18937
|
]
|
|
18881
18938
|
},
|
|
18882
18939
|
"upload_file_metadata": {
|
|
@@ -19021,7 +19078,7 @@
|
|
|
19021
19078
|
"title": "Start Time",
|
|
19022
19079
|
"description": "Start time of the uploaded file",
|
|
19023
19080
|
"examples": [
|
|
19024
|
-
"2025-11-
|
|
19081
|
+
"2025-11-20T00:00:00Z"
|
|
19025
19082
|
]
|
|
19026
19083
|
},
|
|
19027
19084
|
"end_time": {
|
|
@@ -19037,7 +19094,7 @@
|
|
|
19037
19094
|
"title": "End Time",
|
|
19038
19095
|
"description": "End time of the uploaded file",
|
|
19039
19096
|
"examples": [
|
|
19040
|
-
"2025-11-
|
|
19097
|
+
"2025-11-21T00:00:00Z"
|
|
19041
19098
|
]
|
|
19042
19099
|
},
|
|
19043
19100
|
"error_message": {
|
|
@@ -19092,7 +19149,7 @@
|
|
|
19092
19149
|
"title": "Created At",
|
|
19093
19150
|
"description": "Timestamp at which insight upload file was created",
|
|
19094
19151
|
"examples": [
|
|
19095
|
-
"2025-11-
|
|
19152
|
+
"2025-11-20T00:00:00Z"
|
|
19096
19153
|
]
|
|
19097
19154
|
}
|
|
19098
19155
|
},
|
|
@@ -22265,7 +22322,7 @@
|
|
|
22265
22322
|
"title": "Created At",
|
|
22266
22323
|
"description": "Timestamp of campaign creation",
|
|
22267
22324
|
"examples": [
|
|
22268
|
-
"2025-11-
|
|
22325
|
+
"2025-11-21T00:00:00Z"
|
|
22269
22326
|
]
|
|
22270
22327
|
},
|
|
22271
22328
|
"updated_at": {
|
|
@@ -22274,7 +22331,7 @@
|
|
|
22274
22331
|
"title": "Updated At",
|
|
22275
22332
|
"description": "Timestamp of campaign update",
|
|
22276
22333
|
"examples": [
|
|
22277
|
-
"2025-11-
|
|
22334
|
+
"2025-11-21T00:00:00Z"
|
|
22278
22335
|
]
|
|
22279
22336
|
},
|
|
22280
22337
|
"last_updated_by": {
|
|
@@ -25532,6 +25589,17 @@
|
|
|
25532
25589
|
"description": "The configuration for an HTTP API call.",
|
|
25533
25590
|
"examples": []
|
|
25534
25591
|
},
|
|
25592
|
+
"context": {
|
|
25593
|
+
"anyOf": [
|
|
25594
|
+
{
|
|
25595
|
+
"$ref": "#/components/schemas/Context"
|
|
25596
|
+
},
|
|
25597
|
+
{
|
|
25598
|
+
"type": "null"
|
|
25599
|
+
}
|
|
25600
|
+
],
|
|
25601
|
+
"description": "The configuration for a context tool."
|
|
25602
|
+
},
|
|
25535
25603
|
"defaults": {
|
|
25536
25604
|
"anyOf": [
|
|
25537
25605
|
{},
|
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.2",
|
|
64
|
-
sdkVersion: "1.0.13-rc.
|
|
65
|
-
genVersion: "2.
|
|
66
|
-
userAgent: "speakeasy-sdk/typescript 1.0.13-rc.
|
|
64
|
+
sdkVersion: "1.0.13-rc.4",
|
|
65
|
+
genVersion: "2.760.2",
|
|
66
|
+
userAgent: "speakeasy-sdk/typescript 1.0.13-rc.4 2.760.2 0.0.2 syllable-sdk",
|
|
67
67
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
ContextTask,
|
|
11
|
+
ContextTask$inboundSchema,
|
|
12
|
+
ContextTask$Outbound,
|
|
13
|
+
ContextTask$outboundSchema,
|
|
14
|
+
} from "./contexttask.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Task implementation details
|
|
18
|
+
*/
|
|
19
|
+
export type Task = ContextTask | Array<ContextTask>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Context configuration carried alongside a context tool call.
|
|
23
|
+
*/
|
|
24
|
+
export type Context = {
|
|
25
|
+
/**
|
|
26
|
+
* Task implementation details
|
|
27
|
+
*/
|
|
28
|
+
task?: ContextTask | Array<ContextTask> | null | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const Task$inboundSchema: z.ZodType<Task, z.ZodTypeDef, unknown> = z
|
|
33
|
+
.union([ContextTask$inboundSchema, z.array(ContextTask$inboundSchema)]);
|
|
34
|
+
/** @internal */
|
|
35
|
+
export type Task$Outbound = ContextTask$Outbound | Array<ContextTask$Outbound>;
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const Task$outboundSchema: z.ZodType<Task$Outbound, z.ZodTypeDef, Task> =
|
|
39
|
+
z.union([ContextTask$outboundSchema, z.array(ContextTask$outboundSchema)]);
|
|
40
|
+
|
|
41
|
+
export function taskToJSON(task: Task): string {
|
|
42
|
+
return JSON.stringify(Task$outboundSchema.parse(task));
|
|
43
|
+
}
|
|
44
|
+
export function taskFromJSON(
|
|
45
|
+
jsonString: string,
|
|
46
|
+
): SafeParseResult<Task, SDKValidationError> {
|
|
47
|
+
return safeParse(
|
|
48
|
+
jsonString,
|
|
49
|
+
(x) => Task$inboundSchema.parse(JSON.parse(x)),
|
|
50
|
+
`Failed to parse 'Task' from JSON`,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const Context$inboundSchema: z.ZodType<Context, z.ZodTypeDef, unknown> =
|
|
56
|
+
z.object({
|
|
57
|
+
task: z.nullable(
|
|
58
|
+
z.union([ContextTask$inboundSchema, z.array(ContextTask$inboundSchema)]),
|
|
59
|
+
).optional(),
|
|
60
|
+
});
|
|
61
|
+
/** @internal */
|
|
62
|
+
export type Context$Outbound = {
|
|
63
|
+
task?: ContextTask$Outbound | Array<ContextTask$Outbound> | null | undefined;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const Context$outboundSchema: z.ZodType<
|
|
68
|
+
Context$Outbound,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
Context
|
|
71
|
+
> = z.object({
|
|
72
|
+
task: z.nullable(
|
|
73
|
+
z.union([ContextTask$outboundSchema, z.array(ContextTask$outboundSchema)]),
|
|
74
|
+
).optional(),
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export function contextToJSON(context: Context): string {
|
|
78
|
+
return JSON.stringify(Context$outboundSchema.parse(context));
|
|
79
|
+
}
|
|
80
|
+
export function contextFromJSON(
|
|
81
|
+
jsonString: string,
|
|
82
|
+
): SafeParseResult<Context, SDKValidationError> {
|
|
83
|
+
return safeParse(
|
|
84
|
+
jsonString,
|
|
85
|
+
(x) => Context$inboundSchema.parse(JSON.parse(x)),
|
|
86
|
+
`Failed to parse 'Context' from JSON`,
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
collectExtraKeys as collectExtraKeys$,
|
|
9
|
+
safeParse,
|
|
10
|
+
} from "../../lib/schemas.js";
|
|
11
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
12
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Metadata describing a context task driven by a tool call.
|
|
16
|
+
*/
|
|
17
|
+
export type ContextTask = {
|
|
18
|
+
/**
|
|
19
|
+
* The type of the task.
|
|
20
|
+
*/
|
|
21
|
+
type?: string | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* A unique identifier for the task.
|
|
24
|
+
*/
|
|
25
|
+
id?: string | null | undefined;
|
|
26
|
+
additionalProperties?: { [k: string]: any } | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const ContextTask$inboundSchema: z.ZodType<
|
|
31
|
+
ContextTask,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
unknown
|
|
34
|
+
> = collectExtraKeys$(
|
|
35
|
+
z.object({
|
|
36
|
+
type: z.nullable(z.string()).optional(),
|
|
37
|
+
id: z.nullable(z.string()).optional(),
|
|
38
|
+
}).catchall(z.any()),
|
|
39
|
+
"additionalProperties",
|
|
40
|
+
true,
|
|
41
|
+
);
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type ContextTask$Outbound = {
|
|
44
|
+
type?: string | null | undefined;
|
|
45
|
+
id?: string | null | undefined;
|
|
46
|
+
[additionalProperties: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const ContextTask$outboundSchema: z.ZodType<
|
|
51
|
+
ContextTask$Outbound,
|
|
52
|
+
z.ZodTypeDef,
|
|
53
|
+
ContextTask
|
|
54
|
+
> = z.object({
|
|
55
|
+
type: z.nullable(z.string()).optional(),
|
|
56
|
+
id: z.nullable(z.string()).optional(),
|
|
57
|
+
additionalProperties: z.record(z.any()).optional(),
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return {
|
|
60
|
+
...v.additionalProperties,
|
|
61
|
+
...remap$(v, {
|
|
62
|
+
additionalProperties: null,
|
|
63
|
+
}),
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export function contextTaskToJSON(contextTask: ContextTask): string {
|
|
68
|
+
return JSON.stringify(ContextTask$outboundSchema.parse(contextTask));
|
|
69
|
+
}
|
|
70
|
+
export function contextTaskFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<ContextTask, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => ContextTask$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'ContextTask' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -43,6 +43,8 @@ export * from "./communicationbatchinput.js";
|
|
|
43
43
|
export * from "./communicationbatchupdate.js";
|
|
44
44
|
export * from "./communicationrequest.js";
|
|
45
45
|
export * from "./communicationrequestresult.js";
|
|
46
|
+
export * from "./context.js";
|
|
47
|
+
export * from "./contexttask.js";
|
|
46
48
|
export * from "./conversation.js";
|
|
47
49
|
export * from "./conversationproperties.js";
|
|
48
50
|
export * from "./createtakeoutresponse.js";
|
|
@@ -8,6 +8,12 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
Context,
|
|
13
|
+
Context$inboundSchema,
|
|
14
|
+
Context$Outbound,
|
|
15
|
+
Context$outboundSchema,
|
|
16
|
+
} from "./context.js";
|
|
11
17
|
import {
|
|
12
18
|
InternalTool,
|
|
13
19
|
InternalTool$inboundSchema,
|
|
@@ -68,6 +74,10 @@ export type ToolDefinition = {
|
|
|
68
74
|
* The configuration for an HTTP API call.
|
|
69
75
|
*/
|
|
70
76
|
endpoint?: ToolHttpEndpoint | null | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The configuration for a context tool.
|
|
79
|
+
*/
|
|
80
|
+
context?: Context | null | undefined;
|
|
71
81
|
/**
|
|
72
82
|
* The default values for the parameters of the function/tool call.
|
|
73
83
|
*/
|
|
@@ -134,6 +144,7 @@ export const ToolDefinition$inboundSchema: z.ZodType<
|
|
|
134
144
|
type: z.nullable(Type$inboundSchema).optional(),
|
|
135
145
|
tool: InternalTool$inboundSchema,
|
|
136
146
|
endpoint: z.nullable(ToolHttpEndpoint$inboundSchema).optional(),
|
|
147
|
+
context: z.nullable(Context$inboundSchema).optional(),
|
|
137
148
|
defaults: z.nullable(
|
|
138
149
|
z.union([z.any(), z.record(ToolParameterDefault$inboundSchema)]),
|
|
139
150
|
).optional(),
|
|
@@ -151,6 +162,7 @@ export type ToolDefinition$Outbound = {
|
|
|
151
162
|
type?: string | null | undefined;
|
|
152
163
|
tool: InternalTool$Outbound;
|
|
153
164
|
endpoint?: ToolHttpEndpoint$Outbound | null | undefined;
|
|
165
|
+
context?: Context$Outbound | null | undefined;
|
|
154
166
|
defaults?:
|
|
155
167
|
| any
|
|
156
168
|
| { [k: string]: ToolParameterDefault$Outbound }
|
|
@@ -170,6 +182,7 @@ export const ToolDefinition$outboundSchema: z.ZodType<
|
|
|
170
182
|
type: z.nullable(Type$outboundSchema).optional(),
|
|
171
183
|
tool: InternalTool$outboundSchema,
|
|
172
184
|
endpoint: z.nullable(ToolHttpEndpoint$outboundSchema).optional(),
|
|
185
|
+
context: z.nullable(Context$outboundSchema).optional(),
|
|
173
186
|
defaults: z.nullable(
|
|
174
187
|
z.union([z.any(), z.record(ToolParameterDefault$outboundSchema)]),
|
|
175
188
|
).optional(),
|
package/src/types/enums.ts
CHANGED
|
@@ -3,34 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { Unrecognized, unrecognized } from "./unrecognized.js";
|
|
6
7
|
|
|
7
|
-
declare const __brand: unique symbol;
|
|
8
|
-
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
|
|
9
8
|
export type ClosedEnum<T extends Readonly<Record<string, string | number>>> =
|
|
10
9
|
T[keyof T];
|
|
11
10
|
export type OpenEnum<T extends Readonly<Record<string, string | number>>> =
|
|
12
11
|
| T[keyof T]
|
|
13
12
|
| Unrecognized<T[keyof T] extends number ? number : string>;
|
|
14
13
|
|
|
15
|
-
function unrecognized<T>(value: T): Unrecognized<T> {
|
|
16
|
-
unrecognizedCount++;
|
|
17
|
-
return value as Unrecognized<T>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let unrecognizedCount = 0;
|
|
21
|
-
let refCount = 0;
|
|
22
|
-
export function unrecognizedCounter() {
|
|
23
|
-
refCount++;
|
|
24
|
-
const start = unrecognizedCount;
|
|
25
|
-
return {
|
|
26
|
-
count: () => {
|
|
27
|
-
const count = unrecognizedCount - start;
|
|
28
|
-
if (--refCount === 0) unrecognizedCount = 0;
|
|
29
|
-
return count;
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
14
|
export function inboundSchema<T extends Record<string, string>>(
|
|
35
15
|
enumObj: T,
|
|
36
16
|
): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown> {
|
package/src/types/index.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
6
|
-
export type { ClosedEnum, OpenEnum
|
|
6
|
+
export type { ClosedEnum, OpenEnum } from "./enums.js";
|
|
7
7
|
export type { Result } from "./fp.js";
|
|
8
8
|
export type { PageIterator, Paginator } from "./operations.js";
|
|
9
9
|
export { createPageIterator } from "./operations.js";
|
|
10
10
|
export { RFCDate } from "./rfcdate.js";
|
|
11
|
+
export * from "./unrecognized.js";
|