@pellux/goodvibes-sdk 0.25.6 → 0.25.7
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/dist/_internal/contracts/artifacts/operator-contract.json +184 -4
- package/dist/_internal/contracts/generated/foundation-metadata.d.ts +2 -2
- package/dist/_internal/contracts/generated/foundation-metadata.js +2 -2
- package/dist/_internal/contracts/generated/operator-contract.d.ts.map +1 -1
- package/dist/_internal/contracts/generated/operator-contract.js +184 -4
- package/dist/_internal/contracts/generated/operator-method-ids.d.ts +1 -1
- package/dist/_internal/contracts/generated/operator-method-ids.d.ts.map +1 -1
- package/dist/_internal/contracts/generated/operator-method-ids.js +1 -0
- package/dist/_internal/contracts/zod-schemas/providers.d.ts +132 -0
- package/dist/_internal/contracts/zod-schemas/providers.d.ts.map +1 -1
- package/dist/_internal/contracts/zod-schemas/providers.js +16 -0
- package/dist/_internal/platform/companion/companion-chat-manager.d.ts +2 -1
- package/dist/_internal/platform/companion/companion-chat-manager.d.ts.map +1 -1
- package/dist/_internal/platform/companion/companion-chat-manager.js +21 -0
- package/dist/_internal/platform/companion/companion-chat-routes.d.ts +1 -0
- package/dist/_internal/platform/companion/companion-chat-routes.d.ts.map +1 -1
- package/dist/_internal/platform/companion/companion-chat-routes.js +76 -0
- package/dist/_internal/platform/companion/companion-chat-types.d.ts +9 -0
- package/dist/_internal/platform/companion/companion-chat-types.d.ts.map +1 -1
- package/dist/_internal/platform/companion/index.d.ts +1 -1
- package/dist/_internal/platform/companion/index.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/method-catalog-control-core.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/method-catalog-control-core.js +17 -0
- package/dist/_internal/platform/daemon/http/provider-routes.d.ts +3 -0
- package/dist/_internal/platform/daemon/http/provider-routes.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/http/provider-routes.js +79 -20
- package/dist/_internal/platform/version.js +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"product": {
|
|
4
4
|
"id": "goodvibes",
|
|
5
5
|
"surface": "operator",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.25.7"
|
|
7
7
|
},
|
|
8
8
|
"auth": {
|
|
9
9
|
"modes": [
|
|
@@ -20780,6 +20780,186 @@
|
|
|
20780
20780
|
},
|
|
20781
20781
|
"invokable": true
|
|
20782
20782
|
},
|
|
20783
|
+
{
|
|
20784
|
+
"id": "companion.chat.sessions.update",
|
|
20785
|
+
"title": "Update Companion Chat Session",
|
|
20786
|
+
"description": "Update companion-chat session metadata, including session-local `provider` and `model`, without changing the daemon/TUI current model.",
|
|
20787
|
+
"category": "companion",
|
|
20788
|
+
"source": "builtin",
|
|
20789
|
+
"access": "authenticated",
|
|
20790
|
+
"transport": [
|
|
20791
|
+
"http",
|
|
20792
|
+
"ws"
|
|
20793
|
+
],
|
|
20794
|
+
"scopes": [
|
|
20795
|
+
"write:sessions"
|
|
20796
|
+
],
|
|
20797
|
+
"http": {
|
|
20798
|
+
"method": "PATCH",
|
|
20799
|
+
"path": "/api/companion/chat/sessions/{sessionId}"
|
|
20800
|
+
},
|
|
20801
|
+
"inputSchema": {
|
|
20802
|
+
"type": "object",
|
|
20803
|
+
"properties": {
|
|
20804
|
+
"title": {
|
|
20805
|
+
"type": "string"
|
|
20806
|
+
},
|
|
20807
|
+
"model": {
|
|
20808
|
+
"type": "string"
|
|
20809
|
+
},
|
|
20810
|
+
"provider": {
|
|
20811
|
+
"type": "string"
|
|
20812
|
+
},
|
|
20813
|
+
"systemPrompt": {
|
|
20814
|
+
"type": "string"
|
|
20815
|
+
}
|
|
20816
|
+
},
|
|
20817
|
+
"additionalProperties": true
|
|
20818
|
+
},
|
|
20819
|
+
"outputSchema": {
|
|
20820
|
+
"type": "object",
|
|
20821
|
+
"properties": {
|
|
20822
|
+
"session": {
|
|
20823
|
+
"type": "object",
|
|
20824
|
+
"properties": {
|
|
20825
|
+
"id": {
|
|
20826
|
+
"type": "string"
|
|
20827
|
+
},
|
|
20828
|
+
"title": {
|
|
20829
|
+
"type": "string"
|
|
20830
|
+
},
|
|
20831
|
+
"status": {
|
|
20832
|
+
"type": "string",
|
|
20833
|
+
"enum": [
|
|
20834
|
+
"active",
|
|
20835
|
+
"closed"
|
|
20836
|
+
]
|
|
20837
|
+
},
|
|
20838
|
+
"createdAt": {
|
|
20839
|
+
"type": "number"
|
|
20840
|
+
},
|
|
20841
|
+
"updatedAt": {
|
|
20842
|
+
"type": "number"
|
|
20843
|
+
},
|
|
20844
|
+
"lastMessageAt": {
|
|
20845
|
+
"type": "number"
|
|
20846
|
+
},
|
|
20847
|
+
"closedAt": {
|
|
20848
|
+
"type": "number"
|
|
20849
|
+
},
|
|
20850
|
+
"messageCount": {
|
|
20851
|
+
"type": "number"
|
|
20852
|
+
},
|
|
20853
|
+
"pendingInputCount": {
|
|
20854
|
+
"type": "number"
|
|
20855
|
+
},
|
|
20856
|
+
"routeIds": {
|
|
20857
|
+
"type": "array",
|
|
20858
|
+
"items": {
|
|
20859
|
+
"type": "string"
|
|
20860
|
+
}
|
|
20861
|
+
},
|
|
20862
|
+
"surfaceKinds": {
|
|
20863
|
+
"type": "array",
|
|
20864
|
+
"items": {
|
|
20865
|
+
"type": "string"
|
|
20866
|
+
}
|
|
20867
|
+
},
|
|
20868
|
+
"participants": {
|
|
20869
|
+
"type": "array",
|
|
20870
|
+
"items": {
|
|
20871
|
+
"type": "object",
|
|
20872
|
+
"properties": {
|
|
20873
|
+
"surfaceKind": {
|
|
20874
|
+
"type": "string"
|
|
20875
|
+
},
|
|
20876
|
+
"surfaceId": {
|
|
20877
|
+
"type": "string"
|
|
20878
|
+
},
|
|
20879
|
+
"externalId": {
|
|
20880
|
+
"type": "string"
|
|
20881
|
+
},
|
|
20882
|
+
"userId": {
|
|
20883
|
+
"type": "string"
|
|
20884
|
+
},
|
|
20885
|
+
"displayName": {
|
|
20886
|
+
"type": "string"
|
|
20887
|
+
},
|
|
20888
|
+
"routeId": {
|
|
20889
|
+
"type": "string"
|
|
20890
|
+
},
|
|
20891
|
+
"lastSeenAt": {
|
|
20892
|
+
"type": "number"
|
|
20893
|
+
}
|
|
20894
|
+
},
|
|
20895
|
+
"required": [
|
|
20896
|
+
"surfaceKind",
|
|
20897
|
+
"surfaceId",
|
|
20898
|
+
"lastSeenAt"
|
|
20899
|
+
],
|
|
20900
|
+
"additionalProperties": false
|
|
20901
|
+
}
|
|
20902
|
+
},
|
|
20903
|
+
"activeAgentId": {
|
|
20904
|
+
"type": "string"
|
|
20905
|
+
},
|
|
20906
|
+
"lastAgentId": {
|
|
20907
|
+
"type": "string"
|
|
20908
|
+
},
|
|
20909
|
+
"lastError": {
|
|
20910
|
+
"type": "string"
|
|
20911
|
+
},
|
|
20912
|
+
"metadata": {
|
|
20913
|
+
"type": "object",
|
|
20914
|
+
"additionalProperties": {
|
|
20915
|
+
"anyOf": [
|
|
20916
|
+
{
|
|
20917
|
+
"type": "string"
|
|
20918
|
+
},
|
|
20919
|
+
{
|
|
20920
|
+
"type": "number"
|
|
20921
|
+
},
|
|
20922
|
+
{
|
|
20923
|
+
"type": "boolean"
|
|
20924
|
+
},
|
|
20925
|
+
{
|
|
20926
|
+
"type": "null"
|
|
20927
|
+
},
|
|
20928
|
+
{
|
|
20929
|
+
"type": "object",
|
|
20930
|
+
"additionalProperties": {}
|
|
20931
|
+
},
|
|
20932
|
+
{
|
|
20933
|
+
"type": "array",
|
|
20934
|
+
"items": {}
|
|
20935
|
+
}
|
|
20936
|
+
]
|
|
20937
|
+
}
|
|
20938
|
+
}
|
|
20939
|
+
},
|
|
20940
|
+
"required": [
|
|
20941
|
+
"id",
|
|
20942
|
+
"title",
|
|
20943
|
+
"status",
|
|
20944
|
+
"createdAt",
|
|
20945
|
+
"updatedAt",
|
|
20946
|
+
"messageCount",
|
|
20947
|
+
"pendingInputCount",
|
|
20948
|
+
"routeIds",
|
|
20949
|
+
"surfaceKinds",
|
|
20950
|
+
"participants",
|
|
20951
|
+
"metadata"
|
|
20952
|
+
],
|
|
20953
|
+
"additionalProperties": false
|
|
20954
|
+
}
|
|
20955
|
+
},
|
|
20956
|
+
"required": [
|
|
20957
|
+
"session"
|
|
20958
|
+
],
|
|
20959
|
+
"additionalProperties": false
|
|
20960
|
+
},
|
|
20961
|
+
"invokable": true
|
|
20962
|
+
},
|
|
20783
20963
|
{
|
|
20784
20964
|
"id": "config.get",
|
|
20785
20965
|
"title": "Get Config",
|
|
@@ -54702,10 +54882,10 @@
|
|
|
54702
54882
|
}
|
|
54703
54883
|
],
|
|
54704
54884
|
"schemaCoverage": {
|
|
54705
|
-
"methods":
|
|
54706
|
-
"typedInputs":
|
|
54885
|
+
"methods": 222,
|
|
54886
|
+
"typedInputs": 222,
|
|
54707
54887
|
"genericInputs": 0,
|
|
54708
|
-
"typedOutputs":
|
|
54888
|
+
"typedOutputs": 222,
|
|
54709
54889
|
"genericOutputs": 0
|
|
54710
54890
|
},
|
|
54711
54891
|
"eventCoverage": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const FOUNDATION_METADATA: {
|
|
2
2
|
readonly productId: "goodvibes";
|
|
3
|
-
readonly productVersion: "0.
|
|
4
|
-
readonly operatorMethodCount:
|
|
3
|
+
readonly productVersion: "0.25.7";
|
|
4
|
+
readonly operatorMethodCount: 222;
|
|
5
5
|
readonly operatorEventCount: 30;
|
|
6
6
|
readonly peerEndpointCount: 6;
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Synced from packages/contracts/src/generated/foundation-metadata.ts
|
|
2
2
|
export const FOUNDATION_METADATA = {
|
|
3
3
|
"productId": "goodvibes",
|
|
4
|
-
"productVersion": "0.
|
|
5
|
-
"operatorMethodCount":
|
|
4
|
+
"productVersion": "0.25.7",
|
|
5
|
+
"operatorMethodCount": 222,
|
|
6
6
|
"operatorEventCount": 30,
|
|
7
7
|
"peerEndpointCount": 6
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator-contract.d.ts","sourceRoot":"","sources":["../../../../src/_internal/contracts/generated/operator-contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"operator-contract.d.ts","sourceRoot":"","sources":["../../../../src/_internal/contracts/generated/operator-contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,eAAO,MAAM,iBAAiB,EAAE,wBAunrDtB,CAAC"}
|
|
@@ -3,7 +3,7 @@ export const OPERATOR_CONTRACT = {
|
|
|
3
3
|
"product": {
|
|
4
4
|
"id": "goodvibes",
|
|
5
5
|
"surface": "operator",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.25.7"
|
|
7
7
|
},
|
|
8
8
|
"auth": {
|
|
9
9
|
"modes": [
|
|
@@ -20780,6 +20780,186 @@ export const OPERATOR_CONTRACT = {
|
|
|
20780
20780
|
},
|
|
20781
20781
|
"invokable": true
|
|
20782
20782
|
},
|
|
20783
|
+
{
|
|
20784
|
+
"id": "companion.chat.sessions.update",
|
|
20785
|
+
"title": "Update Companion Chat Session",
|
|
20786
|
+
"description": "Update companion-chat session metadata, including session-local `provider` and `model`, without changing the daemon/TUI current model.",
|
|
20787
|
+
"category": "companion",
|
|
20788
|
+
"source": "builtin",
|
|
20789
|
+
"access": "authenticated",
|
|
20790
|
+
"transport": [
|
|
20791
|
+
"http",
|
|
20792
|
+
"ws"
|
|
20793
|
+
],
|
|
20794
|
+
"scopes": [
|
|
20795
|
+
"write:sessions"
|
|
20796
|
+
],
|
|
20797
|
+
"http": {
|
|
20798
|
+
"method": "PATCH",
|
|
20799
|
+
"path": "/api/companion/chat/sessions/{sessionId}"
|
|
20800
|
+
},
|
|
20801
|
+
"inputSchema": {
|
|
20802
|
+
"type": "object",
|
|
20803
|
+
"properties": {
|
|
20804
|
+
"title": {
|
|
20805
|
+
"type": "string"
|
|
20806
|
+
},
|
|
20807
|
+
"model": {
|
|
20808
|
+
"type": "string"
|
|
20809
|
+
},
|
|
20810
|
+
"provider": {
|
|
20811
|
+
"type": "string"
|
|
20812
|
+
},
|
|
20813
|
+
"systemPrompt": {
|
|
20814
|
+
"type": "string"
|
|
20815
|
+
}
|
|
20816
|
+
},
|
|
20817
|
+
"additionalProperties": true
|
|
20818
|
+
},
|
|
20819
|
+
"outputSchema": {
|
|
20820
|
+
"type": "object",
|
|
20821
|
+
"properties": {
|
|
20822
|
+
"session": {
|
|
20823
|
+
"type": "object",
|
|
20824
|
+
"properties": {
|
|
20825
|
+
"id": {
|
|
20826
|
+
"type": "string"
|
|
20827
|
+
},
|
|
20828
|
+
"title": {
|
|
20829
|
+
"type": "string"
|
|
20830
|
+
},
|
|
20831
|
+
"status": {
|
|
20832
|
+
"type": "string",
|
|
20833
|
+
"enum": [
|
|
20834
|
+
"active",
|
|
20835
|
+
"closed"
|
|
20836
|
+
]
|
|
20837
|
+
},
|
|
20838
|
+
"createdAt": {
|
|
20839
|
+
"type": "number"
|
|
20840
|
+
},
|
|
20841
|
+
"updatedAt": {
|
|
20842
|
+
"type": "number"
|
|
20843
|
+
},
|
|
20844
|
+
"lastMessageAt": {
|
|
20845
|
+
"type": "number"
|
|
20846
|
+
},
|
|
20847
|
+
"closedAt": {
|
|
20848
|
+
"type": "number"
|
|
20849
|
+
},
|
|
20850
|
+
"messageCount": {
|
|
20851
|
+
"type": "number"
|
|
20852
|
+
},
|
|
20853
|
+
"pendingInputCount": {
|
|
20854
|
+
"type": "number"
|
|
20855
|
+
},
|
|
20856
|
+
"routeIds": {
|
|
20857
|
+
"type": "array",
|
|
20858
|
+
"items": {
|
|
20859
|
+
"type": "string"
|
|
20860
|
+
}
|
|
20861
|
+
},
|
|
20862
|
+
"surfaceKinds": {
|
|
20863
|
+
"type": "array",
|
|
20864
|
+
"items": {
|
|
20865
|
+
"type": "string"
|
|
20866
|
+
}
|
|
20867
|
+
},
|
|
20868
|
+
"participants": {
|
|
20869
|
+
"type": "array",
|
|
20870
|
+
"items": {
|
|
20871
|
+
"type": "object",
|
|
20872
|
+
"properties": {
|
|
20873
|
+
"surfaceKind": {
|
|
20874
|
+
"type": "string"
|
|
20875
|
+
},
|
|
20876
|
+
"surfaceId": {
|
|
20877
|
+
"type": "string"
|
|
20878
|
+
},
|
|
20879
|
+
"externalId": {
|
|
20880
|
+
"type": "string"
|
|
20881
|
+
},
|
|
20882
|
+
"userId": {
|
|
20883
|
+
"type": "string"
|
|
20884
|
+
},
|
|
20885
|
+
"displayName": {
|
|
20886
|
+
"type": "string"
|
|
20887
|
+
},
|
|
20888
|
+
"routeId": {
|
|
20889
|
+
"type": "string"
|
|
20890
|
+
},
|
|
20891
|
+
"lastSeenAt": {
|
|
20892
|
+
"type": "number"
|
|
20893
|
+
}
|
|
20894
|
+
},
|
|
20895
|
+
"required": [
|
|
20896
|
+
"surfaceKind",
|
|
20897
|
+
"surfaceId",
|
|
20898
|
+
"lastSeenAt"
|
|
20899
|
+
],
|
|
20900
|
+
"additionalProperties": false
|
|
20901
|
+
}
|
|
20902
|
+
},
|
|
20903
|
+
"activeAgentId": {
|
|
20904
|
+
"type": "string"
|
|
20905
|
+
},
|
|
20906
|
+
"lastAgentId": {
|
|
20907
|
+
"type": "string"
|
|
20908
|
+
},
|
|
20909
|
+
"lastError": {
|
|
20910
|
+
"type": "string"
|
|
20911
|
+
},
|
|
20912
|
+
"metadata": {
|
|
20913
|
+
"type": "object",
|
|
20914
|
+
"additionalProperties": {
|
|
20915
|
+
"anyOf": [
|
|
20916
|
+
{
|
|
20917
|
+
"type": "string"
|
|
20918
|
+
},
|
|
20919
|
+
{
|
|
20920
|
+
"type": "number"
|
|
20921
|
+
},
|
|
20922
|
+
{
|
|
20923
|
+
"type": "boolean"
|
|
20924
|
+
},
|
|
20925
|
+
{
|
|
20926
|
+
"type": "null"
|
|
20927
|
+
},
|
|
20928
|
+
{
|
|
20929
|
+
"type": "object",
|
|
20930
|
+
"additionalProperties": {}
|
|
20931
|
+
},
|
|
20932
|
+
{
|
|
20933
|
+
"type": "array",
|
|
20934
|
+
"items": {}
|
|
20935
|
+
}
|
|
20936
|
+
]
|
|
20937
|
+
}
|
|
20938
|
+
}
|
|
20939
|
+
},
|
|
20940
|
+
"required": [
|
|
20941
|
+
"id",
|
|
20942
|
+
"title",
|
|
20943
|
+
"status",
|
|
20944
|
+
"createdAt",
|
|
20945
|
+
"updatedAt",
|
|
20946
|
+
"messageCount",
|
|
20947
|
+
"pendingInputCount",
|
|
20948
|
+
"routeIds",
|
|
20949
|
+
"surfaceKinds",
|
|
20950
|
+
"participants",
|
|
20951
|
+
"metadata"
|
|
20952
|
+
],
|
|
20953
|
+
"additionalProperties": false
|
|
20954
|
+
}
|
|
20955
|
+
},
|
|
20956
|
+
"required": [
|
|
20957
|
+
"session"
|
|
20958
|
+
],
|
|
20959
|
+
"additionalProperties": false
|
|
20960
|
+
},
|
|
20961
|
+
"invokable": true
|
|
20962
|
+
},
|
|
20783
20963
|
{
|
|
20784
20964
|
"id": "config.get",
|
|
20785
20965
|
"title": "Get Config",
|
|
@@ -54702,10 +54882,10 @@ export const OPERATOR_CONTRACT = {
|
|
|
54702
54882
|
}
|
|
54703
54883
|
],
|
|
54704
54884
|
"schemaCoverage": {
|
|
54705
|
-
"methods":
|
|
54706
|
-
"typedInputs":
|
|
54885
|
+
"methods": 222,
|
|
54886
|
+
"typedInputs": 222,
|
|
54707
54887
|
"genericInputs": 0,
|
|
54708
|
-
"typedOutputs":
|
|
54888
|
+
"typedOutputs": 222,
|
|
54709
54889
|
"genericOutputs": 0
|
|
54710
54890
|
},
|
|
54711
54891
|
"eventCoverage": {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const OPERATOR_METHOD_IDS: readonly ["accounts.snapshot", "approvals.approve", "approvals.cancel", "approvals.claim", "approvals.deny", "approvals.list", "artifacts.content.get", "artifacts.create", "artifacts.get", "artifacts.list", "automation.heartbeat.list", "automation.heartbeat.run", "automation.integration.snapshot", "automation.jobs.create", "automation.jobs.delete", "automation.jobs.disable", "automation.jobs.enable", "automation.jobs.list", "automation.jobs.patch", "automation.jobs.pause", "automation.jobs.resume", "automation.jobs.run", "automation.runs.cancel", "automation.runs.get", "automation.runs.list", "automation.runs.retry", "channels.accounts.action.default", "channels.accounts.action.named", "channels.accounts.get", "channels.accounts.list", "channels.accounts.surface.list", "channels.actions.invoke", "channels.actions.list", "channels.actions.surface.list", "channels.agent_tools.list", "channels.agent_tools.surface.list", "channels.allowlist.edit", "channels.allowlist.resolve", "channels.authorize", "channels.capabilities.list", "channels.capabilities.surface.list", "channels.directory.query", "channels.doctor.get", "channels.lifecycle.get", "channels.lifecycle.migrate", "channels.policies.audit", "channels.policies.list", "channels.policies.update", "channels.repairs.list", "channels.setup.get", "channels.status", "channels.targets.resolve", "channels.tools.invoke", "channels.tools.list", "channels.tools.surface.list", "companion.chat.events.stream", "companion.chat.messages.create", "companion.chat.messages.list", "companion.chat.sessions.create", "companion.chat.sessions.delete", "companion.chat.sessions.get", "config.get", "config.set", "continuity.snapshot", "control.auth.current", "control.auth.login", "control.clients.list", "control.contract", "control.events.catalog", "control.events.stream", "control.messages.list", "control.methods.get", "control.methods.list", "control.snapshot", "control.status", "control.web", "deliveries.get", "deliveries.list", "health.snapshot", "intelligence.snapshot", "knowledge.candidate.decide", "knowledge.candidate.get", "knowledge.candidates.list", "knowledge.connector.doctor", "knowledge.connector.get", "knowledge.connectors.list", "knowledge.extraction.get", "knowledge.extractions.list", "knowledge.graphql.execute", "knowledge.graphql.schema", "knowledge.ingest.artifact", "knowledge.ingest.bookmarks", "knowledge.ingest.connector", "knowledge.ingest.url", "knowledge.ingest.urls", "knowledge.issues.list", "knowledge.item.get", "knowledge.job-runs.list", "knowledge.job.get", "knowledge.job.run", "knowledge.jobs.list", "knowledge.lint", "knowledge.nodes.list", "knowledge.packet", "knowledge.projection.materialize", "knowledge.projection.render", "knowledge.projections.list", "knowledge.reindex", "knowledge.report.get", "knowledge.reports.list", "knowledge.schedule.delete", "knowledge.schedule.enable", "knowledge.schedule.get", "knowledge.schedule.save", "knowledge.schedules.list", "knowledge.search", "knowledge.source.extraction.get", "knowledge.sources.list", "knowledge.status", "knowledge.usage.list", "local_auth.bootstrap.delete", "local_auth.sessions.delete", "local_auth.status", "local_auth.users.create", "local_auth.users.delete", "local_auth.users.password.rotate", "media.analyze", "media.generate", "media.providers.list", "media.transform", "memory.doctor", "memory.embeddings.default.set", "memory.vector.rebuild", "memory.vector.stats", "multimodal.analyze", "multimodal.packet", "multimodal.providers.list", "multimodal.status", "multimodal.writeback", "panels.list", "panels.open", "providers.get", "providers.list", "providers.usage.get", "remote.node_host.contract", "remote.pair.requests.approve", "remote.pair.requests.list", "remote.pair.requests.reject", "remote.peers.disconnect", "remote.peers.invoke", "remote.peers.list", "remote.peers.token.revoke", "remote.peers.token.rotate", "remote.snapshot", "remote.work.cancel", "remote.work.list", "review.snapshot", "routes.bindings.create", "routes.bindings.delete", "routes.bindings.list", "routes.bindings.patch", "routes.snapshot", "scheduler.capacity", "schedules.create", "schedules.delete", "schedules.disable", "schedules.enable", "schedules.list", "schedules.run", "services.install", "services.restart", "services.start", "services.status", "services.stop", "services.uninstall", "sessions.close", "sessions.create", "sessions.followUp", "sessions.get", "sessions.inputs.cancel", "sessions.inputs.create", "sessions.inputs.list", "sessions.integration.snapshot", "sessions.list", "sessions.messages.create", "sessions.messages.list", "sessions.reopen", "sessions.steer", "settings.snapshot", "surfaces.list", "tasks.cancel", "tasks.create", "tasks.get", "tasks.list", "tasks.retry", "tasks.status", "telemetry.errors.list", "telemetry.events.list", "telemetry.metrics.get", "telemetry.otlp.logs", "telemetry.otlp.metrics", "telemetry.otlp.traces", "telemetry.snapshot", "telemetry.stream", "telemetry.traces.list", "voice.providers.list", "voice.realtime.session", "voice.status", "voice.stt", "voice.tts", "voice.voices.list", "watchers.create", "watchers.delete", "watchers.list", "watchers.patch", "watchers.run", "watchers.start", "watchers.stop", "web_search.providers.list", "web_search.query", "worktrees.snapshot"];
|
|
1
|
+
export declare const OPERATOR_METHOD_IDS: readonly ["accounts.snapshot", "approvals.approve", "approvals.cancel", "approvals.claim", "approvals.deny", "approvals.list", "artifacts.content.get", "artifacts.create", "artifacts.get", "artifacts.list", "automation.heartbeat.list", "automation.heartbeat.run", "automation.integration.snapshot", "automation.jobs.create", "automation.jobs.delete", "automation.jobs.disable", "automation.jobs.enable", "automation.jobs.list", "automation.jobs.patch", "automation.jobs.pause", "automation.jobs.resume", "automation.jobs.run", "automation.runs.cancel", "automation.runs.get", "automation.runs.list", "automation.runs.retry", "channels.accounts.action.default", "channels.accounts.action.named", "channels.accounts.get", "channels.accounts.list", "channels.accounts.surface.list", "channels.actions.invoke", "channels.actions.list", "channels.actions.surface.list", "channels.agent_tools.list", "channels.agent_tools.surface.list", "channels.allowlist.edit", "channels.allowlist.resolve", "channels.authorize", "channels.capabilities.list", "channels.capabilities.surface.list", "channels.directory.query", "channels.doctor.get", "channels.lifecycle.get", "channels.lifecycle.migrate", "channels.policies.audit", "channels.policies.list", "channels.policies.update", "channels.repairs.list", "channels.setup.get", "channels.status", "channels.targets.resolve", "channels.tools.invoke", "channels.tools.list", "channels.tools.surface.list", "companion.chat.events.stream", "companion.chat.messages.create", "companion.chat.messages.list", "companion.chat.sessions.create", "companion.chat.sessions.delete", "companion.chat.sessions.get", "companion.chat.sessions.update", "config.get", "config.set", "continuity.snapshot", "control.auth.current", "control.auth.login", "control.clients.list", "control.contract", "control.events.catalog", "control.events.stream", "control.messages.list", "control.methods.get", "control.methods.list", "control.snapshot", "control.status", "control.web", "deliveries.get", "deliveries.list", "health.snapshot", "intelligence.snapshot", "knowledge.candidate.decide", "knowledge.candidate.get", "knowledge.candidates.list", "knowledge.connector.doctor", "knowledge.connector.get", "knowledge.connectors.list", "knowledge.extraction.get", "knowledge.extractions.list", "knowledge.graphql.execute", "knowledge.graphql.schema", "knowledge.ingest.artifact", "knowledge.ingest.bookmarks", "knowledge.ingest.connector", "knowledge.ingest.url", "knowledge.ingest.urls", "knowledge.issues.list", "knowledge.item.get", "knowledge.job-runs.list", "knowledge.job.get", "knowledge.job.run", "knowledge.jobs.list", "knowledge.lint", "knowledge.nodes.list", "knowledge.packet", "knowledge.projection.materialize", "knowledge.projection.render", "knowledge.projections.list", "knowledge.reindex", "knowledge.report.get", "knowledge.reports.list", "knowledge.schedule.delete", "knowledge.schedule.enable", "knowledge.schedule.get", "knowledge.schedule.save", "knowledge.schedules.list", "knowledge.search", "knowledge.source.extraction.get", "knowledge.sources.list", "knowledge.status", "knowledge.usage.list", "local_auth.bootstrap.delete", "local_auth.sessions.delete", "local_auth.status", "local_auth.users.create", "local_auth.users.delete", "local_auth.users.password.rotate", "media.analyze", "media.generate", "media.providers.list", "media.transform", "memory.doctor", "memory.embeddings.default.set", "memory.vector.rebuild", "memory.vector.stats", "multimodal.analyze", "multimodal.packet", "multimodal.providers.list", "multimodal.status", "multimodal.writeback", "panels.list", "panels.open", "providers.get", "providers.list", "providers.usage.get", "remote.node_host.contract", "remote.pair.requests.approve", "remote.pair.requests.list", "remote.pair.requests.reject", "remote.peers.disconnect", "remote.peers.invoke", "remote.peers.list", "remote.peers.token.revoke", "remote.peers.token.rotate", "remote.snapshot", "remote.work.cancel", "remote.work.list", "review.snapshot", "routes.bindings.create", "routes.bindings.delete", "routes.bindings.list", "routes.bindings.patch", "routes.snapshot", "scheduler.capacity", "schedules.create", "schedules.delete", "schedules.disable", "schedules.enable", "schedules.list", "schedules.run", "services.install", "services.restart", "services.start", "services.status", "services.stop", "services.uninstall", "sessions.close", "sessions.create", "sessions.followUp", "sessions.get", "sessions.inputs.cancel", "sessions.inputs.create", "sessions.inputs.list", "sessions.integration.snapshot", "sessions.list", "sessions.messages.create", "sessions.messages.list", "sessions.reopen", "sessions.steer", "settings.snapshot", "surfaces.list", "tasks.cancel", "tasks.create", "tasks.get", "tasks.list", "tasks.retry", "tasks.status", "telemetry.errors.list", "telemetry.events.list", "telemetry.metrics.get", "telemetry.otlp.logs", "telemetry.otlp.metrics", "telemetry.otlp.traces", "telemetry.snapshot", "telemetry.stream", "telemetry.traces.list", "voice.providers.list", "voice.realtime.session", "voice.status", "voice.stt", "voice.tts", "voice.voices.list", "watchers.create", "watchers.delete", "watchers.list", "watchers.patch", "watchers.run", "watchers.start", "watchers.stop", "web_search.providers.list", "web_search.query", "worktrees.snapshot"];
|
|
2
2
|
export type OperatorMethodId = typeof OPERATOR_METHOD_IDS[number];
|
|
3
3
|
//# sourceMappingURL=operator-method-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator-method-ids.d.ts","sourceRoot":"","sources":["../../../../src/_internal/contracts/generated/operator-method-ids.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"operator-method-ids.d.ts","sourceRoot":"","sources":["../../../../src/_internal/contracts/generated/operator-method-ids.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,+sKA+NtB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAAG,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -28,6 +28,33 @@ export declare const ConfiguredViaSchema: z.ZodEnum<{
|
|
|
28
28
|
subscription: "subscription";
|
|
29
29
|
}>;
|
|
30
30
|
export type ConfiguredVia = z.infer<typeof ConfiguredViaSchema>;
|
|
31
|
+
export declare const ProviderAuthRouteDescriptorSchema: z.ZodObject<{
|
|
32
|
+
route: z.ZodEnum<{
|
|
33
|
+
none: "none";
|
|
34
|
+
"api-key": "api-key";
|
|
35
|
+
"secret-ref": "secret-ref";
|
|
36
|
+
"service-oauth": "service-oauth";
|
|
37
|
+
"subscription-oauth": "subscription-oauth";
|
|
38
|
+
anonymous: "anonymous";
|
|
39
|
+
}>;
|
|
40
|
+
label: z.ZodString;
|
|
41
|
+
configured: z.ZodBoolean;
|
|
42
|
+
usable: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
freshness: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
healthy: "healthy";
|
|
45
|
+
pending: "pending";
|
|
46
|
+
unconfigured: "unconfigured";
|
|
47
|
+
expiring: "expiring";
|
|
48
|
+
expired: "expired";
|
|
49
|
+
}>>;
|
|
50
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
51
|
+
envVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
secretKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
serviceNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
55
|
+
repairHints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type ProviderAuthRouteDescriptor = z.infer<typeof ProviderAuthRouteDescriptorSchema>;
|
|
31
58
|
export declare const ProviderEntrySchema: z.ZodObject<{
|
|
32
59
|
id: z.ZodString;
|
|
33
60
|
label: z.ZodString;
|
|
@@ -39,6 +66,32 @@ export declare const ProviderEntrySchema: z.ZodObject<{
|
|
|
39
66
|
subscription: "subscription";
|
|
40
67
|
}>>;
|
|
41
68
|
envVars: z.ZodArray<z.ZodString>;
|
|
69
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
|
+
route: z.ZodEnum<{
|
|
71
|
+
none: "none";
|
|
72
|
+
"api-key": "api-key";
|
|
73
|
+
"secret-ref": "secret-ref";
|
|
74
|
+
"service-oauth": "service-oauth";
|
|
75
|
+
"subscription-oauth": "subscription-oauth";
|
|
76
|
+
anonymous: "anonymous";
|
|
77
|
+
}>;
|
|
78
|
+
label: z.ZodString;
|
|
79
|
+
configured: z.ZodBoolean;
|
|
80
|
+
usable: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
freshness: z.ZodOptional<z.ZodEnum<{
|
|
82
|
+
healthy: "healthy";
|
|
83
|
+
pending: "pending";
|
|
84
|
+
unconfigured: "unconfigured";
|
|
85
|
+
expiring: "expiring";
|
|
86
|
+
expired: "expired";
|
|
87
|
+
}>>;
|
|
88
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
89
|
+
envVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
secretKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
91
|
+
serviceNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
93
|
+
repairHints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
|
+
}, z.core.$strip>>>;
|
|
42
95
|
models: z.ZodArray<z.ZodObject<{
|
|
43
96
|
id: z.ZodString;
|
|
44
97
|
registryKey: z.ZodString;
|
|
@@ -60,6 +113,32 @@ export declare const ListProvidersResponseSchema: z.ZodObject<{
|
|
|
60
113
|
subscription: "subscription";
|
|
61
114
|
}>>;
|
|
62
115
|
envVars: z.ZodArray<z.ZodString>;
|
|
116
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
117
|
+
route: z.ZodEnum<{
|
|
118
|
+
none: "none";
|
|
119
|
+
"api-key": "api-key";
|
|
120
|
+
"secret-ref": "secret-ref";
|
|
121
|
+
"service-oauth": "service-oauth";
|
|
122
|
+
"subscription-oauth": "subscription-oauth";
|
|
123
|
+
anonymous: "anonymous";
|
|
124
|
+
}>;
|
|
125
|
+
label: z.ZodString;
|
|
126
|
+
configured: z.ZodBoolean;
|
|
127
|
+
usable: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
freshness: z.ZodOptional<z.ZodEnum<{
|
|
129
|
+
healthy: "healthy";
|
|
130
|
+
pending: "pending";
|
|
131
|
+
unconfigured: "unconfigured";
|
|
132
|
+
expiring: "expiring";
|
|
133
|
+
expired: "expired";
|
|
134
|
+
}>>;
|
|
135
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
136
|
+
envVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
137
|
+
secretKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
138
|
+
serviceNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
139
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
repairHints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
+
}, z.core.$strip>>>;
|
|
63
142
|
models: z.ZodArray<z.ZodObject<{
|
|
64
143
|
id: z.ZodString;
|
|
65
144
|
registryKey: z.ZodString;
|
|
@@ -73,6 +152,7 @@ export declare const ListProvidersResponseSchema: z.ZodObject<{
|
|
|
73
152
|
provider: z.ZodString;
|
|
74
153
|
id: z.ZodString;
|
|
75
154
|
}, z.core.$strip>>;
|
|
155
|
+
secretsResolutionSkipped: z.ZodOptional<z.ZodBoolean>;
|
|
76
156
|
}, z.core.$strip>;
|
|
77
157
|
export type ListProvidersResponse = z.infer<typeof ListProvidersResponseSchema>;
|
|
78
158
|
export declare const CurrentModelResponseSchema: z.ZodObject<{
|
|
@@ -88,6 +168,32 @@ export declare const CurrentModelResponseSchema: z.ZodObject<{
|
|
|
88
168
|
anonymous: "anonymous";
|
|
89
169
|
subscription: "subscription";
|
|
90
170
|
}>>;
|
|
171
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
172
|
+
route: z.ZodEnum<{
|
|
173
|
+
none: "none";
|
|
174
|
+
"api-key": "api-key";
|
|
175
|
+
"secret-ref": "secret-ref";
|
|
176
|
+
"service-oauth": "service-oauth";
|
|
177
|
+
"subscription-oauth": "subscription-oauth";
|
|
178
|
+
anonymous: "anonymous";
|
|
179
|
+
}>;
|
|
180
|
+
label: z.ZodString;
|
|
181
|
+
configured: z.ZodBoolean;
|
|
182
|
+
usable: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
freshness: z.ZodOptional<z.ZodEnum<{
|
|
184
|
+
healthy: "healthy";
|
|
185
|
+
pending: "pending";
|
|
186
|
+
unconfigured: "unconfigured";
|
|
187
|
+
expiring: "expiring";
|
|
188
|
+
expired: "expired";
|
|
189
|
+
}>>;
|
|
190
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
191
|
+
envVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
192
|
+
secretKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
193
|
+
serviceNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
194
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
195
|
+
repairHints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
196
|
+
}, z.core.$strip>>>;
|
|
91
197
|
}, z.core.$strip>;
|
|
92
198
|
export type CurrentModelResponse = z.infer<typeof CurrentModelResponseSchema>;
|
|
93
199
|
export declare const PatchCurrentModelBodySchema: z.ZodObject<{
|
|
@@ -118,6 +224,32 @@ export declare const PatchCurrentModelResponseSchema: z.ZodObject<{
|
|
|
118
224
|
anonymous: "anonymous";
|
|
119
225
|
subscription: "subscription";
|
|
120
226
|
}>>;
|
|
227
|
+
routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
228
|
+
route: z.ZodEnum<{
|
|
229
|
+
none: "none";
|
|
230
|
+
"api-key": "api-key";
|
|
231
|
+
"secret-ref": "secret-ref";
|
|
232
|
+
"service-oauth": "service-oauth";
|
|
233
|
+
"subscription-oauth": "subscription-oauth";
|
|
234
|
+
anonymous: "anonymous";
|
|
235
|
+
}>;
|
|
236
|
+
label: z.ZodString;
|
|
237
|
+
configured: z.ZodBoolean;
|
|
238
|
+
usable: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
+
freshness: z.ZodOptional<z.ZodEnum<{
|
|
240
|
+
healthy: "healthy";
|
|
241
|
+
pending: "pending";
|
|
242
|
+
unconfigured: "unconfigured";
|
|
243
|
+
expiring: "expiring";
|
|
244
|
+
expired: "expired";
|
|
245
|
+
}>>;
|
|
246
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
247
|
+
envVars: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
248
|
+
secretKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
249
|
+
serviceNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
250
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
251
|
+
repairHints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
252
|
+
}, z.core.$strip>>>;
|
|
121
253
|
persisted: z.ZodBoolean;
|
|
122
254
|
}, z.core.$strip>;
|
|
123
255
|
export type PatchCurrentModelResponse = z.infer<typeof PatchCurrentModelResponseSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../../../src/_internal/contracts/zod-schemas/providers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B;;;;;;;GAOG;AAEH,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,wBAAwB;;;;;;iBAMnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,mBAAmB;;;;;EAA0D,CAAC;AAC3F,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../../../src/_internal/contracts/zod-schemas/providers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B;;;;;;;GAOG;AAEH,eAAO,MAAM,sBAAsB;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAA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AA4B,CAAC,CAAC;AAElF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;iBAQlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -21,22 +21,38 @@ export const ProviderModelEntrySchema = z.object({
|
|
|
21
21
|
contextWindow: z.number().optional(),
|
|
22
22
|
});
|
|
23
23
|
export const ConfiguredViaSchema = z.enum(['env', 'secrets', 'subscription', 'anonymous']);
|
|
24
|
+
export const ProviderAuthRouteDescriptorSchema = z.object({
|
|
25
|
+
route: z.enum(['api-key', 'secret-ref', 'service-oauth', 'subscription-oauth', 'anonymous', 'none']),
|
|
26
|
+
label: z.string(),
|
|
27
|
+
configured: z.boolean(),
|
|
28
|
+
usable: z.boolean().optional(),
|
|
29
|
+
freshness: z.enum(['healthy', 'expiring', 'expired', 'pending', 'unconfigured']).optional(),
|
|
30
|
+
detail: z.string().optional(),
|
|
31
|
+
envVars: z.array(z.string()).optional(),
|
|
32
|
+
secretKeys: z.array(z.string()).optional(),
|
|
33
|
+
serviceNames: z.array(z.string()).optional(),
|
|
34
|
+
providerId: z.string().optional(),
|
|
35
|
+
repairHints: z.array(z.string()).optional(),
|
|
36
|
+
});
|
|
24
37
|
export const ProviderEntrySchema = z.object({
|
|
25
38
|
id: z.string(),
|
|
26
39
|
label: z.string(),
|
|
27
40
|
configured: z.boolean(),
|
|
28
41
|
configuredVia: ConfiguredViaSchema.optional(),
|
|
29
42
|
envVars: z.array(z.string()),
|
|
43
|
+
routes: z.array(ProviderAuthRouteDescriptorSchema).optional(),
|
|
30
44
|
models: z.array(ProviderModelEntrySchema),
|
|
31
45
|
});
|
|
32
46
|
export const ListProvidersResponseSchema = z.object({
|
|
33
47
|
providers: z.array(ProviderEntrySchema),
|
|
34
48
|
currentModel: ProviderModelRefSchema.nullable(),
|
|
49
|
+
secretsResolutionSkipped: z.boolean().optional(),
|
|
35
50
|
});
|
|
36
51
|
export const CurrentModelResponseSchema = z.object({
|
|
37
52
|
model: ProviderModelRefSchema.nullable(),
|
|
38
53
|
configured: z.boolean(),
|
|
39
54
|
configuredVia: ConfiguredViaSchema.optional(),
|
|
55
|
+
routes: z.array(ProviderAuthRouteDescriptorSchema).optional(),
|
|
40
56
|
});
|
|
41
57
|
export const PatchCurrentModelBodySchema = z.object({
|
|
42
58
|
registryKey: z.string().min(1),
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* for that specific session — never the global TUI event feed.
|
|
20
20
|
* - A GC sweep closes sessions that have been idle beyond the TTL.
|
|
21
21
|
*/
|
|
22
|
-
import type { CompanionChatMessage, CompanionChatSession, CreateCompanionChatSessionInput } from './companion-chat-types.js';
|
|
22
|
+
import type { CompanionChatMessage, CompanionChatSession, CreateCompanionChatSessionInput, UpdateCompanionChatSessionInput } from './companion-chat-types.js';
|
|
23
23
|
import type { CompanionChatRateLimiterOptions } from './companion-chat-rate-limiter.js';
|
|
24
24
|
import type { ToolRegistry } from '../tools/registry.js';
|
|
25
25
|
export interface CompanionProviderMessage {
|
|
@@ -113,6 +113,7 @@ export declare class CompanionChatManager {
|
|
|
113
113
|
createSession(input?: CreateCompanionChatSessionInput): CompanionChatSession;
|
|
114
114
|
getSession(sessionId: string): CompanionChatSession | null;
|
|
115
115
|
getMessages(sessionId: string): CompanionChatMessage[];
|
|
116
|
+
updateSession(sessionId: string, input: UpdateCompanionChatSessionInput): CompanionChatSession;
|
|
116
117
|
/**
|
|
117
118
|
* Register the SSE clientId for this session so events are routed only to
|
|
118
119
|
* the correct subscriber. Replaces any previous registration (single subscriber
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-chat-manager.d.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,0BAA0B,CAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,SAAK,EACb,OAAO,GAAE;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAC5C,OAAO,CAAC,wBAAwB,CAAC;YAqBtB,oBAAoB;IAiDlC,OAAO,IAAI,IAAI;YAgBD,QAAQ;IAgKtB,QAAQ,IAAI,IAAI;IA6BhB,OAAO,CAAC,WAAW;IASnB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;YAeF,OAAO;IAOrB,OAAO,CAAC,mBAAmB;CAO5B"}
|
|
@@ -153,6 +153,27 @@ export class CompanionChatManager {
|
|
|
153
153
|
getMessages(sessionId) {
|
|
154
154
|
return this.sessions.get(sessionId)?.messages ?? [];
|
|
155
155
|
}
|
|
156
|
+
updateSession(sessionId, input) {
|
|
157
|
+
const session = this.sessions.get(sessionId);
|
|
158
|
+
if (!session) {
|
|
159
|
+
throw Object.assign(new Error(`Session not found: ${sessionId}`), { code: 'SESSION_NOT_FOUND', status: 404 });
|
|
160
|
+
}
|
|
161
|
+
if (session.meta.status === 'closed') {
|
|
162
|
+
throw Object.assign(new Error(`Session is closed: ${sessionId}`), { code: 'SESSION_CLOSED', status: 409 });
|
|
163
|
+
}
|
|
164
|
+
const patch = { updatedAt: Date.now() };
|
|
165
|
+
if (input.title !== undefined)
|
|
166
|
+
patch.title = input.title;
|
|
167
|
+
if (input.model !== undefined)
|
|
168
|
+
patch.model = input.model;
|
|
169
|
+
if (input.provider !== undefined)
|
|
170
|
+
patch.provider = input.provider;
|
|
171
|
+
if (input.systemPrompt !== undefined)
|
|
172
|
+
patch.systemPrompt = input.systemPrompt;
|
|
173
|
+
const updated = this._updateMeta(session, patch);
|
|
174
|
+
void this._persist(sessionId);
|
|
175
|
+
return updated;
|
|
176
|
+
}
|
|
156
177
|
/**
|
|
157
178
|
* Register the SSE clientId for this session so events are routed only to
|
|
158
179
|
* the correct subscriber. Replaces any previous registration (single subscriber
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Routes:
|
|
7
7
|
* POST /api/companion/chat/sessions
|
|
8
8
|
* GET /api/companion/chat/sessions/:sessionId
|
|
9
|
+
* PATCH /api/companion/chat/sessions/:sessionId
|
|
9
10
|
* DELETE /api/companion/chat/sessions/:sessionId
|
|
10
11
|
* POST /api/companion/chat/sessions/:sessionId/messages
|
|
11
12
|
* GET /api/companion/chat/sessions/:sessionId/messages
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-chat-routes.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/companion/companion-chat-routes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"companion-chat-routes.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/companion/companion-chat-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAOH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAMjF;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAmD1B;AA2KD;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAMlF"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Routes:
|
|
7
7
|
* POST /api/companion/chat/sessions
|
|
8
8
|
* GET /api/companion/chat/sessions/:sessionId
|
|
9
|
+
* PATCH /api/companion/chat/sessions/:sessionId
|
|
9
10
|
* DELETE /api/companion/chat/sessions/:sessionId
|
|
10
11
|
* POST /api/companion/chat/sessions/:sessionId/messages
|
|
11
12
|
* GET /api/companion/chat/sessions/:sessionId/messages
|
|
@@ -38,6 +39,10 @@ export async function dispatchCompanionChatRoutes(req, context) {
|
|
|
38
39
|
if (!sub && req.method === 'GET') {
|
|
39
40
|
return handleGetSession(sessionId, context);
|
|
40
41
|
}
|
|
42
|
+
// PATCH /api/companion/chat/sessions/:sessionId
|
|
43
|
+
if (!sub && req.method === 'PATCH') {
|
|
44
|
+
return handleUpdateSession(req, sessionId, context);
|
|
45
|
+
}
|
|
41
46
|
// DELETE /api/companion/chat/sessions/:sessionId
|
|
42
47
|
if (!sub && req.method === 'DELETE') {
|
|
43
48
|
return handleDeleteSession(sessionId, context);
|
|
@@ -99,6 +104,77 @@ async function handleGetSession(sessionId, context) {
|
|
|
99
104
|
return Response.json({ session, messages });
|
|
100
105
|
}
|
|
101
106
|
// ---------------------------------------------------------------------------
|
|
107
|
+
// PATCH /api/companion/chat/sessions/:sessionId
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
function hasOwn(body, key) {
|
|
110
|
+
return Object.prototype.hasOwnProperty.call(body, key);
|
|
111
|
+
}
|
|
112
|
+
function readOptionalNonEmptyString(body, key) {
|
|
113
|
+
if (!hasOwn(body, key))
|
|
114
|
+
return undefined;
|
|
115
|
+
const value = body[key];
|
|
116
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
117
|
+
return Response.json({ error: `${key} must be a non-empty string`, code: 'INVALID_INPUT' }, { status: 400 });
|
|
118
|
+
}
|
|
119
|
+
return value.trim();
|
|
120
|
+
}
|
|
121
|
+
function readOptionalSystemPrompt(body) {
|
|
122
|
+
if (!hasOwn(body, 'systemPrompt'))
|
|
123
|
+
return undefined;
|
|
124
|
+
const value = body['systemPrompt'];
|
|
125
|
+
if (value === null)
|
|
126
|
+
return null;
|
|
127
|
+
if (typeof value !== 'string') {
|
|
128
|
+
return Response.json({ error: 'systemPrompt must be a string or null', code: 'INVALID_INPUT' }, { status: 400 });
|
|
129
|
+
}
|
|
130
|
+
return value;
|
|
131
|
+
}
|
|
132
|
+
async function handleUpdateSession(req, sessionId, context) {
|
|
133
|
+
const bodyOrResponse = await context.parseJsonBody(req);
|
|
134
|
+
if (bodyOrResponse instanceof Response)
|
|
135
|
+
return bodyOrResponse;
|
|
136
|
+
const body = bodyOrResponse;
|
|
137
|
+
const input = {};
|
|
138
|
+
const title = readOptionalNonEmptyString(body, 'title');
|
|
139
|
+
if (title instanceof Response)
|
|
140
|
+
return title;
|
|
141
|
+
if (title !== undefined)
|
|
142
|
+
input.title = title;
|
|
143
|
+
const model = readOptionalNonEmptyString(body, 'model');
|
|
144
|
+
if (model instanceof Response)
|
|
145
|
+
return model;
|
|
146
|
+
if (model !== undefined) {
|
|
147
|
+
input.model = model;
|
|
148
|
+
if (!hasOwn(body, 'provider') && model.includes(':')) {
|
|
149
|
+
const providerId = model.split(':')[0];
|
|
150
|
+
if (providerId)
|
|
151
|
+
input.provider = providerId;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const provider = readOptionalNonEmptyString(body, 'provider');
|
|
155
|
+
if (provider instanceof Response)
|
|
156
|
+
return provider;
|
|
157
|
+
if (provider !== undefined)
|
|
158
|
+
input.provider = provider;
|
|
159
|
+
const systemPrompt = readOptionalSystemPrompt(body);
|
|
160
|
+
if (systemPrompt instanceof Response)
|
|
161
|
+
return systemPrompt;
|
|
162
|
+
if (systemPrompt !== undefined)
|
|
163
|
+
input.systemPrompt = systemPrompt;
|
|
164
|
+
if (Object.keys(input).length === 0) {
|
|
165
|
+
return Response.json({ error: 'At least one of title, provider, model, or systemPrompt is required', code: 'INVALID_INPUT' }, { status: 400 });
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const session = context.chatManager.updateSession(sessionId, input);
|
|
169
|
+
return Response.json({ session });
|
|
170
|
+
}
|
|
171
|
+
catch (err) {
|
|
172
|
+
const e = err;
|
|
173
|
+
const status = e.status ?? 500;
|
|
174
|
+
return Response.json({ error: e.message ?? 'Internal error', code: e.code ?? 'INTERNAL_ERROR' }, { status });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// ---------------------------------------------------------------------------
|
|
102
178
|
// DELETE /api/companion/chat/sessions/:sessionId
|
|
103
179
|
// ---------------------------------------------------------------------------
|
|
104
180
|
async function handleDeleteSession(sessionId, context) {
|
|
@@ -42,10 +42,19 @@ export interface CreateCompanionChatSessionInput {
|
|
|
42
42
|
readonly provider?: string;
|
|
43
43
|
readonly systemPrompt?: string;
|
|
44
44
|
}
|
|
45
|
+
export interface UpdateCompanionChatSessionInput {
|
|
46
|
+
readonly title?: string;
|
|
47
|
+
readonly model?: string;
|
|
48
|
+
readonly provider?: string;
|
|
49
|
+
readonly systemPrompt?: string | null;
|
|
50
|
+
}
|
|
45
51
|
export interface CreateCompanionChatSessionOutput {
|
|
46
52
|
readonly sessionId: string;
|
|
47
53
|
readonly createdAt: number;
|
|
48
54
|
}
|
|
55
|
+
export interface UpdateCompanionChatSessionOutput {
|
|
56
|
+
readonly session: CompanionChatSession;
|
|
57
|
+
}
|
|
49
58
|
export interface PostCompanionChatMessageInput {
|
|
50
59
|
readonly content: string;
|
|
51
60
|
readonly metadata?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-chat-types.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/companion/companion-chat-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAE5F;;;;GAIG;AACH,YAAY,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAE5F,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AAExD,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7D,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,WAAW,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;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,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAC;CAChD;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,sBAAsB,GAC9B,6BAA6B,GAC7B,2BAA2B,GAC3B,8BAA8B,GAC9B,gCAAgC,GAChC,+BAA+B,GAC/B,2BAA2B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { CompanionChatMessage, CompanionChatSession, CompanionChatSessionKind, CompanionChatSessionStatus, CompanionChatMessageRole, CompanionChatTurnEvent, CompanionChatTurnStartedEvent, CompanionChatTurnDeltaEvent, CompanionChatTurnToolCallEvent, CompanionChatTurnToolResultEvent, CompanionChatTurnCompletedEvent, CompanionChatTurnErrorEvent, CreateCompanionChatSessionInput, CreateCompanionChatSessionOutput, PostCompanionChatMessageInput, PostCompanionChatMessageOutput, GetCompanionChatSessionOutput, ConversationMessageEnvelope, } from './companion-chat-types.js';
|
|
1
|
+
export type { CompanionChatMessage, CompanionChatSession, CompanionChatSessionKind, CompanionChatSessionStatus, CompanionChatMessageRole, CompanionChatTurnEvent, CompanionChatTurnStartedEvent, CompanionChatTurnDeltaEvent, CompanionChatTurnToolCallEvent, CompanionChatTurnToolResultEvent, CompanionChatTurnCompletedEvent, CompanionChatTurnErrorEvent, CreateCompanionChatSessionInput, CreateCompanionChatSessionOutput, UpdateCompanionChatSessionInput, UpdateCompanionChatSessionOutput, PostCompanionChatMessageInput, PostCompanionChatMessageOutput, GetCompanionChatSessionOutput, ConversationMessageEnvelope, } from './companion-chat-types.js';
|
|
2
2
|
export type { CompanionLLMProvider, CompanionChatEventPublisher, CompanionChatManagerConfig, CompanionProviderMessage, CompanionProviderChunk, } from './companion-chat-manager.js';
|
|
3
3
|
export { CompanionChatManager } from './companion-chat-manager.js';
|
|
4
4
|
export { dispatchCompanionChatRoutes } from './companion-chat-routes.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/companion/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,EAC3B,8BAA8B,EAC9B,gCAAgC,EAChC,+BAA+B,EAC/B,2BAA2B,EAC3B,+BAA+B,EAC/B,gCAAgC,EAChC,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,E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EAAE,MAAM,kCAAkC,CAAC;AAC5E,YAAY,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-catalog-control-core.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/control-plane/method-catalog-control-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAkE1E,eAAO,MAAM,0CAA0C,EAAE,SAAS,uBAAuB,
|
|
1
|
+
{"version":3,"file":"method-catalog-control-core.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/control-plane/method-catalog-control-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAkE1E,eAAO,MAAM,0CAA0C,EAAE,SAAS,uBAAuB,EA8oBxF,CAAC"}
|
|
@@ -596,6 +596,23 @@ export const builtinGatewayControlCoreMethodDescriptors = [
|
|
|
596
596
|
messages: arraySchema(objectSchema({}, [])),
|
|
597
597
|
}, ['session', 'messages']),
|
|
598
598
|
}),
|
|
599
|
+
methodDescriptor({
|
|
600
|
+
id: 'companion.chat.sessions.update',
|
|
601
|
+
title: 'Update Companion Chat Session',
|
|
602
|
+
description: 'Update companion-chat session metadata, including session-local `provider` and `model`, without changing the daemon/TUI current model.',
|
|
603
|
+
category: 'companion',
|
|
604
|
+
scopes: ['write:sessions'],
|
|
605
|
+
http: { method: 'PATCH', path: '/api/companion/chat/sessions/{sessionId}' },
|
|
606
|
+
inputSchema: bodyEnvelopeSchema({
|
|
607
|
+
title: STRING_SCHEMA,
|
|
608
|
+
model: STRING_SCHEMA,
|
|
609
|
+
provider: STRING_SCHEMA,
|
|
610
|
+
systemPrompt: STRING_SCHEMA,
|
|
611
|
+
}, []),
|
|
612
|
+
outputSchema: objectSchema({
|
|
613
|
+
session: SHARED_SESSION_RECORD_SCHEMA,
|
|
614
|
+
}, ['session']),
|
|
615
|
+
}),
|
|
599
616
|
methodDescriptor({
|
|
600
617
|
id: 'companion.chat.sessions.delete',
|
|
601
618
|
title: 'Close Companion Chat Session',
|
|
@@ -15,6 +15,7 @@ import type { ProviderRegistry } from '../../providers/registry.js';
|
|
|
15
15
|
import type { ConfigManager } from '../../config/manager.js';
|
|
16
16
|
import type { RuntimeEventBus } from '../../runtime/events/index.js';
|
|
17
17
|
import type { SecretsManager } from '../../config/secrets.js';
|
|
18
|
+
import type { ProviderAuthRouteDescriptor } from '../../providers/interface.js';
|
|
18
19
|
export interface ProviderModelRef {
|
|
19
20
|
readonly registryKey: string;
|
|
20
21
|
readonly provider: string;
|
|
@@ -34,6 +35,7 @@ export interface ProviderEntry {
|
|
|
34
35
|
readonly configured: boolean;
|
|
35
36
|
readonly configuredVia?: ConfiguredVia;
|
|
36
37
|
readonly envVars: string[];
|
|
38
|
+
readonly routes?: readonly ProviderAuthRouteDescriptor[];
|
|
37
39
|
readonly models: ProviderModelEntry[];
|
|
38
40
|
}
|
|
39
41
|
export interface ListProvidersResponse {
|
|
@@ -58,6 +60,7 @@ export interface CurrentModelResponse {
|
|
|
58
60
|
readonly model: ProviderModelRef | null;
|
|
59
61
|
readonly configured: boolean;
|
|
60
62
|
readonly configuredVia?: ConfiguredVia;
|
|
63
|
+
readonly routes?: readonly ProviderAuthRouteDescriptor[];
|
|
61
64
|
}
|
|
62
65
|
export interface PatchCurrentModelResponse extends CurrentModelResponse {
|
|
63
66
|
readonly persisted: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-routes.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/daemon/http/provider-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+B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101,26 +101,78 @@ function getConfiguredVia(providerId, envVars, providerRegistry, secretKeys) {
|
|
|
101
101
|
return 'subscription';
|
|
102
102
|
return undefined;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function isRuntimeRouteUsable(route) {
|
|
105
|
+
return (route.configured &&
|
|
106
|
+
route.usable !== false &&
|
|
107
|
+
route.freshness !== 'expired' &&
|
|
108
|
+
route.freshness !== 'pending' &&
|
|
109
|
+
route.freshness !== 'unconfigured');
|
|
110
|
+
}
|
|
111
|
+
function getConfiguredViaFromRuntimeRoutes(routes) {
|
|
112
|
+
const usableRoutes = routes.filter(isRuntimeRouteUsable);
|
|
113
|
+
if (usableRoutes.some((route) => route.route === 'subscription-oauth'))
|
|
114
|
+
return 'subscription';
|
|
115
|
+
if (usableRoutes.some((route) => route.route === 'secret-ref'))
|
|
116
|
+
return 'secrets';
|
|
117
|
+
const apiKeyRoute = usableRoutes.find((route) => route.route === 'api-key');
|
|
118
|
+
if (apiKeyRoute) {
|
|
119
|
+
const hasEnv = (apiKeyRoute.envVars ?? []).some((envVar) => {
|
|
120
|
+
const value = process.env[envVar];
|
|
121
|
+
return typeof value === 'string' && value.length > 0;
|
|
122
|
+
});
|
|
123
|
+
return hasEnv ? 'env' : 'secrets';
|
|
124
|
+
}
|
|
125
|
+
if (usableRoutes.some((route) => route.route === 'anonymous'))
|
|
126
|
+
return 'anonymous';
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
async function describeAuthRoutes(providerRegistry, providerId) {
|
|
130
|
+
const maybeRegistry = providerRegistry;
|
|
131
|
+
if (typeof maybeRegistry.describeRuntime !== 'function')
|
|
132
|
+
return [];
|
|
133
|
+
try {
|
|
134
|
+
return (await maybeRegistry.describeRuntime(providerId))?.auth?.routes ?? [];
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
logger.debug('[provider-routes] Failed to read provider runtime metadata', {
|
|
138
|
+
providerId,
|
|
139
|
+
error: err instanceof Error ? err.message : String(err),
|
|
140
|
+
});
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
async function resolveProviderConfiguredStatus(providerId, envVars, providerRegistry, secretKeys) {
|
|
145
|
+
const routes = await describeAuthRoutes(providerRegistry, providerId);
|
|
146
|
+
const runtimeVia = getConfiguredViaFromRuntimeRoutes(routes);
|
|
147
|
+
const legacyVia = getConfiguredVia(providerId, envVars, providerRegistry, secretKeys);
|
|
148
|
+
const hasUsableRuntimeRoute = routes.some((route) => isRuntimeRouteUsable(route) && route.route !== 'none');
|
|
149
|
+
const configuredVia = runtimeVia ?? legacyVia;
|
|
150
|
+
return {
|
|
151
|
+
configured: configuredVia !== undefined || hasUsableRuntimeRoute,
|
|
152
|
+
configuredVia,
|
|
153
|
+
...(routes.length > 0 ? { routes } : {}),
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
async function buildCurrentModelResponse(providerRegistry, secretKeys) {
|
|
105
157
|
let model = null;
|
|
106
158
|
let configured = false;
|
|
107
159
|
let configuredVia;
|
|
160
|
+
let routes;
|
|
108
161
|
try {
|
|
109
162
|
const current = providerRegistry.getCurrentModel();
|
|
110
163
|
const registryKey = current.registryKey ?? `${current.provider}:${current.id}`;
|
|
111
164
|
model = { registryKey, provider: current.provider, id: current.id };
|
|
112
165
|
// Determine configured status for the current model's provider
|
|
113
166
|
const envVars = (BUILTIN_PROVIDER_ENV_KEYS[current.provider] ?? []);
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
167
|
+
const status = await resolveProviderConfiguredStatus(current.provider, envVars, providerRegistry, secretKeys);
|
|
168
|
+
configured = status.configured;
|
|
169
|
+
configuredVia = status.configuredVia;
|
|
170
|
+
routes = status.routes;
|
|
119
171
|
}
|
|
120
172
|
catch {
|
|
121
173
|
// No model configured
|
|
122
174
|
}
|
|
123
|
-
return { model, configured, configuredVia };
|
|
175
|
+
return { model, configured, configuredVia, ...(routes ? { routes } : {}) };
|
|
124
176
|
}
|
|
125
177
|
// ---------------------------------------------------------------------------
|
|
126
178
|
// Route dispatch
|
|
@@ -147,7 +199,6 @@ async function handleListProviders(context) {
|
|
|
147
199
|
// Pre-resolve which secret keys are stored (one async batch, then sync logic below)
|
|
148
200
|
const secretKeys = await resolveSecretKeys(secretsManager);
|
|
149
201
|
const allModels = providerRegistry.listModels();
|
|
150
|
-
const configuredIds = new Set(providerRegistry.getConfiguredProviderIds());
|
|
151
202
|
// Group models by provider
|
|
152
203
|
const byProvider = new Map();
|
|
153
204
|
for (const model of allModels) {
|
|
@@ -165,11 +216,17 @@ async function handleListProviders(context) {
|
|
|
165
216
|
const providers = [];
|
|
166
217
|
for (const [providerId, models] of byProvider) {
|
|
167
218
|
const envVars = (BUILTIN_PROVIDER_ENV_KEYS[providerId] ?? []);
|
|
168
|
-
const
|
|
169
|
-
const configured = via !== undefined;
|
|
170
|
-
const configuredVia = configured ? via : undefined;
|
|
219
|
+
const status = await resolveProviderConfiguredStatus(providerId, envVars, providerRegistry, secretKeys);
|
|
171
220
|
const label = getProviderLabel(providerId);
|
|
172
|
-
providers.push({
|
|
221
|
+
providers.push({
|
|
222
|
+
id: providerId,
|
|
223
|
+
label,
|
|
224
|
+
configured: status.configured,
|
|
225
|
+
configuredVia: status.configuredVia,
|
|
226
|
+
envVars,
|
|
227
|
+
...(status.routes ? { routes: status.routes } : {}),
|
|
228
|
+
models,
|
|
229
|
+
});
|
|
173
230
|
}
|
|
174
231
|
// Sort: configured first, then alphabetical
|
|
175
232
|
providers.sort((a, b) => {
|
|
@@ -177,7 +234,7 @@ async function handleListProviders(context) {
|
|
|
177
234
|
return a.configured ? -1 : 1;
|
|
178
235
|
return a.id.localeCompare(b.id);
|
|
179
236
|
});
|
|
180
|
-
const currentModel = buildCurrentModelResponse(providerRegistry, secretKeys).model;
|
|
237
|
+
const currentModel = (await buildCurrentModelResponse(providerRegistry, secretKeys)).model;
|
|
181
238
|
// F-PROV-009 (SDK 0.21.36): always emit `secretsResolutionSkipped` as a boolean so
|
|
182
239
|
// consumers can reliably distinguish "secrets layer not consulted" from "no such field"
|
|
183
240
|
// (prior optional-spread emission was undetectable from the consumer side).
|
|
@@ -193,7 +250,7 @@ async function handleListProviders(context) {
|
|
|
193
250
|
// ---------------------------------------------------------------------------
|
|
194
251
|
async function handleGetCurrentModel(context) {
|
|
195
252
|
const secretKeys = await resolveSecretKeys(context.secretsManager);
|
|
196
|
-
return Response.json(buildCurrentModelResponse(context.providerRegistry, secretKeys));
|
|
253
|
+
return Response.json(await buildCurrentModelResponse(context.providerRegistry, secretKeys));
|
|
197
254
|
}
|
|
198
255
|
// ---------------------------------------------------------------------------
|
|
199
256
|
// PATCH /api/providers/current
|
|
@@ -214,10 +271,13 @@ async function handlePatchCurrentModel(req, context) {
|
|
|
214
271
|
if (!modelDef) {
|
|
215
272
|
return Response.json({ error: `Model '${registryKey}' not in registry`, code: 'MODEL_NOT_FOUND' }, { status: 400 });
|
|
216
273
|
}
|
|
217
|
-
// Check provider is configured
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
274
|
+
// Check provider is configured. Runtime auth routes cover subscription-backed
|
|
275
|
+
// providers like OpenAI, where the public model remains `openai:*` but the
|
|
276
|
+
// actual turn path aliases to the subscription-backed provider at runtime.
|
|
277
|
+
const envVars = (BUILTIN_PROVIDER_ENV_KEYS[modelDef.provider] ?? []);
|
|
278
|
+
const secretKeys = await resolveSecretKeys(context.secretsManager);
|
|
279
|
+
const configuredStatus = await resolveProviderConfiguredStatus(modelDef.provider, envVars, providerRegistry, secretKeys);
|
|
280
|
+
if (!configuredStatus.configured) {
|
|
221
281
|
const errorMessage = envVars.length > 0
|
|
222
282
|
? `Provider '${modelDef.provider}' not configured: set one of [${envVars.join(', ')}]`
|
|
223
283
|
: `Provider '${modelDef.provider}' is not configured. Check the provider's configuration (env var, subscription, or network discovery).`;
|
|
@@ -248,6 +308,5 @@ async function handlePatchCurrentModel(req, context) {
|
|
|
248
308
|
}
|
|
249
309
|
// setCurrentModel emits MODEL_CHANGED synchronously on the same runtimeBus —
|
|
250
310
|
// no second emission needed here.
|
|
251
|
-
|
|
252
|
-
return Response.json({ ...buildCurrentModelResponse(providerRegistry, secretKeys), persisted });
|
|
311
|
+
return Response.json({ ...(await buildCurrentModelResponse(providerRegistry, secretKeys)), persisted });
|
|
253
312
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
let version = '0.25.
|
|
3
|
+
let version = '0.25.7';
|
|
4
4
|
try {
|
|
5
5
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
|
|
6
6
|
version = pkg.version ?? version;
|