@nuvin/session 0.1.0-rc.10
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/LICENSE +202 -0
- package/dist/chunk-2LIGD6UP.js +11 -0
- package/dist/chunk-3IPZO7LP.js +66 -0
- package/dist/chunk-3S4DZMX3.js +681 -0
- package/dist/chunk-HJ666YLF.js +6 -0
- package/dist/chunk-UVJIG4DT.js +17 -0
- package/dist/client/daemon-client.d.ts +50 -0
- package/dist/client/daemon-client.d.ts.map +1 -0
- package/dist/client/data-client.d.ts +79 -0
- package/dist/client/data-client.d.ts.map +1 -0
- package/dist/client/directory.d.ts +99 -0
- package/dist/client/directory.d.ts.map +1 -0
- package/dist/client/endpoint.d.ts +39 -0
- package/dist/client/endpoint.d.ts.map +1 -0
- package/dist/client/http-data-client.d.ts +23 -0
- package/dist/client/http-data-client.d.ts.map +1 -0
- package/dist/client/index.d.ts +11 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +1418 -0
- package/dist/client/session-client.d.ts +76 -0
- package/dist/client/session-client.d.ts.map +1 -0
- package/dist/client/socket.d.ts +38 -0
- package/dist/client/socket.d.ts.map +1 -0
- package/dist/client/transport.d.ts +9 -0
- package/dist/client/transport.d.ts.map +1 -0
- package/dist/client/uds-socket.d.ts +23 -0
- package/dist/client/uds-socket.d.ts.map +1 -0
- package/dist/client/websocket.d.ts +54 -0
- package/dist/client/websocket.d.ts.map +1 -0
- package/dist/controller/agent-channel.d.ts +58 -0
- package/dist/controller/agent-channel.d.ts.map +1 -0
- package/dist/controller/index.d.ts +3 -0
- package/dist/controller/index.d.ts.map +1 -0
- package/dist/controller/index.js +447 -0
- package/dist/controller/session-controller.d.ts +158 -0
- package/dist/controller/session-controller.d.ts.map +1 -0
- package/dist/controller/test-utils.d.ts +15 -0
- package/dist/controller/test-utils.d.ts.map +1 -0
- package/dist/grant/index.d.ts +33 -0
- package/dist/grant/index.d.ts.map +1 -0
- package/dist/grant/index.js +12 -0
- package/dist/protocol/daemon-directory.d.ts +30 -0
- package/dist/protocol/daemon-directory.d.ts.map +1 -0
- package/dist/protocol/data-rpc.d.ts +122 -0
- package/dist/protocol/data-rpc.d.ts.map +1 -0
- package/dist/protocol/index.d.ts +5 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +10 -0
- package/dist/protocol/types.d.ts +971 -0
- package/dist/protocol/types.d.ts.map +1 -0
- package/dist/protocol/version.d.ts +8 -0
- package/dist/protocol/version.d.ts.map +1 -0
- package/dist/state/approvals.d.ts +34 -0
- package/dist/state/approvals.d.ts.map +1 -0
- package/dist/state/dir-access.d.ts +9 -0
- package/dist/state/dir-access.d.ts.map +1 -0
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +48 -0
- package/dist/state/json.d.ts +7 -0
- package/dist/state/json.d.ts.map +1 -0
- package/dist/state/messages.d.ts +105 -0
- package/dist/state/messages.d.ts.map +1 -0
- package/dist/state/session.d.ts +9 -0
- package/dist/state/session.d.ts.map +1 -0
- package/dist/state/tool-preview.d.ts +31 -0
- package/dist/state/tool-preview.d.ts.map +1 -0
- package/dist/state/tool-preview.js +300 -0
- package/dist/state/workflow-view.d.ts +10 -0
- package/dist/state/workflow-view.d.ts.map +1 -0
- package/dist/test-utils/fake-relay.d.ts +24 -0
- package/dist/test-utils/fake-relay.d.ts.map +1 -0
- package/dist/test-utils/index.d.ts +2 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/test-utils/index.js +250 -0
- package/dist/ui/history-grouping.d.ts +36 -0
- package/dist/ui/history-grouping.d.ts.map +1 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +135 -0
- package/dist/ui/picker-rows.d.ts +62 -0
- package/dist/ui/picker-rows.d.ts.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SessionDescriptor } from "./types.ts";
|
|
2
|
+
/** GET /api/daemons — served by BOTH the CLI local web server and the relay (spec §4.1). */
|
|
3
|
+
export type DaemonDirectoryResponse = {
|
|
4
|
+
daemons: DaemonDirectoryRow[];
|
|
5
|
+
/** Pre-provisioned first-paint session — local mode only; relay omits. */
|
|
6
|
+
defaultSessionId?: string;
|
|
7
|
+
};
|
|
8
|
+
export type DaemonDirectoryRow = {
|
|
9
|
+
id: string;
|
|
10
|
+
/** Display label (local: entry name; cloud: registered name). */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Local: always true (unreachable entries are dropped). Cloud: live presence. */
|
|
13
|
+
online: boolean;
|
|
14
|
+
lastSeenAt: string | null;
|
|
15
|
+
sessions?: SessionDescriptor[];
|
|
16
|
+
/**
|
|
17
|
+
* Static credentials (local mode): the browser dials wsUrl directly with the
|
|
18
|
+
* bearer token. Absent (cloud): acquire via POST /api/daemons/:id/connect.
|
|
19
|
+
*/
|
|
20
|
+
endpoint?: {
|
|
21
|
+
wsUrl: string;
|
|
22
|
+
token: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** POST /api/daemons/:id/connect — relay only (for now, spec §10). */
|
|
26
|
+
export type DaemonConnectResponse = {
|
|
27
|
+
wsUrl: string;
|
|
28
|
+
grant: string;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=daemon-directory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon-directory.d.ts","sourceRoot":"","sources":["../../src/protocol/daemon-directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,4FAA4F;AAC5F,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,qBAAqB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { ConfigMutationResult, HistoryPage, ProfileSummary, ProviderConfigSummary, ProviderCredentialInput, ProviderSurfaceId, SessionSnapshot, WorkspaceConfigSummary } from "./types.ts";
|
|
2
|
+
export type DataRpcErrorCode = "invalid-input" | "not-found" | "conflict" | "unsupported" | "unauthorized" | "daemon-offline" | "internal";
|
|
3
|
+
export type DataRpcError = {
|
|
4
|
+
code: DataRpcErrorCode;
|
|
5
|
+
message: string;
|
|
6
|
+
};
|
|
7
|
+
export type ProfileScope = {
|
|
8
|
+
profile?: string;
|
|
9
|
+
};
|
|
10
|
+
export type AddProviderInput = ProfileScope & {
|
|
11
|
+
name: string;
|
|
12
|
+
surface: ProviderSurfaceId;
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
defaultModel?: string;
|
|
15
|
+
credential: ProviderCredentialInput;
|
|
16
|
+
};
|
|
17
|
+
export type UpdateWorkspaceInput = ProfileScope & {
|
|
18
|
+
activeProvider?: string;
|
|
19
|
+
toggles?: Record<string, boolean>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The read/management data plane: ONE schema, two transports into the daemon
|
|
23
|
+
* (local REST via rest-http.ts, relay control RPC via daemons.controller.ts →
|
|
24
|
+
* registry.request). Client-side, DaemonDataClient is the method-for-method
|
|
25
|
+
* projection of this schema. Params and results are JSON-safe by rule — the
|
|
26
|
+
* json-safety test guards every member. Adding a method here + a handler in
|
|
27
|
+
* RelayRpcDeps is the complete recipe for a new read operation.
|
|
28
|
+
*/
|
|
29
|
+
export type DataRpcSchema = {
|
|
30
|
+
"get-transcript": {
|
|
31
|
+
params: {
|
|
32
|
+
historyId: string;
|
|
33
|
+
workspace?: string;
|
|
34
|
+
profile?: string;
|
|
35
|
+
};
|
|
36
|
+
result: SessionSnapshot;
|
|
37
|
+
};
|
|
38
|
+
"list-history": {
|
|
39
|
+
params: {
|
|
40
|
+
profile?: string;
|
|
41
|
+
cwd?: string;
|
|
42
|
+
limit?: number;
|
|
43
|
+
cursor?: string;
|
|
44
|
+
};
|
|
45
|
+
result: HistoryPage;
|
|
46
|
+
};
|
|
47
|
+
"delete-session": {
|
|
48
|
+
params: {
|
|
49
|
+
historyId: string;
|
|
50
|
+
workspace?: string;
|
|
51
|
+
profile?: string;
|
|
52
|
+
};
|
|
53
|
+
result: {
|
|
54
|
+
ok: true;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
"list-workspaces": {
|
|
58
|
+
params: {
|
|
59
|
+
profile?: string;
|
|
60
|
+
};
|
|
61
|
+
result: WorkspaceConfigSummary[];
|
|
62
|
+
};
|
|
63
|
+
"create-workspace": {
|
|
64
|
+
params: {
|
|
65
|
+
name: string;
|
|
66
|
+
root?: string;
|
|
67
|
+
profile?: string;
|
|
68
|
+
};
|
|
69
|
+
result: WorkspaceConfigSummary;
|
|
70
|
+
};
|
|
71
|
+
"list-profiles": {
|
|
72
|
+
params: Record<string, never>;
|
|
73
|
+
result: ProfileSummary[];
|
|
74
|
+
};
|
|
75
|
+
"list-providers": {
|
|
76
|
+
params: ProfileScope;
|
|
77
|
+
result: ProviderConfigSummary[];
|
|
78
|
+
};
|
|
79
|
+
"add-provider": {
|
|
80
|
+
params: AddProviderInput;
|
|
81
|
+
result: ConfigMutationResult<ProviderConfigSummary>;
|
|
82
|
+
};
|
|
83
|
+
"remove-provider": {
|
|
84
|
+
params: {
|
|
85
|
+
providerId: string;
|
|
86
|
+
profile?: string;
|
|
87
|
+
};
|
|
88
|
+
result: ConfigMutationResult<null>;
|
|
89
|
+
};
|
|
90
|
+
"set-default-provider": {
|
|
91
|
+
params: {
|
|
92
|
+
providerId: string;
|
|
93
|
+
profile?: string;
|
|
94
|
+
};
|
|
95
|
+
result: ConfigMutationResult<null>;
|
|
96
|
+
};
|
|
97
|
+
"set-provider-auth": {
|
|
98
|
+
params: {
|
|
99
|
+
providerId: string;
|
|
100
|
+
credential: ProviderCredentialInput;
|
|
101
|
+
profile?: string;
|
|
102
|
+
};
|
|
103
|
+
result: ConfigMutationResult<null>;
|
|
104
|
+
};
|
|
105
|
+
"clear-provider-auth": {
|
|
106
|
+
params: {
|
|
107
|
+
providerId: string;
|
|
108
|
+
profile?: string;
|
|
109
|
+
};
|
|
110
|
+
result: ConfigMutationResult<null>;
|
|
111
|
+
};
|
|
112
|
+
"update-workspace": {
|
|
113
|
+
params: UpdateWorkspaceInput & {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
116
|
+
result: ConfigMutationResult<WorkspaceConfigSummary>;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export type DataRpcMethod = keyof DataRpcSchema;
|
|
120
|
+
export type DataRpcParams<M extends DataRpcMethod> = DataRpcSchema[M]["params"];
|
|
121
|
+
export type DataRpcResult<M extends DataRpcMethod> = DataRpcSchema[M]["result"];
|
|
122
|
+
//# sourceMappingURL=data-rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-rpc.d.ts","sourceRoot":"","sources":["../../src/protocol/data-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACvB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