@opencode-ai/client 0.0.0-dev-18909 → 0.0.0-dev-18952
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/effect/client.d.ts +0 -14
- package/dist/effect/generated/client.d.ts +0 -14
- package/dist/promise/generated/types.d.ts +2 -14
- package/dist/solid/data.d.ts +32 -32
- package/dist/solid/data.js +47 -197
- package/package.json +4 -4
package/dist/effect/client.d.ts
CHANGED
|
@@ -2100,20 +2100,6 @@ export declare const make: (options?: {
|
|
|
2100
2100
|
readonly metadata?: {
|
|
2101
2101
|
readonly [x: string]: unknown;
|
|
2102
2102
|
} | undefined;
|
|
2103
|
-
} | {
|
|
2104
|
-
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
2105
|
-
readonly data: {
|
|
2106
|
-
readonly id: string & import("effect/Brand").Brand<"Plugin.ID">;
|
|
2107
|
-
};
|
|
2108
|
-
readonly type: "plugin.added";
|
|
2109
|
-
readonly created: number;
|
|
2110
|
-
readonly location?: {
|
|
2111
|
-
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
2112
|
-
readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
|
|
2113
|
-
} | undefined;
|
|
2114
|
-
readonly metadata?: {
|
|
2115
|
-
readonly [x: string]: unknown;
|
|
2116
|
-
} | undefined;
|
|
2117
2103
|
} | {
|
|
2118
2104
|
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
2119
2105
|
readonly data: {};
|
|
@@ -2268,20 +2268,6 @@ export declare const make: (options?: {
|
|
|
2268
2268
|
readonly metadata?: {
|
|
2269
2269
|
readonly [x: string]: unknown;
|
|
2270
2270
|
} | undefined;
|
|
2271
|
-
} | {
|
|
2272
|
-
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
2273
|
-
readonly data: {
|
|
2274
|
-
readonly id: string & import("effect/Brand").Brand<"Plugin.ID">;
|
|
2275
|
-
};
|
|
2276
|
-
readonly type: "plugin.added";
|
|
2277
|
-
readonly created: number;
|
|
2278
|
-
readonly location?: {
|
|
2279
|
-
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
2280
|
-
readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
|
|
2281
|
-
} | undefined;
|
|
2282
|
-
readonly metadata?: {
|
|
2283
|
-
readonly [x: string]: unknown;
|
|
2284
|
-
} | undefined;
|
|
2285
2271
|
} | {
|
|
2286
2272
|
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
2287
2273
|
readonly data: {};
|
|
@@ -1582,18 +1582,6 @@ export type ReferenceUpdated = {
|
|
|
1582
1582
|
location?: LocationRef;
|
|
1583
1583
|
data: {};
|
|
1584
1584
|
};
|
|
1585
|
-
export type PluginAdded = {
|
|
1586
|
-
id: string;
|
|
1587
|
-
created: number;
|
|
1588
|
-
metadata?: {
|
|
1589
|
-
[x: string]: any;
|
|
1590
|
-
};
|
|
1591
|
-
type: "plugin.added";
|
|
1592
|
-
location?: LocationRef;
|
|
1593
|
-
data: {
|
|
1594
|
-
id: string;
|
|
1595
|
-
};
|
|
1596
|
-
};
|
|
1597
1585
|
export type PluginUpdated = {
|
|
1598
1586
|
id: string;
|
|
1599
1587
|
created: number;
|
|
@@ -2681,7 +2669,7 @@ export type ConfigEntry = {
|
|
|
2681
2669
|
variant?: string;
|
|
2682
2670
|
};
|
|
2683
2671
|
default_agent?: string;
|
|
2684
|
-
|
|
2672
|
+
update?: "disable" | "notify" | "auto";
|
|
2685
2673
|
share?: "manual" | "auto" | "disabled";
|
|
2686
2674
|
enterprise?: {
|
|
2687
2675
|
url?: string;
|
|
@@ -3132,7 +3120,7 @@ export type IntegrationInfo = {
|
|
|
3132
3120
|
methods: Array<IntegrationMethod>;
|
|
3133
3121
|
connections: Array<ConnectionInfo>;
|
|
3134
3122
|
};
|
|
3135
|
-
export type V2Event = ModelsDevRefreshed | CredentialUpdated | CredentialSwitched | IntegrationUpdated | CatalogUpdated | AgentUpdated | SessionCreated | SessionAgentSelected | SessionModelSelected | SessionMoved | SessionRenamed | SessionViewed | SessionUsageUpdated | SessionDeleted | SessionForked | SessionInboxDelivered | SessionInboxEnqueued | SessionInboxCancelled | SessionInboxDeliveryChanged | SessionExecutionStarted | SessionExecutionSucceeded | SessionExecutionFailed | SessionExecutionInterrupted | SessionInstructionsUpdated | SessionSynthetic | SessionSkillActivated | SessionShellStarted | SessionShellEnded | SessionStepStarted | SessionStepStreamed | SessionStepEnded | SessionStepFailed | SessionTextStarted | SessionTextDelta | SessionTextEnded | SessionReasoningStarted | SessionReasoningDelta | SessionReasoningEnded | SessionToolInputStarted | SessionToolInputDelta | SessionToolInputEnded | SessionToolCalled | SessionToolProgress | SessionToolSuccess | SessionToolFailed | SessionRetryScheduled | SessionCompactionStarted | SessionCompactionDelta | SessionCompactionEnded | SessionCompactionFailed | SessionRevertStaged | SessionRevertCleared | SessionRevertCommitted | SessionMessageContentUpdated | FilesystemChanged | ReferenceUpdated | PermissionAsked | PermissionReplied |
|
|
3123
|
+
export type V2Event = ModelsDevRefreshed | CredentialUpdated | CredentialSwitched | IntegrationUpdated | CatalogUpdated | AgentUpdated | SessionCreated | SessionAgentSelected | SessionModelSelected | SessionMoved | SessionRenamed | SessionViewed | SessionUsageUpdated | SessionDeleted | SessionForked | SessionInboxDelivered | SessionInboxEnqueued | SessionInboxCancelled | SessionInboxDeliveryChanged | SessionExecutionStarted | SessionExecutionSucceeded | SessionExecutionFailed | SessionExecutionInterrupted | SessionInstructionsUpdated | SessionSynthetic | SessionSkillActivated | SessionShellStarted | SessionShellEnded | SessionStepStarted | SessionStepStreamed | SessionStepEnded | SessionStepFailed | SessionTextStarted | SessionTextDelta | SessionTextEnded | SessionReasoningStarted | SessionReasoningDelta | SessionReasoningEnded | SessionToolInputStarted | SessionToolInputDelta | SessionToolInputEnded | SessionToolCalled | SessionToolProgress | SessionToolSuccess | SessionToolFailed | SessionRetryScheduled | SessionCompactionStarted | SessionCompactionDelta | SessionCompactionEnded | SessionCompactionFailed | SessionRevertStaged | SessionRevertCleared | SessionRevertCommitted | SessionMessageContentUpdated | FilesystemChanged | ReferenceUpdated | PermissionAsked | PermissionReplied | PluginUpdated | ProjectUpdated | WorktreeUpdated | WorktreeResolved | CommandUpdated | ConfigUpdated | SkillUpdated | PtyCreated | PtyUpdated | PtyExited | PtyDeleted | PersistentPtyAdded | PersistentPtyRemoved | ShellCreated | ShellExited | ShellDeleted | FormCreated | FormReplied | FormCancelled | WebsearchUpdated | SessionStatusUpdated | SessionIdle | TuiPromptAppend | TuiCommandExecute | TuiToastShow | TuiSessionSelect | InstallationUpdated | InstallationUpdateAvailable | VcsBranchUpdated | McpStatusChanged | McpResourcesChanged | V2EventRpc | V2EventServerConnected;
|
|
3136
3124
|
export type SessionLogItem = SessionEventDurable | EventLogSynced;
|
|
3137
3125
|
export type InvalidRequestError = {
|
|
3138
3126
|
readonly _tag: "InvalidRequestError";
|
package/dist/solid/data.d.ts
CHANGED
|
@@ -120,8 +120,8 @@ export declare function createData(config: CreateDataInput): {
|
|
|
120
120
|
list(location?: LocationRef): ShellWithLocation[];
|
|
121
121
|
listBySession(sessionID: string): ShellWithLocation[];
|
|
122
122
|
get(id: string): ShellWithLocation | undefined;
|
|
123
|
-
sync(ref?: LocationRef)
|
|
124
|
-
invalidate(ref?: LocationRef)
|
|
123
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
124
|
+
invalidate: (ref?: LocationRef) => void;
|
|
125
125
|
};
|
|
126
126
|
location: {
|
|
127
127
|
info(ref?: LocationRef): LocationGetOutput | undefined;
|
|
@@ -130,60 +130,60 @@ export declare function createData(config: CreateDataInput): {
|
|
|
130
130
|
sync(ref?: LocationRef): Promise<void>;
|
|
131
131
|
invalidate(ref?: LocationRef): void;
|
|
132
132
|
vcs: {
|
|
133
|
-
info(
|
|
134
|
-
sync(ref?: LocationRef)
|
|
135
|
-
invalidate(ref?: LocationRef)
|
|
133
|
+
info: (ref?: LocationRef) => VcsInfo | undefined;
|
|
134
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
135
|
+
invalidate: (ref?: LocationRef) => void;
|
|
136
136
|
};
|
|
137
137
|
agent: {
|
|
138
|
-
list(
|
|
139
|
-
sync(ref?: LocationRef)
|
|
140
|
-
invalidate(ref?: LocationRef)
|
|
138
|
+
list: (ref?: LocationRef) => AgentInfo[] | undefined;
|
|
139
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
140
|
+
invalidate: (ref?: LocationRef) => void;
|
|
141
141
|
};
|
|
142
142
|
command: {
|
|
143
|
-
list(
|
|
144
|
-
sync(ref?: LocationRef)
|
|
145
|
-
invalidate(ref?: LocationRef)
|
|
143
|
+
list: (ref?: LocationRef) => CommandInfo[] | undefined;
|
|
144
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
145
|
+
invalidate: (ref?: LocationRef) => void;
|
|
146
146
|
};
|
|
147
147
|
integration: {
|
|
148
|
-
list(
|
|
149
|
-
sync(ref?: LocationRef)
|
|
150
|
-
invalidate(ref?: LocationRef)
|
|
148
|
+
list: (ref?: LocationRef) => IntegrationInfo[] | undefined;
|
|
149
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
150
|
+
invalidate: (ref?: LocationRef) => void;
|
|
151
151
|
};
|
|
152
152
|
mcp: {
|
|
153
153
|
server: {
|
|
154
|
-
list(
|
|
155
|
-
sync(ref?: LocationRef)
|
|
156
|
-
invalidate(ref?: LocationRef)
|
|
154
|
+
list: (ref?: LocationRef) => McpServer[] | undefined;
|
|
155
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
156
|
+
invalidate: (ref?: LocationRef) => void;
|
|
157
157
|
};
|
|
158
158
|
resource: {
|
|
159
|
-
list(
|
|
160
|
-
sync(ref?: LocationRef)
|
|
161
|
-
invalidate(ref?: LocationRef)
|
|
159
|
+
list: (ref?: LocationRef) => McpResource[] | undefined;
|
|
160
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
161
|
+
invalidate: (ref?: LocationRef) => void;
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
164
|
model: {
|
|
165
|
-
list(
|
|
166
|
-
sync(ref?: LocationRef)
|
|
167
|
-
invalidate(ref?: LocationRef)
|
|
165
|
+
list: (ref?: LocationRef) => ModelInfo[] | undefined;
|
|
166
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
167
|
+
invalidate: (ref?: LocationRef) => void;
|
|
168
168
|
};
|
|
169
169
|
provider: {
|
|
170
|
-
list(
|
|
171
|
-
sync(ref?: LocationRef)
|
|
172
|
-
invalidate(ref?: LocationRef)
|
|
170
|
+
list: (ref?: LocationRef) => ProviderInfo[] | undefined;
|
|
171
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
172
|
+
invalidate: (ref?: LocationRef) => void;
|
|
173
173
|
};
|
|
174
174
|
reference: {
|
|
175
|
-
list(
|
|
176
|
-
sync(ref?: LocationRef)
|
|
177
|
-
invalidate(ref?: LocationRef)
|
|
175
|
+
list: (ref?: LocationRef) => ReferenceInfo[] | undefined;
|
|
176
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
177
|
+
invalidate: (ref?: LocationRef) => void;
|
|
178
178
|
};
|
|
179
179
|
websearch: {
|
|
180
180
|
list(location?: LocationRef): WebSearchProvider[] | undefined;
|
|
181
181
|
refresh(ref?: LocationRef): Promise<void>;
|
|
182
182
|
};
|
|
183
183
|
skill: {
|
|
184
|
-
list(
|
|
185
|
-
sync(ref?: LocationRef)
|
|
186
|
-
invalidate(ref?: LocationRef)
|
|
184
|
+
list: (ref?: LocationRef) => SkillInfo[] | undefined;
|
|
185
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
186
|
+
invalidate: (ref?: LocationRef) => void;
|
|
187
187
|
};
|
|
188
188
|
};
|
|
189
189
|
};
|
package/dist/solid/data.js
CHANGED
|
@@ -14,7 +14,7 @@ export function locationKey(location) {
|
|
|
14
14
|
return JSON.stringify([location.directory, location.workspaceID]);
|
|
15
15
|
}
|
|
16
16
|
function locationQuery(ref) {
|
|
17
|
-
return
|
|
17
|
+
return { directory: ref.directory, workspace: ref.workspaceID };
|
|
18
18
|
}
|
|
19
19
|
function formRequestOptions(sessionID, ref) {
|
|
20
20
|
if (sessionID !== "global" || !ref)
|
|
@@ -1140,6 +1140,36 @@ export function createData(config) {
|
|
|
1140
1140
|
break;
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
|
+
// A cached per-location catalog. `sync` loads once per invalidation, keyed by the
|
|
1144
|
+
// effective location, and publishes under the server's canonical location; `alias`
|
|
1145
|
+
// also publishes under the requested key when the two differ.
|
|
1146
|
+
function locationResource(field, load, options) {
|
|
1147
|
+
const publish = (key, value) => setStore("location", key, { [field]: value });
|
|
1148
|
+
return {
|
|
1149
|
+
list: (ref) => store.location[locationKey(ref ?? defaultLocation())]?.[field],
|
|
1150
|
+
sync: (ref) => {
|
|
1151
|
+
const location = ref ?? defaultLocation();
|
|
1152
|
+
const id = locationKey(location);
|
|
1153
|
+
return sync.run(`location.${field}:${id}`, async () => {
|
|
1154
|
+
const response = await load(locationQuery(location));
|
|
1155
|
+
const key = locationKey(response.location);
|
|
1156
|
+
publish(key, response.data);
|
|
1157
|
+
if (options?.alias && key !== id)
|
|
1158
|
+
publish(id, response.data);
|
|
1159
|
+
});
|
|
1160
|
+
},
|
|
1161
|
+
invalidate: (ref) => sync.invalidate(`location.${field}:${locationKey(ref ?? defaultLocation())}`),
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
const vcs = locationResource("vcs", (location) => api().vcs.get({ location }));
|
|
1165
|
+
const shells = locationResource("shell", async (location) => {
|
|
1166
|
+
const response = await api().shell.list({ location });
|
|
1167
|
+
const ref = { directory: response.location.directory, workspaceID: response.location.workspaceID };
|
|
1168
|
+
return {
|
|
1169
|
+
location: response.location,
|
|
1170
|
+
data: Object.fromEntries(response.data.map((info) => [info.id, { ...info, location: ref }])),
|
|
1171
|
+
};
|
|
1172
|
+
});
|
|
1143
1173
|
const result = {
|
|
1144
1174
|
on: config.event.on,
|
|
1145
1175
|
listen: config.event.listen,
|
|
@@ -1586,7 +1616,7 @@ export function createData(config) {
|
|
|
1586
1616
|
},
|
|
1587
1617
|
shell: {
|
|
1588
1618
|
list(location) {
|
|
1589
|
-
return Object.values(
|
|
1619
|
+
return Object.values(shells.list(location) ?? {});
|
|
1590
1620
|
},
|
|
1591
1621
|
listBySession(sessionID) {
|
|
1592
1622
|
return Object.values(store.location)
|
|
@@ -1598,29 +1628,8 @@ export function createData(config) {
|
|
|
1598
1628
|
.map((data) => data.shell?.[id])
|
|
1599
1629
|
.find((shell) => shell !== undefined);
|
|
1600
1630
|
},
|
|
1601
|
-
sync
|
|
1602
|
-
|
|
1603
|
-
return sync.run(`location.shell:${id}`, async () => {
|
|
1604
|
-
const response = await api().shell.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1605
|
-
const key = locationKey(response.location);
|
|
1606
|
-
setStore("location", key, {
|
|
1607
|
-
...store.location[key],
|
|
1608
|
-
shell: Object.fromEntries(response.data.map((info) => [
|
|
1609
|
-
info.id,
|
|
1610
|
-
{
|
|
1611
|
-
...info,
|
|
1612
|
-
location: {
|
|
1613
|
-
directory: response.location.directory,
|
|
1614
|
-
workspaceID: response.location.workspaceID,
|
|
1615
|
-
},
|
|
1616
|
-
},
|
|
1617
|
-
])),
|
|
1618
|
-
});
|
|
1619
|
-
});
|
|
1620
|
-
},
|
|
1621
|
-
invalidate(ref) {
|
|
1622
|
-
sync.invalidate(`location.shell:${locationKey(ref ?? defaultLocation())}`);
|
|
1623
|
-
},
|
|
1631
|
+
sync: shells.sync,
|
|
1632
|
+
invalidate: shells.invalidate,
|
|
1624
1633
|
},
|
|
1625
1634
|
location: {
|
|
1626
1635
|
info(ref) {
|
|
@@ -1676,164 +1685,20 @@ export function createData(config) {
|
|
|
1676
1685
|
result.shell.invalidate(location);
|
|
1677
1686
|
result.session.form.invalidate("global", location);
|
|
1678
1687
|
},
|
|
1679
|
-
vcs: {
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
sync(ref) {
|
|
1684
|
-
const location = ref ?? defaultLocation();
|
|
1685
|
-
return sync.run(`location.vcs:${locationKey(location)}`, async () => {
|
|
1686
|
-
const response = await api().vcs.get({ location: locationQuery(location) });
|
|
1687
|
-
const key = locationKey(response.location);
|
|
1688
|
-
setStore("location", key, { ...store.location[key], vcs: response.data });
|
|
1689
|
-
});
|
|
1690
|
-
},
|
|
1691
|
-
invalidate(ref) {
|
|
1692
|
-
sync.invalidate(`location.vcs:${locationKey(ref ?? defaultLocation())}`);
|
|
1693
|
-
},
|
|
1694
|
-
},
|
|
1695
|
-
agent: {
|
|
1696
|
-
list(location) {
|
|
1697
|
-
return store.location[locationKey(location ?? defaultLocation())]?.agent;
|
|
1698
|
-
},
|
|
1699
|
-
sync(ref) {
|
|
1700
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1701
|
-
return sync.run(`location.agent:${id}`, async () => {
|
|
1702
|
-
const response = await api().agent.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1703
|
-
const key = locationKey(response.location);
|
|
1704
|
-
setStore("location", key, { ...store.location[key], agent: response.data });
|
|
1705
|
-
});
|
|
1706
|
-
},
|
|
1707
|
-
invalidate(ref) {
|
|
1708
|
-
sync.invalidate(`location.agent:${locationKey(ref ?? defaultLocation())}`);
|
|
1709
|
-
},
|
|
1710
|
-
},
|
|
1711
|
-
command: {
|
|
1712
|
-
list(location) {
|
|
1713
|
-
return store.location[locationKey(location ?? defaultLocation())]?.command;
|
|
1714
|
-
},
|
|
1715
|
-
sync(ref) {
|
|
1716
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1717
|
-
return sync.run(`location.command:${id}`, async () => {
|
|
1718
|
-
const response = await api().command.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1719
|
-
const key = locationKey(response.location);
|
|
1720
|
-
setStore("location", key, { ...store.location[key], command: response.data });
|
|
1721
|
-
});
|
|
1722
|
-
},
|
|
1723
|
-
invalidate(ref) {
|
|
1724
|
-
sync.invalidate(`location.command:${locationKey(ref ?? defaultLocation())}`);
|
|
1725
|
-
},
|
|
1726
|
-
},
|
|
1727
|
-
integration: {
|
|
1728
|
-
list(location) {
|
|
1729
|
-
return store.location[locationKey(location ?? defaultLocation())]?.integration;
|
|
1730
|
-
},
|
|
1731
|
-
sync(ref) {
|
|
1732
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1733
|
-
return sync.run(`location.integration:${id}`, async () => {
|
|
1734
|
-
const response = await api().integration.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1735
|
-
const key = locationKey(response.location);
|
|
1736
|
-
setStore("location", key, { ...store.location[key], integration: response.data });
|
|
1737
|
-
});
|
|
1738
|
-
},
|
|
1739
|
-
invalidate(ref) {
|
|
1740
|
-
sync.invalidate(`location.integration:${locationKey(ref ?? defaultLocation())}`);
|
|
1741
|
-
},
|
|
1742
|
-
},
|
|
1688
|
+
vcs: { info: vcs.list, sync: vcs.sync, invalidate: vcs.invalidate },
|
|
1689
|
+
agent: locationResource("agent", (location) => api().agent.list({ location })),
|
|
1690
|
+
command: locationResource("command", (location) => api().command.list({ location })),
|
|
1691
|
+
integration: locationResource("integration", (location) => api().integration.list({ location })),
|
|
1743
1692
|
mcp: {
|
|
1744
|
-
server: {
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
}
|
|
1748
|
-
|
|
1749
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1750
|
-
return sync.run(`location.mcp.server:${id}`, async () => {
|
|
1751
|
-
const response = await api().mcp.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1752
|
-
const key = locationKey(response.location);
|
|
1753
|
-
setStore("location", key, {
|
|
1754
|
-
...store.location[key],
|
|
1755
|
-
mcp: { ...store.location[key]?.mcp, server: response.data },
|
|
1756
|
-
});
|
|
1757
|
-
});
|
|
1758
|
-
},
|
|
1759
|
-
invalidate(ref) {
|
|
1760
|
-
sync.invalidate(`location.mcp.server:${locationKey(ref ?? defaultLocation())}`);
|
|
1761
|
-
},
|
|
1762
|
-
},
|
|
1763
|
-
resource: {
|
|
1764
|
-
list(location) {
|
|
1765
|
-
return store.location[locationKey(location ?? defaultLocation())]?.mcp?.resource;
|
|
1766
|
-
},
|
|
1767
|
-
sync(ref) {
|
|
1768
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1769
|
-
return sync.run(`location.mcp.resource:${id}`, async () => {
|
|
1770
|
-
const response = await api().mcp.resource.catalog({
|
|
1771
|
-
location: locationQuery(ref ?? defaultLocation()),
|
|
1772
|
-
});
|
|
1773
|
-
const key = locationKey(response.location);
|
|
1774
|
-
setStore("location", key, {
|
|
1775
|
-
...store.location[key],
|
|
1776
|
-
mcp: { ...store.location[key]?.mcp, resource: response.data.resources },
|
|
1777
|
-
});
|
|
1778
|
-
});
|
|
1779
|
-
},
|
|
1780
|
-
invalidate(ref) {
|
|
1781
|
-
sync.invalidate(`location.mcp.resource:${locationKey(ref ?? defaultLocation())}`);
|
|
1782
|
-
},
|
|
1783
|
-
},
|
|
1784
|
-
},
|
|
1785
|
-
model: {
|
|
1786
|
-
list(location) {
|
|
1787
|
-
return store.location[locationKey(location ?? defaultLocation())]?.model;
|
|
1788
|
-
},
|
|
1789
|
-
sync(ref) {
|
|
1790
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1791
|
-
return sync.run(`location.model:${id}`, async () => {
|
|
1792
|
-
const response = await api().model.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1793
|
-
const key = locationKey(response.location);
|
|
1794
|
-
setStore("location", key, { ...store.location[key], model: response.data });
|
|
1795
|
-
if (key !== id)
|
|
1796
|
-
setStore("location", id, { ...store.location[id], model: response.data });
|
|
1797
|
-
});
|
|
1798
|
-
},
|
|
1799
|
-
invalidate(ref) {
|
|
1800
|
-
sync.invalidate(`location.model:${locationKey(ref ?? defaultLocation())}`);
|
|
1801
|
-
},
|
|
1802
|
-
},
|
|
1803
|
-
provider: {
|
|
1804
|
-
list(location) {
|
|
1805
|
-
return store.location[locationKey(location ?? defaultLocation())]?.provider;
|
|
1806
|
-
},
|
|
1807
|
-
sync(ref) {
|
|
1808
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1809
|
-
return sync.run(`location.provider:${id}`, async () => {
|
|
1810
|
-
const response = await api().provider.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1811
|
-
const key = locationKey(response.location);
|
|
1812
|
-
setStore("location", key, { ...store.location[key], provider: response.data });
|
|
1813
|
-
if (key !== id)
|
|
1814
|
-
setStore("location", id, { ...store.location[id], provider: response.data });
|
|
1815
|
-
});
|
|
1816
|
-
},
|
|
1817
|
-
invalidate(ref) {
|
|
1818
|
-
sync.invalidate(`location.provider:${locationKey(ref ?? defaultLocation())}`);
|
|
1819
|
-
},
|
|
1820
|
-
},
|
|
1821
|
-
reference: {
|
|
1822
|
-
list(location) {
|
|
1823
|
-
return store.location[locationKey(location ?? defaultLocation())]?.reference;
|
|
1824
|
-
},
|
|
1825
|
-
sync(ref) {
|
|
1826
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1827
|
-
return sync.run(`location.reference:${id}`, async () => {
|
|
1828
|
-
const response = await api().reference.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1829
|
-
const key = locationKey(response.location);
|
|
1830
|
-
setStore("location", key, { ...store.location[key], reference: response.data });
|
|
1831
|
-
});
|
|
1832
|
-
},
|
|
1833
|
-
invalidate(ref) {
|
|
1834
|
-
sync.invalidate(`location.reference:${locationKey(ref ?? defaultLocation())}`);
|
|
1835
|
-
},
|
|
1693
|
+
server: locationResource("mcpServer", (location) => api().mcp.list({ location })),
|
|
1694
|
+
resource: locationResource("mcpResource", async (location) => {
|
|
1695
|
+
const response = await api().mcp.resource.catalog({ location });
|
|
1696
|
+
return { location: response.location, data: response.data.resources };
|
|
1697
|
+
}),
|
|
1836
1698
|
},
|
|
1699
|
+
model: locationResource("model", (location) => api().model.list({ location }), { alias: true }),
|
|
1700
|
+
provider: locationResource("provider", (location) => api().provider.list({ location }), { alias: true }),
|
|
1701
|
+
reference: locationResource("reference", (location) => api().reference.list({ location })),
|
|
1837
1702
|
websearch: {
|
|
1838
1703
|
list(location) {
|
|
1839
1704
|
return store.location[locationKey(location ?? defaultLocation())]?.websearch;
|
|
@@ -1848,22 +1713,7 @@ export function createData(config) {
|
|
|
1848
1713
|
});
|
|
1849
1714
|
},
|
|
1850
1715
|
},
|
|
1851
|
-
skill: {
|
|
1852
|
-
list(location) {
|
|
1853
|
-
return store.location[locationKey(location ?? defaultLocation())]?.skill;
|
|
1854
|
-
},
|
|
1855
|
-
sync(ref) {
|
|
1856
|
-
const id = locationKey(ref ?? defaultLocation());
|
|
1857
|
-
return sync.run(`location.skill:${id}`, async () => {
|
|
1858
|
-
const response = await api().skill.list({ location: locationQuery(ref ?? defaultLocation()) });
|
|
1859
|
-
const key = locationKey(response.location);
|
|
1860
|
-
setStore("location", key, { ...store.location[key], skill: response.data });
|
|
1861
|
-
});
|
|
1862
|
-
},
|
|
1863
|
-
invalidate(ref) {
|
|
1864
|
-
sync.invalidate(`location.skill:${locationKey(ref ?? defaultLocation())}`);
|
|
1865
|
-
},
|
|
1866
|
-
},
|
|
1716
|
+
skill: locationResource("skill", (location) => api().skill.list({ location })),
|
|
1867
1717
|
},
|
|
1868
1718
|
};
|
|
1869
1719
|
createEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode-ai/client",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-18952",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"typecheck": "tsgo --noEmit"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@opencode-ai/schema": "0.0.0-dev-
|
|
61
|
-
"@opencode-ai/protocol": "0.0.0-dev-
|
|
60
|
+
"@opencode-ai/schema": "0.0.0-dev-18952",
|
|
61
|
+
"@opencode-ai/protocol": "0.0.0-dev-18952"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"effect": "4.0.0-rc.112",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
77
|
-
"@opencode-ai/httpapi-codegen": "0.0.0-dev-
|
|
77
|
+
"@opencode-ai/httpapi-codegen": "0.0.0-dev-18952",
|
|
78
78
|
"@tsconfig/bun": "1.0.9",
|
|
79
79
|
"@types/bun": "1.3.13",
|
|
80
80
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|