@kortix/sdk 0.11.0 → 0.12.1
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/README.md +110 -73
- package/dist/browser/cache/idb-sync-cache-key.d.ts +2 -0
- package/dist/browser/cache/idb-sync-cache-key.d.ts.map +1 -0
- package/dist/browser/cache/idb-sync-cache-key.js +7 -0
- package/dist/browser/cache/idb-sync-cache-key.js.map +1 -0
- package/dist/browser/cache/idb-sync-cache.d.ts +3 -3
- package/dist/browser/cache/idb-sync-cache.d.ts.map +1 -1
- package/dist/browser/cache/idb-sync-cache.js +49 -26
- package/dist/browser/cache/idb-sync-cache.js.map +1 -1
- package/dist/browser/session-sync/session-cache-ownership.d.ts +36 -0
- package/dist/browser/session-sync/session-cache-ownership.d.ts.map +1 -0
- package/dist/browser/session-sync/session-cache-ownership.js +66 -0
- package/dist/browser/session-sync/session-cache-ownership.js.map +1 -0
- package/dist/browser/session-sync/session-sync-registry.d.ts +8 -6
- package/dist/browser/session-sync/session-sync-registry.d.ts.map +1 -1
- package/dist/browser/session-sync/session-sync-registry.js +86 -33
- package/dist/browser/session-sync/session-sync-registry.js.map +1 -1
- package/dist/browser/session-sync/session-transcript-cache.d.ts +55 -0
- package/dist/browser/session-sync/session-transcript-cache.d.ts.map +1 -0
- package/dist/browser/session-sync/session-transcript-cache.js +69 -0
- package/dist/browser/session-sync/session-transcript-cache.js.map +1 -0
- package/dist/core/client/kortix.d.ts +72 -25
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/kortix.js +76 -17
- package/dist/core/client/kortix.js.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts +7 -0
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js +14 -0
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/access.d.ts +1 -2
- package/dist/core/rest/projects-client/access.d.ts.map +1 -1
- package/dist/core/rest/projects-client/access.js +9 -6
- package/dist/core/rest/projects-client/access.js.map +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts +15 -7
- package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-config.js +43 -2
- package/dist/core/rest/projects-client/agent-config.js.map +1 -1
- package/dist/core/rest/projects-client/agent-scope.d.ts +4 -0
- package/dist/core/rest/projects-client/agent-scope.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-scope.js +34 -1
- package/dist/core/rest/projects-client/agent-scope.js.map +1 -1
- package/dist/core/rest/projects-client/audit.d.ts +34 -0
- package/dist/core/rest/projects-client/audit.d.ts.map +1 -1
- package/dist/core/rest/projects-client/audit.js +49 -4
- package/dist/core/rest/projects-client/audit.js.map +1 -1
- package/dist/core/rest/projects-client/billing.d.ts +26 -14
- package/dist/core/rest/projects-client/billing.d.ts.map +1 -1
- package/dist/core/rest/projects-client/billing.js +4 -5
- package/dist/core/rest/projects-client/billing.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +106 -45
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js +95 -58
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/github.d.ts +7 -1
- package/dist/core/rest/projects-client/github.d.ts.map +1 -1
- package/dist/core/rest/projects-client/github.js.map +1 -1
- package/dist/core/rest/projects-client/iam.d.ts +17 -0
- package/dist/core/rest/projects-client/iam.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam.js +14 -0
- package/dist/core/rest/projects-client/iam.js.map +1 -1
- package/dist/core/rest/projects-client/index.d.ts +2 -0
- package/dist/core/rest/projects-client/index.d.ts.map +1 -1
- package/dist/core/rest/projects-client/index.js +2 -0
- package/dist/core/rest/projects-client/index.js.map +1 -1
- package/dist/core/rest/projects-client/model-enablement.d.ts +9 -0
- package/dist/core/rest/projects-client/model-enablement.d.ts.map +1 -0
- package/dist/core/rest/projects-client/model-enablement.js +16 -0
- package/dist/core/rest/projects-client/model-enablement.js.map +1 -0
- package/dist/core/rest/projects-client/policies.d.ts +18 -0
- package/dist/core/rest/projects-client/policies.d.ts.map +1 -1
- package/dist/core/rest/projects-client/policies.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +87 -1
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +8 -0
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/sandbox.d.ts +50 -0
- package/dist/core/rest/projects-client/sandbox.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sandbox.js.map +1 -1
- package/dist/core/rest/projects-client/session-costs.d.ts +102 -0
- package/dist/core/rest/projects-client/session-costs.d.ts.map +1 -0
- package/dist/core/rest/projects-client/session-costs.js +25 -0
- package/dist/core/rest/projects-client/session-costs.js.map +1 -0
- package/dist/core/rest/projects-client/session-sandbox.d.ts +0 -2
- package/dist/core/rest/projects-client/session-sandbox.d.ts.map +1 -1
- package/dist/core/rest/projects-client/session-sandbox.js +1 -10
- package/dist/core/rest/projects-client/session-sandbox.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +94 -44
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +9 -15
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/setup-links.d.ts +37 -0
- package/dist/core/rest/projects-client/setup-links.d.ts.map +1 -1
- package/dist/core/rest/projects-client/setup-links.js +11 -0
- package/dist/core/rest/projects-client/setup-links.js.map +1 -1
- package/dist/core/session/index.d.ts +1 -1
- package/dist/core/session/index.d.ts.map +1 -1
- package/dist/core/session/index.js +1 -1
- package/dist/core/session/index.js.map +1 -1
- package/dist/core/session/preview-auth.d.ts +32 -0
- package/dist/core/session/preview-auth.d.ts.map +1 -0
- package/dist/core/session/preview-auth.js +53 -0
- package/dist/core/session/preview-auth.js.map +1 -0
- package/dist/core/session/server-store/url-helpers.d.ts.map +1 -1
- package/dist/core/session/server-store/url-helpers.js +5 -3
- package/dist/core/session/server-store/url-helpers.js.map +1 -1
- package/dist/core/session-sync/session-sync-controller.d.ts +12 -1
- package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
- package/dist/core/session-sync/session-sync-controller.js +34 -2
- package/dist/core/session-sync/session-sync-controller.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +19 -24
- package/dist/kortix.global.js +19 -24
- package/dist/platform/auth-core.d.ts +5 -3
- package/dist/platform/auth-core.d.ts.map +1 -1
- package/dist/platform/auth-core.js +6 -4
- package/dist/platform/auth-core.js.map +1 -1
- package/dist/react/index.d.ts +1 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +0 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/model-flatten.d.ts +20 -0
- package/dist/react/model-flatten.d.ts.map +1 -1
- package/dist/react/model-flatten.js +12 -0
- package/dist/react/model-flatten.js.map +1 -1
- package/dist/react/opencode.d.ts +4 -3
- package/dist/react/opencode.d.ts.map +1 -1
- package/dist/react/opencode.js +4 -3
- package/dist/react/opencode.js.map +1 -1
- package/dist/react/provider-selection.d.ts +9 -0
- package/dist/react/provider-selection.d.ts.map +1 -1
- package/dist/react/provider-selection.js +23 -0
- package/dist/react/provider-selection.js.map +1 -1
- package/dist/react/session-title-sync.d.ts +9 -5
- package/dist/react/session-title-sync.d.ts.map +1 -1
- package/dist/react/session-title-sync.js +14 -10
- package/dist/react/session-title-sync.js.map +1 -1
- package/dist/react/use-canonical-opencode-session.d.ts +2 -2
- package/dist/react/use-canonical-opencode-session.d.ts.map +1 -1
- package/dist/react/use-model-enablement.d.ts +25 -0
- package/dist/react/use-model-enablement.d.ts.map +1 -0
- package/dist/react/use-model-enablement.js +92 -0
- package/dist/react/use-model-enablement.js.map +1 -0
- package/dist/react/use-model-store.d.ts +6 -14
- package/dist/react/use-model-store.d.ts.map +1 -1
- package/dist/react/use-model-store.js +30 -52
- package/dist/react/use-model-store.js.map +1 -1
- package/dist/react/use-opencode-events/handle-event.d.ts.map +1 -1
- package/dist/react/use-opencode-events/handle-event.js +103 -41
- package/dist/react/use-opencode-events/handle-event.js.map +1 -1
- package/dist/react/use-opencode-local.d.ts +5 -4
- package/dist/react/use-opencode-local.d.ts.map +1 -1
- package/dist/react/use-opencode-local.js +20 -37
- package/dist/react/use-opencode-local.js.map +1 -1
- package/dist/react/use-opencode-sessions/keys.d.ts +3 -1
- package/dist/react/use-opencode-sessions/keys.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/keys.js +2 -0
- package/dist/react/use-opencode-sessions/keys.js.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/sessions.js +16 -7
- package/dist/react/use-opencode-sessions/sessions.js.map +1 -1
- package/dist/react/use-opencode-sessions/shared.d.ts +3 -2
- package/dist/react/use-opencode-sessions/shared.d.ts.map +1 -1
- package/dist/react/use-opencode-sessions/shared.js +6 -3
- package/dist/react/use-opencode-sessions/shared.js.map +1 -1
- package/dist/react/use-opencode-sessions/sharing.js +2 -2
- package/dist/react/use-opencode-sessions/sharing.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +13 -1
- package/dist/react/use-session-sync.d.ts.map +1 -1
- package/dist/react/use-session-sync.js +85 -17
- package/dist/react/use-session-sync.js.map +1 -1
- package/dist/react/use-session.d.ts +60 -40
- package/dist/react/use-session.d.ts.map +1 -1
- package/dist/react/use-session.js +160 -202
- package/dist/react/use-session.js.map +1 -1
- package/package.json +2 -2
- package/dist/core/acp/client.d.ts +0 -45
- package/dist/core/acp/client.d.ts.map +0 -1
- package/dist/core/acp/client.js +0 -277
- package/dist/core/acp/client.js.map +0 -1
- package/dist/core/acp/index.d.ts +0 -5
- package/dist/core/acp/index.d.ts.map +0 -1
- package/dist/core/acp/index.js +0 -5
- package/dist/core/acp/index.js.map +0 -1
- package/dist/core/acp/projection.d.ts +0 -23
- package/dist/core/acp/projection.d.ts.map +0 -1
- package/dist/core/acp/projection.js +0 -603
- package/dist/core/acp/projection.js.map +0 -1
- package/dist/core/acp/session-controller.d.ts +0 -90
- package/dist/core/acp/session-controller.d.ts.map +0 -1
- package/dist/core/acp/session-controller.js +0 -530
- package/dist/core/acp/session-controller.js.map +0 -1
- package/dist/core/acp/types.d.ts +0 -66
- package/dist/core/acp/types.d.ts.map +0 -1
- package/dist/core/acp/types.js +0 -21
- package/dist/core/acp/types.js.map +0 -1
- package/dist/core/session/runtime-transport.d.ts +0 -16
- package/dist/core/session/runtime-transport.d.ts.map +0 -1
- package/dist/core/session/runtime-transport.js +0 -30
- package/dist/core/session/runtime-transport.js.map +0 -1
- package/dist/react/session-busy.d.ts +0 -8
- package/dist/react/session-busy.d.ts.map +0 -1
- package/dist/react/session-busy.js +0 -4
- package/dist/react/session-busy.js.map +0 -1
- package/dist/react/use-acp-session-runtime.d.ts +0 -34
- package/dist/react/use-acp-session-runtime.d.ts.map +0 -1
- package/dist/react/use-acp-session-runtime.js +0 -84
- package/dist/react/use-acp-session-runtime.js.map +0 -1
- package/dist/react/use-admin-users.d.ts +0 -98
- package/dist/react/use-admin-users.d.ts.map +0 -1
- package/dist/react/use-admin-users.js +0 -121
- package/dist/react/use-admin-users.js.map +0 -1
|
@@ -35,10 +35,6 @@ export interface ProjectSession {
|
|
|
35
35
|
* token kind, not the surface. A backend (PAT/service-account) create is
|
|
36
36
|
* 'backend'; a human web session is 'user'. See Kortix-as-a-Backend. */
|
|
37
37
|
origin?: 'user' | 'trigger' | 'schedule' | 'backend' | 'system';
|
|
38
|
-
/** The wrapper's end-user this session acts for (backend origin only). */
|
|
39
|
-
end_user_ref?: string | null;
|
|
40
|
-
/** @deprecated Renamed to `end_user_ref`. Echoed with the same value. */
|
|
41
|
-
origin_ref?: string | null;
|
|
42
38
|
/** The per-session secrets allowlist that was applied (identifiers); null = none. */
|
|
43
39
|
secrets_allowlist?: string[] | null;
|
|
44
40
|
sharing?: ConnectorSharing | null;
|
|
@@ -57,9 +53,19 @@ export interface ProjectSession {
|
|
|
57
53
|
export type SessionRuntimeContextScalar = string | number | boolean | null;
|
|
58
54
|
export type SessionRuntimeContext = Record<string, SessionRuntimeContextScalar>;
|
|
59
55
|
export interface SessionConnectorBinding {
|
|
60
|
-
|
|
56
|
+
authorization_id: string;
|
|
61
57
|
}
|
|
62
58
|
export type SessionConnectorBindings = Record<string, SessionConnectorBinding>;
|
|
59
|
+
export type SessionConnectorBindingInput = {
|
|
60
|
+
authorization_id: string;
|
|
61
|
+
/** @deprecated Use `authorization_id`. Equal dual IDs remain accepted. */
|
|
62
|
+
profile_id?: string;
|
|
63
|
+
} | {
|
|
64
|
+
authorization_id?: never;
|
|
65
|
+
/** @deprecated Use `authorization_id`. */
|
|
66
|
+
profile_id: string;
|
|
67
|
+
};
|
|
68
|
+
export type SessionConnectorBindingsInput = Record<string, SessionConnectorBindingInput>;
|
|
63
69
|
/** Public body for POST /projects/:projectId/sessions. */
|
|
64
70
|
export interface CreateProjectSessionInput {
|
|
65
71
|
base_ref?: string;
|
|
@@ -76,41 +82,19 @@ export interface CreateProjectSessionInput {
|
|
|
76
82
|
metadata?: Record<string, unknown>;
|
|
77
83
|
/** Persisted and injected as one non-secret KORTIX_SESSION_CONTEXT JSON envelope. */
|
|
78
84
|
runtime_context?: SessionRuntimeContext;
|
|
79
|
-
/** Logical connector alias -> active
|
|
80
|
-
|
|
81
|
-
* the caller holds the management capability. */
|
|
82
|
-
connector_bindings?: SessionConnectorBindings;
|
|
85
|
+
/** Logical connector alias -> active authorization available to the caller. */
|
|
86
|
+
connector_bindings?: SessionConnectorBindingsInput;
|
|
83
87
|
/**
|
|
84
|
-
* When `connector_bindings` is set,
|
|
85
|
-
*
|
|
86
|
-
* `inherit_unbound: true` keeps that fallback, so you can override just one
|
|
87
|
-
* connector (e.g. a user's own account) without re-binding the rest. Only ever
|
|
88
|
-
* inherits the project default — never another owner's profile.
|
|
88
|
+
* When `connector_bindings` is set, unbound aliases fail closed.
|
|
89
|
+
* `inherit_unbound: true` keeps strategy-based default resolution for them.
|
|
89
90
|
*/
|
|
90
91
|
inherit_unbound?: boolean;
|
|
91
92
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* structured `CONNECTOR_CONNECTION_REQUIRED` naming the connector so a UI can
|
|
96
|
-
* prompt a connect. Implies `inherit_unbound`. Rejected for backend / service-
|
|
97
|
-
* account tokens (they have no single "current user" — use `connector_bindings`).
|
|
93
|
+
* Connector profiles that must resolve a strategy-compatible authorization
|
|
94
|
+
* before provisioning. Missing authorizations return
|
|
95
|
+
* `CONNECTOR_AUTHORIZATION_REQUIRED`.
|
|
98
96
|
*/
|
|
99
97
|
require_connectors?: string[];
|
|
100
|
-
/**
|
|
101
|
-
* Kortix-as-a-Backend (backend-origin callers only — a PAT / service-account
|
|
102
|
-
* bearer). The wrapper's opaque end-user this session acts for; recorded on the
|
|
103
|
-
* session and surfaced to the sandbox as KORTIX_ORIGIN_REF. A non-backend
|
|
104
|
-
* caller supplying it is rejected 403. Attribution only — pass the user's
|
|
105
|
-
* connectors via connector_bindings.
|
|
106
|
-
*/
|
|
107
|
-
/** Your opaque handle for the END-USER this session acts for. Backend origin only. */
|
|
108
|
-
end_user_ref?: string;
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated Renamed to `end_user_ref`. Still accepted; sending both is fine
|
|
111
|
-
* only if they agree (disagreeing values are rejected 400).
|
|
112
|
-
*/
|
|
113
|
-
origin_ref?: string;
|
|
114
98
|
/**
|
|
115
99
|
* Kortix-as-a-Backend (backend-origin callers only). Narrow which project
|
|
116
100
|
* secrets (by identifier) this session's sandbox receives, from the agent's
|
|
@@ -144,16 +128,9 @@ export interface ProjectOpenCodeSession {
|
|
|
144
128
|
updated_at: number | null;
|
|
145
129
|
archived_at: number | null;
|
|
146
130
|
}
|
|
147
|
-
/**
|
|
148
|
-
* @param options.scope - `project` asks for the manager-only full inventory.
|
|
149
|
-
* @param options.end_user_ref - Kortix-as-a-Backend: return only the sessions
|
|
150
|
-
* this wrapper created for ONE of its end-users. Filtered server-side, so a
|
|
151
|
-
* wrapper never has to fetch the whole project to answer "show me this
|
|
152
|
-
* customer's sessions".
|
|
153
|
-
*/
|
|
131
|
+
/** @param options.scope - `project` asks for the manager-only full inventory. */
|
|
154
132
|
export declare function listProjectSessions(projectId: string, options?: {
|
|
155
133
|
scope?: 'visible' | 'project';
|
|
156
|
-
end_user_ref?: string;
|
|
157
134
|
}): Promise<ProjectSession[]>;
|
|
158
135
|
/**
|
|
159
136
|
* Set who can see/open a session (private | project | members). Owner or
|
|
@@ -240,9 +217,19 @@ export interface SessionAuditAction {
|
|
|
240
217
|
* still awaiting a decision. */
|
|
241
218
|
resolved_by: string | null;
|
|
242
219
|
resolved_by_email: string | null;
|
|
220
|
+
/**
|
|
221
|
+
* Redacted detail the gateway recorded. For a gated call this carries
|
|
222
|
+
* `args_preview` — the (secret-stripped) arguments the call would run with,
|
|
223
|
+
* which is what makes an approval decidable rather than a guess.
|
|
224
|
+
*/
|
|
243
225
|
result_summary: Record<string, unknown> | null;
|
|
244
226
|
at: string;
|
|
245
227
|
resolved_at: string | null;
|
|
228
|
+
/**
|
|
229
|
+
* Standalone page for reviewing and deciding this call. Non-null only while
|
|
230
|
+
* the row is unresolved; a settled decision carries no live link.
|
|
231
|
+
*/
|
|
232
|
+
approval_url?: string | null;
|
|
246
233
|
}
|
|
247
234
|
export interface SessionAudit {
|
|
248
235
|
session_id: string;
|
|
@@ -353,9 +340,72 @@ export declare function stopProjectSession(projectId: string, sessionId: string)
|
|
|
353
340
|
* rebuild its config), which ends any in-flight turn. `applied_live: false`
|
|
354
341
|
* means it was stored and will apply when the sandbox next starts.
|
|
355
342
|
*/
|
|
356
|
-
|
|
343
|
+
/** What a re-scope may change, and what it reports back. */
|
|
344
|
+
export interface SessionScopeInput {
|
|
345
|
+
/**
|
|
346
|
+
* FULL new allowlist — this REPLACES the previous one. `null` stops narrowing
|
|
347
|
+
* (fall back to the agent's own grant); `[]` means "no project secrets at
|
|
348
|
+
* all". Those two are opposite, so the field is optional: omit it to leave
|
|
349
|
+
* secrets untouched.
|
|
350
|
+
*/
|
|
351
|
+
secrets?: string[] | null;
|
|
352
|
+
/** FULL new binding map — REPLACES the previous one. Omit to leave untouched. */
|
|
353
|
+
connector_bindings?: SessionConnectorBindingsInput;
|
|
354
|
+
/**
|
|
355
|
+
* FULL new list of connector aliases this session REQUIRES — REPLACES the
|
|
356
|
+
* previous one. Omit to leave untouched.
|
|
357
|
+
*
|
|
358
|
+
* Unlike `connector_bindings`, an alias here needs nothing connected to it:
|
|
359
|
+
* that is the point. A binding says "use THIS connection" and must carry an
|
|
360
|
+
* authorization id, so it cannot express "this session needs Gmail and has
|
|
361
|
+
* none". Naming an alias here makes the next turn stop with
|
|
362
|
+
* `CONNECTOR_AUTHORIZATION_REQUIRED` and a connect prompt instead of letting
|
|
363
|
+
* the agent discover the gap mid-answer.
|
|
364
|
+
*/
|
|
365
|
+
require_connectors?: string[] | null;
|
|
366
|
+
}
|
|
367
|
+
export interface SessionScope {
|
|
368
|
+
secrets_allowlist: string[] | null;
|
|
369
|
+
/** Aliases this session requires, connected or not. See `require_connectors`. */
|
|
370
|
+
required_connectors: string[] | null;
|
|
371
|
+
connector_bindings: SessionConnectorBindings;
|
|
372
|
+
dropped_secrets: string[];
|
|
373
|
+
added_secrets: string[];
|
|
374
|
+
dropped_bindings: string[];
|
|
375
|
+
/**
|
|
376
|
+
* False when a secret was dropped. Connector bindings resolve server-side at
|
|
377
|
+
* call time so they take effect immediately, but a secret the agent has
|
|
378
|
+
* already read stays in its context and in shells it already started —
|
|
379
|
+
* dropping it stops future DELIVERY, it does not un-read the value. Surface
|
|
380
|
+
* this rather than reporting a plain success.
|
|
381
|
+
*/
|
|
382
|
+
retroactive: boolean;
|
|
383
|
+
detail: string;
|
|
384
|
+
}
|
|
385
|
+
/** @deprecated Use `SessionScope`. */
|
|
386
|
+
export type SessionScopeResult = SessionScope;
|
|
387
|
+
export declare function getProjectSessionScope(projectId: string, sessionId: string): Promise<SessionScope>;
|
|
388
|
+
/**
|
|
389
|
+
* Re-scope a RUNNING session. Set semantics: what you send replaces what was
|
|
390
|
+
* there, and takes effect from the next prompt.
|
|
391
|
+
*/
|
|
392
|
+
export declare function setProjectSessionScope(projectId: string, sessionId: string, scope: SessionScopeInput): Promise<SessionScope>;
|
|
393
|
+
export interface SessionModelChangeResult {
|
|
357
394
|
opencode_model: string;
|
|
395
|
+
/** True only when a LIVE sandbox took the new model. */
|
|
358
396
|
applied_live: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* `true` when a live push was required and FAILED: the model is stored, but
|
|
399
|
+
* the running harness still answers from the OLD one.
|
|
400
|
+
*
|
|
401
|
+
* Check this, never `!applied_live`, before telling a user the change landed.
|
|
402
|
+
* `applied_live: false` is also the ordinary answer for a session with no live
|
|
403
|
+
* sandbox, where the stored value IS the mechanism and the next start reads
|
|
404
|
+
* it. Treating the two the same is how a `502` env-sync failure got reported
|
|
405
|
+
* as "saved — applies when this session next starts".
|
|
406
|
+
*/
|
|
407
|
+
push_failed?: true;
|
|
359
408
|
detail?: string;
|
|
360
|
-
}
|
|
409
|
+
}
|
|
410
|
+
export declare function setProjectSessionModel(projectId: string, sessionId: string, opencodeModel: string): Promise<SessionModelChangeResult>;
|
|
361
411
|
//# sourceMappingURL=sessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/sessions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,gBAAgB,EAAU,MAAM,UAAU,CAAC;AAQzD,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,WAAW,GACX,cAAc,GACd,SAAS,GACT,SAAS,GACT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AAO,CAAC,wBAAwB,CAAC,CAOnC"}
|
|
@@ -2,19 +2,11 @@
|
|
|
2
2
|
import { backendApi } from '../../http/api-client.js';
|
|
3
3
|
import { markSessionFresh } from '../../http/fresh-sessions.js';
|
|
4
4
|
import { unwrap } from './shared.js';
|
|
5
|
-
/**
|
|
6
|
-
* @param options.scope - `project` asks for the manager-only full inventory.
|
|
7
|
-
* @param options.end_user_ref - Kortix-as-a-Backend: return only the sessions
|
|
8
|
-
* this wrapper created for ONE of its end-users. Filtered server-side, so a
|
|
9
|
-
* wrapper never has to fetch the whole project to answer "show me this
|
|
10
|
-
* customer's sessions".
|
|
11
|
-
*/
|
|
5
|
+
/** @param options.scope - `project` asks for the manager-only full inventory. */
|
|
12
6
|
export async function listProjectSessions(projectId, options) {
|
|
13
7
|
const params = new URLSearchParams();
|
|
14
8
|
if (options?.scope && options.scope !== 'visible')
|
|
15
9
|
params.set('scope', options.scope);
|
|
16
|
-
if (options?.end_user_ref)
|
|
17
|
-
params.set('end_user_ref', options.end_user_ref);
|
|
18
10
|
const query = params.size > 0 ? `?${params}` : '';
|
|
19
11
|
return unwrap(await backendApi.get(`/projects/${projectId}/sessions${query}`));
|
|
20
12
|
}
|
|
@@ -111,14 +103,16 @@ export async function restartProjectSession(projectId, sessionId) {
|
|
|
111
103
|
export async function stopProjectSession(projectId, sessionId) {
|
|
112
104
|
return unwrap(await backendApi.post(`/projects/${projectId}/sessions/${sessionId}/stop`, {}));
|
|
113
105
|
}
|
|
106
|
+
export async function getProjectSessionScope(projectId, sessionId) {
|
|
107
|
+
return unwrap(await backendApi.get(`/projects/${projectId}/sessions/${encodeURIComponent(sessionId)}/scope`));
|
|
108
|
+
}
|
|
114
109
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* `opencode_model` is set at create; this re-points an existing session. When
|
|
118
|
-
* the sandbox is live the change takes effect immediately (opencode restarts to
|
|
119
|
-
* rebuild its config), which ends any in-flight turn. `applied_live: false`
|
|
120
|
-
* means it was stored and will apply when the sandbox next starts.
|
|
110
|
+
* Re-scope a RUNNING session. Set semantics: what you send replaces what was
|
|
111
|
+
* there, and takes effect from the next prompt.
|
|
121
112
|
*/
|
|
113
|
+
export async function setProjectSessionScope(projectId, sessionId, scope) {
|
|
114
|
+
return unwrap(await backendApi.put(`/projects/${projectId}/sessions/${encodeURIComponent(sessionId)}/scope`, scope));
|
|
115
|
+
}
|
|
122
116
|
export async function setProjectSessionModel(projectId, sessionId, opencodeModel) {
|
|
123
117
|
return unwrap(await backendApi.put(`/projects/${projectId}/sessions/${encodeURIComponent(sessionId)}/model`, { opencode_model: opencodeModel }));
|
|
124
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/sessions.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAyB,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/sessions.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAyB,MAAM,EAAE,MAAM,UAAU,CAAC;AA2JzD,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,SAAiB,EACjB,OAA2C;IAE3C,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IACrC,IAAI,OAAO,EAAE,KAAK,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACtF,MAAM,K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D,EAAE,CACH,CACF,CAAC;AACJ,CAAC;AAyDD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,SAAiB,EACjB,SAAiB;IAEjB,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,SAAS,aAAa,kBAAkB,CAAC,SAAS,CAAC,QAAQ,CACzE,CACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,SAAiB,EACjB,SAAiB,EACjB,KAAwB;IAExB,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,SAAS,aAAa,kBAAkB,CAAC,SAAS,CAAC,QAAQ,EACxE,KAAK,CACN,CACF,CAAC;AACJ,CAAC;AAoBD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,SAAiB,EACjB,SAAiB,EACjB,aAAqB;IAErB,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,SAAS,aAAa,kBAAkB,CAAC,SAAS,CAAC,QAAQ,EACxE,EAAE,cAAc,EAAE,aAAa,EAAE,CAClC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -32,4 +32,41 @@ export interface ConnectorRequestLink {
|
|
|
32
32
|
}
|
|
33
33
|
/** Mint a link a human opens to 1-click connect a Pipedream app (Quick Connect). */
|
|
34
34
|
export declare function requestProjectConnector(projectId: string, input: RequestProjectConnectorInput): Promise<ConnectorRequestLink>;
|
|
35
|
+
/** What a human is being asked to approve, behind an approval link. */
|
|
36
|
+
export interface ApprovalLinkDetails {
|
|
37
|
+
kind: 'approval';
|
|
38
|
+
project_id: string;
|
|
39
|
+
project_name: string;
|
|
40
|
+
execution_id: string;
|
|
41
|
+
session_id: string | null;
|
|
42
|
+
/** Fully-qualified tool path, e.g. `gmail.send_email`. */
|
|
43
|
+
action: string;
|
|
44
|
+
connector: string | null;
|
|
45
|
+
/** read | write | destructive | null */
|
|
46
|
+
risk: string | null;
|
|
47
|
+
status: string;
|
|
48
|
+
/** False once resolved (or expired) — render the outcome, not buttons. */
|
|
49
|
+
pending: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* REDACTED arguments the call would run with — the answer to "where is this
|
|
52
|
+
* actually going?". Credential-shaped fields are replaced server-side and
|
|
53
|
+
* never leave the API.
|
|
54
|
+
*/
|
|
55
|
+
args_preview: Record<string, unknown> | null;
|
|
56
|
+
/** One-line rendering of the fields that identify the target. */
|
|
57
|
+
args_summary: string | null;
|
|
58
|
+
policy_source: string | null;
|
|
59
|
+
requested_at: string;
|
|
60
|
+
resolved_at: string | null;
|
|
61
|
+
expires_at: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Read a pending approval by its link token.
|
|
65
|
+
*
|
|
66
|
+
* REQUIRES A SIGNED-IN, AUTHORISED ACCOUNT: unlike the secret/connect links
|
|
67
|
+
* above, the token is only a pointer to which decision is being asked for — it
|
|
68
|
+
* carries no authority to make it. 401 = sign in; 403 = signed in but not a
|
|
69
|
+
* manager/launcher on that project.
|
|
70
|
+
*/
|
|
71
|
+
export declare function getApprovalLink(token: string): Promise<ApprovalLinkDetails>;
|
|
35
72
|
//# sourceMappingURL=setup-links.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-links.d.ts","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/setup-links.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,yBAAyB;IACxC,6EAA6E;IAC7E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,qFAAqF;IACrF,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oEAAoE;AACpE,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAW5B;AAED,MAAM,WAAW,4BAA4B;IAC3C,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oFAAoF;AACpF,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CAQ/B"}
|
|
1
|
+
{"version":3,"file":"setup-links.d.ts","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/setup-links.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,yBAAyB;IACxC,6EAA6E;IAC7E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,qFAAqF;IACrF,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,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;IACjE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAKjF"}
|
|
@@ -21,4 +21,15 @@ export async function requestProjectConnector(projectId, input) {
|
|
|
21
21
|
expires_in_minutes: input.expiresInMinutes,
|
|
22
22
|
}), 'Failed to mint connect link');
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Read a pending approval by its link token.
|
|
26
|
+
*
|
|
27
|
+
* REQUIRES A SIGNED-IN, AUTHORISED ACCOUNT: unlike the secret/connect links
|
|
28
|
+
* above, the token is only a pointer to which decision is being asked for — it
|
|
29
|
+
* carries no authority to make it. 401 = sign in; 403 = signed in but not a
|
|
30
|
+
* manager/launcher on that project.
|
|
31
|
+
*/
|
|
32
|
+
export async function getApprovalLink(token) {
|
|
33
|
+
return unwrap(await backendApi.get(`/approval-links/${token}`), 'Failed to load approval');
|
|
34
|
+
}
|
|
24
35
|
//# sourceMappingURL=setup-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-links.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/setup-links.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,gFAAgF;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAsBlC,oEAAoE;AACpE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,KAAgC;IAEhC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CAAoB,aAAa,SAAS,kBAAkB,EAAE;QACjF,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,kBAAkB,EAAE,KAAK,CAAC,gBAAgB;KAC3C,CAAC,EACF,kCAAkC,CACnC,CAAC;AACJ,CAAC;AAgBD,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAiB,EACjB,KAAmC;IAEnC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CAAuB,aAAa,SAAS,mBAAmB,EAAE;QACrF,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,kBAAkB,EAAE,KAAK,CAAC,gBAAgB;KAC3C,CAAC,EACF,6BAA6B,CAC9B,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"setup-links.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/setup-links.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,gFAAgF;AAEhF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAsBlC,oEAAoE;AACpE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,KAAgC;IAEhC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CAAoB,aAAa,SAAS,kBAAkB,EAAE;QACjF,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,kBAAkB,EAAE,KAAK,CAAC,gBAAgB;KAC3C,CAAC,EACF,kCAAkC,CACnC,CAAC;AACJ,CAAC;AAgBD,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAiB,EACjB,KAAmC;IAEnC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CAAuB,aAAa,SAAS,mBAAmB,EAAE;QACrF,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,kBAAkB,EAAE,KAAK,CAAC,gBAAgB;KAC3C,CAAC,EACF,6BAA6B,CAC9B,CAAC;AACJ,CAAC;AA+BD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAa;IACjD,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAAsB,mBAAmB,KAAK,EAAE,CAAC,EACrE,yBAAyB,CAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* are excluded.
|
|
15
15
|
*/
|
|
16
16
|
export * from './url.js';
|
|
17
|
-
export * from './runtime-transport.js';
|
|
18
17
|
export * from './health.js';
|
|
19
18
|
export * from './preview.js';
|
|
19
|
+
export * from './preview-auth.js';
|
|
20
20
|
export * from './presentation.js';
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* are excluded.
|
|
15
15
|
*/
|
|
16
16
|
export * from './url.js';
|
|
17
|
-
export * from './runtime-transport.js';
|
|
18
17
|
export * from './health.js';
|
|
19
18
|
export * from './preview.js';
|
|
19
|
+
export * from './preview-auth.js';
|
|
20
20
|
export * from './presentation.js';
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview-proxy cookie exchange (side-effecting).
|
|
3
|
+
*
|
|
4
|
+
* `preview.ts` next door is pure — it only decides endpoints and token rules.
|
|
5
|
+
* This module performs the actual `POST /…/p/auth` that mints the
|
|
6
|
+
* `__preview_session` cookie, so the two concerns stay separable and the pure
|
|
7
|
+
* helpers remain trivially testable.
|
|
8
|
+
*
|
|
9
|
+
* Two callers need this, for different reasons:
|
|
10
|
+
* - `react/use-authenticated-preview-url` — keeps an iframe's cookie warm on
|
|
11
|
+
* an interval while a preview is mounted.
|
|
12
|
+
* - opening a workspace file in a real browser tab — a one-shot mint, because
|
|
13
|
+
* nothing has necessarily rendered a preview for that sandbox yet, so no
|
|
14
|
+
* cookie may exist at click time.
|
|
15
|
+
*
|
|
16
|
+
* Without the one-shot case, "open in a new tab" can only hand the browser
|
|
17
|
+
* bytes it already has (a `blob:` URL), which is not an address: it cannot be
|
|
18
|
+
* reloaded, bookmarked, or sent to anyone.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Mint the `__preview_session` cookie for `previewUrl`'s proxy origin.
|
|
22
|
+
*
|
|
23
|
+
* Resolves `true` when the cookie was (re)issued, `false` when the URL is not a
|
|
24
|
+
* trusted preview-proxy URL, no token is available, or the exchange failed.
|
|
25
|
+
* Never throws — callers treat a false as "proceed and let the proxy answer",
|
|
26
|
+
* matching how the interval refresh in `use-authenticated-preview-url` already
|
|
27
|
+
* tolerates a failed refresh.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ensurePreviewSessionCookie(previewUrl: string, options?: {
|
|
30
|
+
serverUrl?: string;
|
|
31
|
+
}): Promise<boolean>;
|
|
32
|
+
//# sourceMappingURL=preview-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-auth.d.ts","sourceRoot":"","sources":["../../../src/core/session/preview-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACnC,OAAO,CAAC,OAAO,CAAC,CAoBlB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preview-proxy cookie exchange (side-effecting).
|
|
3
|
+
*
|
|
4
|
+
* `preview.ts` next door is pure — it only decides endpoints and token rules.
|
|
5
|
+
* This module performs the actual `POST /…/p/auth` that mints the
|
|
6
|
+
* `__preview_session` cookie, so the two concerns stay separable and the pure
|
|
7
|
+
* helpers remain trivially testable.
|
|
8
|
+
*
|
|
9
|
+
* Two callers need this, for different reasons:
|
|
10
|
+
* - `react/use-authenticated-preview-url` — keeps an iframe's cookie warm on
|
|
11
|
+
* an interval while a preview is mounted.
|
|
12
|
+
* - opening a workspace file in a real browser tab — a one-shot mint, because
|
|
13
|
+
* nothing has necessarily rendered a preview for that sandbox yet, so no
|
|
14
|
+
* cookie may exist at click time.
|
|
15
|
+
*
|
|
16
|
+
* Without the one-shot case, "open in a new tab" can only hand the browser
|
|
17
|
+
* bytes it already has (a `blob:` URL), which is not an address: it cannot be
|
|
18
|
+
* reloaded, bookmarked, or sent to anyone.
|
|
19
|
+
*/
|
|
20
|
+
import { getAuthToken } from '../http/auth.js';
|
|
21
|
+
import { buildPreviewAuthEndpoint } from './preview.js';
|
|
22
|
+
/**
|
|
23
|
+
* Mint the `__preview_session` cookie for `previewUrl`'s proxy origin.
|
|
24
|
+
*
|
|
25
|
+
* Resolves `true` when the cookie was (re)issued, `false` when the URL is not a
|
|
26
|
+
* trusted preview-proxy URL, no token is available, or the exchange failed.
|
|
27
|
+
* Never throws — callers treat a false as "proceed and let the proxy answer",
|
|
28
|
+
* matching how the interval refresh in `use-authenticated-preview-url` already
|
|
29
|
+
* tolerates a failed refresh.
|
|
30
|
+
*/
|
|
31
|
+
export async function ensurePreviewSessionCookie(previewUrl, options = {}) {
|
|
32
|
+
const authEndpoint = buildPreviewAuthEndpoint(previewUrl, options.serverUrl);
|
|
33
|
+
if (!authEndpoint)
|
|
34
|
+
return false;
|
|
35
|
+
const token = await getAuthToken();
|
|
36
|
+
if (!token)
|
|
37
|
+
return false;
|
|
38
|
+
try {
|
|
39
|
+
const response = await fetch(authEndpoint, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
credentials: 'include',
|
|
42
|
+
headers: {
|
|
43
|
+
Authorization: `Bearer ${token}`,
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
return response.ok;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=preview-auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-auth.js","sourceRoot":"","sources":["../../../src/core/session/preview-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,UAAkB,EAClB,UAAkC,EAAE;IAEpC,MAAM,YAAY,GAAG,wBAAwB,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7E,IAAI,CAAC,YAAY;QAAE,OAAO,KAAK,CAAC;IAEhC,MAAM,KAAK,GAAG,MAAM,YAAY,EAAE,CAAC;IACnC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IAEzB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,YAAY,EAAE;YACzC,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,SAAS;YACtB,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-helpers.d.ts","sourceRoot":"","sources":["../../../../src/core/session/server-store/url-helpers.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,oBAAoB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"url-helpers.d.ts","sourceRoot":"","sources":["../../../../src/core/session/server-store/url-helpers.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAM7C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7E"}
|
|
@@ -15,9 +15,11 @@ export function getBackendUrl() {
|
|
|
15
15
|
return stripTrailingSlashes(platformConfig().backendUrl || 'http://localhost:8008/v1');
|
|
16
16
|
}
|
|
17
17
|
export function getDefaultSandboxUrl() {
|
|
18
|
-
// Self-host override only
|
|
19
|
-
//
|
|
20
|
-
const sandboxId = platformConfig().sandboxId
|
|
18
|
+
// Self-host override only. Without an explicit id there is no valid target,
|
|
19
|
+
// so callers must wait for the active session to bind its runtime.
|
|
20
|
+
const sandboxId = platformConfig().sandboxId;
|
|
21
|
+
if (!sandboxId)
|
|
22
|
+
return '';
|
|
21
23
|
return `${getBackendUrl()}/p/${sandboxId}/8000`;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-helpers.js","sourceRoot":"","sources":["../../../../src/core/session/server-store/url-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,mEAAmE;AACnE,mEAAmE;AACnE,SAAS,oBAAoB,CAAC,CAAS;IACrC,IAAI,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS;QAAE,GAAG,EAAE,CAAC;IAChE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,oBAAoB,CAAC,cAAc,EAAE,CAAC,UAAU,IAAI,0BAA0B,CAAC,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,
|
|
1
|
+
{"version":3,"file":"url-helpers.js","sourceRoot":"","sources":["../../../../src/core/session/server-store/url-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,mEAAmE;AACnE,mEAAmE;AACnE,SAAS,oBAAoB,CAAC,CAAS;IACrC,IAAI,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,SAAS;QAAE,GAAG,EAAE,CAAC;IAChE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACzB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,oBAAoB,CAAC,cAAc,EAAE,CAAC,UAAU,IAAI,0BAA0B,CAAC,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,4EAA4E;IAC5E,mEAAmE;IACnE,MAAM,SAAS,GAAG,cAAc,EAAE,CAAC,SAAS,CAAC;IAC7C,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAC1B,OAAO,GAAG,aAAa,EAAE,MAAM,SAAS,OAAO,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,OAAO,GAAG,aAAa,EAAE,MAAM,SAAS,OAAO,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAAkB;IAC3D,OAAO,mBAAmB,CAAC,UAAU,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAa,EAAE,IAAY;IACnE,OAAO,GAAG,aAAa,EAAE,mBAAmB,KAAK,IAAI,IAAI,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { Message, Part, SessionStatus } from '@opencode-ai/sdk/v2/client';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Messages per bounded read — the newest-first window a session opens with,
|
|
4
|
+
* and the step size when the transcript pulls older history.
|
|
5
|
+
*
|
|
6
|
+
* OpenCode carries tool output as *parts* of the assistant message, so a page
|
|
7
|
+
* is roughly half as many turns as it is messages: 50 covers ~25 turns, which
|
|
8
|
+
* is a whole ordinary session. That is the point — most sessions now open
|
|
9
|
+
* fully loaded and never pull at all, while a long one still opens bounded
|
|
10
|
+
* instead of dragging its entire history over the sandbox proxy.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SESSION_SYNC_PAGE_SIZE = 50;
|
|
3
13
|
export type SessionSyncFreshness = 'idle' | 'loading' | 'fresh' | 'stale' | 'error';
|
|
4
14
|
export interface SessionSyncMessage {
|
|
5
15
|
info: Message;
|
|
@@ -105,6 +115,7 @@ export declare class SessionSyncController {
|
|
|
105
115
|
private loadCompleteTurn;
|
|
106
116
|
private rememberUserMessages;
|
|
107
117
|
private checkLiveness;
|
|
118
|
+
private containsNewPromptReply;
|
|
108
119
|
private reconcileStatus;
|
|
109
120
|
private setCursor;
|
|
110
121
|
private stopLivenessTimer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-sync-controller.d.ts","sourceRoot":"","sources":["../../../src/core/session-sync/session-sync-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE/E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,eA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