@immediately-run/sdk 0.57.4 → 0.58.0
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/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/workspace.cjs +53 -0
- package/dist/workspace.cjs.map +1 -0
- package/dist/workspace.d.cts +58 -0
- package/dist/workspace.d.ts +58 -0
- package/dist/workspace.js +28 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -45,6 +45,7 @@ __reExport(index_exports, require("./editorContext"), module.exports);
|
|
|
45
45
|
__reExport(index_exports, require("./editor"), module.exports);
|
|
46
46
|
__reExport(index_exports, require("./formFactor"), module.exports);
|
|
47
47
|
__reExport(index_exports, require("./chromeState"), module.exports);
|
|
48
|
+
__reExport(index_exports, require("./workspace"), module.exports);
|
|
48
49
|
__reExport(index_exports, require("./hostAttention"), module.exports);
|
|
49
50
|
__reExport(index_exports, require("./region"), module.exports);
|
|
50
51
|
__reExport(index_exports, require("./mounts"), module.exports);
|
|
@@ -104,6 +105,7 @@ __reExport(index_exports, require("./fence"), module.exports);
|
|
|
104
105
|
...require("./editor"),
|
|
105
106
|
...require("./formFactor"),
|
|
106
107
|
...require("./chromeState"),
|
|
108
|
+
...require("./workspace"),
|
|
107
109
|
...require("./hostAttention"),
|
|
108
110
|
...require("./region"),
|
|
109
111
|
...require("./mounts"),
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './MDXProvider';\nexport * from './routing';\nexport * from './boot';\nexport * from './components/Include';\n// Only the component is public. `stripFrontmatter`/`appMountRelative` are module-level\n// exports so they can be unit-tested directly, NOT public API — the SDK's surface is\n// backwards-compatible forever, so an internal helper exported for a test's convenience is a\n// permanent commitment made for the wrong reason.\nexport { SafeInclude } from './components/SafeInclude';\nexport * from './sourceCache';\nexport * from './components/MDXComponents';\nexport * from './linkSpace';\nexport * from './bundle';\n// Deprecated `Corpus*` spellings of the above (R3-482); see `src/corpus.ts`.\nexport * from './corpus';\nexport * from './components/MountImage';\nexport * from './components/Routes';\nexport * from './hooks';\n// R3-276: the supported way for a viewer app to provide its own metadata store,\n// replacing a wholesale re-provision of `TinkerableContext` in app code.\nexport * from './metadataSource';\n// The deprecated injected-bundler adapters, re-exported so their deprecation notices\n// are visible in the published docs (R3-278; the window only narrows).\nexport { getInjectedMetadataEmitter, getInjectedMetadataSnapshot } from './injectedBundler';\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './editor';\nexport * from './formFactor';\nexport * from './chromeState';\nexport * from './hostAttention';\nexport * from './region';\nexport * from './mounts';\nexport * from './analytics';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './ipc';\nexport * from './dnd';\nexport * from './netFetch';\nexport * from './feed';\nexport * from './secrets';\nexport * from './recents'; // R3-485: the gated recent-projects read (page.home)\nexport * from './llm';\nexport * from './diagnostics';\nexport * from './vcs';\nexport * from './onFsChange';\nexport * from './fs';\nexport * from './debug';\nexport * from './tasks';\nexport * from './launch';\nexport * from './runtime';\nexport * from './irMarkers';\nexport * from './ready';\nexport * from './loading';\nexport * from './protocolStream';\nexport * from './protocolDeadline';\nexport * from './sandboxTypes';\nexport * from './safeContent';\n// R3-489 (GROVE_AGENT_SPEC): the embedded-agent seam every app shares — the tool-use\n// loop ported from agent-demo (`runAgent` over the host chat slot), the MDX metadata\n// query tool, the headings index collector, the deixis context block, and the fence\n// for corpus-derived bytes entering a loop.\nexport * from './agentLoop';\nexport * from './agentSteering';\nexport * from './agentChatClient';\nexport * from './metadataQueryTool';\nexport * from './collectHeadings';\nexport * from './agentContext';\nexport * from './fence';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,0BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,mBAFd;AAGA,0BAAc,iCAHd;AAQA,yBAA4B;AAC5B,0BAAc,0BATd;AAUA,0BAAc,uCAVd;AAWA,0BAAc,wBAXd;AAYA,0BAAc,qBAZd;AAcA,0BAAc,qBAdd;AAeA,0BAAc,oCAfd;AAgBA,0BAAc,gCAhBd;AAiBA,0BAAc,oBAjBd;AAoBA,0BAAc,6BApBd;AAuBA,6BAAwE;AACxE,0BAAc,mBAxBd;AAyBA,0BAAc,oBAzBd;AA0BA,0BAAc,4BA1Bd;AA2BA,0BAAc,qBA3Bd;AA4BA,0BAAc,yBA5Bd;AA6BA,0BAAc,0BA7Bd;AA8BA,0BAAc,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './MDXProvider';\nexport * from './routing';\nexport * from './boot';\nexport * from './components/Include';\n// Only the component is public. `stripFrontmatter`/`appMountRelative` are module-level\n// exports so they can be unit-tested directly, NOT public API — the SDK's surface is\n// backwards-compatible forever, so an internal helper exported for a test's convenience is a\n// permanent commitment made for the wrong reason.\nexport { SafeInclude } from './components/SafeInclude';\nexport * from './sourceCache';\nexport * from './components/MDXComponents';\nexport * from './linkSpace';\nexport * from './bundle';\n// Deprecated `Corpus*` spellings of the above (R3-482); see `src/corpus.ts`.\nexport * from './corpus';\nexport * from './components/MountImage';\nexport * from './components/Routes';\nexport * from './hooks';\n// R3-276: the supported way for a viewer app to provide its own metadata store,\n// replacing a wholesale re-provision of `TinkerableContext` in app code.\nexport * from './metadataSource';\n// The deprecated injected-bundler adapters, re-exported so their deprecation notices\n// are visible in the published docs (R3-278; the window only narrows).\nexport { getInjectedMetadataEmitter, getInjectedMetadataSnapshot } from './injectedBundler';\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './editor';\nexport * from './formFactor';\nexport * from './chromeState';\nexport * from './workspace';\nexport * from './hostAttention';\nexport * from './region';\nexport * from './mounts';\nexport * from './analytics';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './ipc';\nexport * from './dnd';\nexport * from './netFetch';\nexport * from './feed';\nexport * from './secrets';\nexport * from './recents'; // R3-485: the gated recent-projects read (page.home)\nexport * from './llm';\nexport * from './diagnostics';\nexport * from './vcs';\nexport * from './onFsChange';\nexport * from './fs';\nexport * from './debug';\nexport * from './tasks';\nexport * from './launch';\nexport * from './runtime';\nexport * from './irMarkers';\nexport * from './ready';\nexport * from './loading';\nexport * from './protocolStream';\nexport * from './protocolDeadline';\nexport * from './sandboxTypes';\nexport * from './safeContent';\n// R3-489 (GROVE_AGENT_SPEC): the embedded-agent seam every app shares — the tool-use\n// loop ported from agent-demo (`runAgent` over the host chat slot), the MDX metadata\n// query tool, the headings index collector, the deixis context block, and the fence\n// for corpus-derived bytes entering a loop.\nexport * from './agentLoop';\nexport * from './agentSteering';\nexport * from './agentChatClient';\nexport * from './metadataQueryTool';\nexport * from './collectHeadings';\nexport * from './agentContext';\nexport * from './fence';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,0BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,mBAFd;AAGA,0BAAc,iCAHd;AAQA,yBAA4B;AAC5B,0BAAc,0BATd;AAUA,0BAAc,uCAVd;AAWA,0BAAc,wBAXd;AAYA,0BAAc,qBAZd;AAcA,0BAAc,qBAdd;AAeA,0BAAc,oCAfd;AAgBA,0BAAc,gCAhBd;AAiBA,0BAAc,oBAjBd;AAoBA,0BAAc,6BApBd;AAuBA,6BAAwE;AACxE,0BAAc,mBAxBd;AAyBA,0BAAc,oBAzBd;AA0BA,0BAAc,4BA1Bd;AA2BA,0BAAc,qBA3Bd;AA4BA,0BAAc,yBA5Bd;AA6BA,0BAAc,0BA7Bd;AA8BA,0BAAc,wBA9Bd;AA+BA,0BAAc,4BA/Bd;AAgCA,0BAAc,qBAhCd;AAiCA,0BAAc,qBAjCd;AAkCA,0BAAc,wBAlCd;AAmCA,0BAAc,yBAnCd;AAoCA,0BAAc,sBApCd;AAqCA,0BAAc,kBArCd;AAsCA,0BAAc,kBAtCd;AAuCA,0BAAc,uBAvCd;AAwCA,0BAAc,mBAxCd;AAyCA,0BAAc,sBAzCd;AA0CA,0BAAc,sBA1Cd;AA2CA,0BAAc,kBA3Cd;AA4CA,0BAAc,0BA5Cd;AA6CA,0BAAc,kBA7Cd;AA8CA,0BAAc,yBA9Cd;AA+CA,0BAAc,iBA/Cd;AAgDA,0BAAc,oBAhDd;AAiDA,0BAAc,oBAjDd;AAkDA,0BAAc,qBAlDd;AAmDA,0BAAc,sBAnDd;AAoDA,0BAAc,wBApDd;AAqDA,0BAAc,oBArDd;AAsDA,0BAAc,sBAtDd;AAuDA,0BAAc,6BAvDd;AAwDA,0BAAc,+BAxDd;AAyDA,0BAAc,2BAzDd;AA0DA,0BAAc,0BA1Dd;AA+DA,0BAAc,wBA/Dd;AAgEA,0BAAc,4BAhEd;AAiEA,0BAAc,8BAjEd;AAkEA,0BAAc,gCAlEd;AAmEA,0BAAc,8BAnEd;AAoEA,0BAAc,2BApEd;AAqEA,0BAAc,oBArEd;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -18,6 +18,7 @@ export { EditorContext, getEditorContext, onEditorContextChange, useEditorContex
|
|
|
18
18
|
export { EditTarget, EditorOpenError, EditorOpenOptions, EditorSelection, EditorSessionError, EditorWriteError, RequestEditError, closeFile, createFile, createFolder, deleteEntry, openInEditor, renameEntry, requestEdit, setActiveFile, uploadFile } from './editor.cjs';
|
|
19
19
|
export { FormFactor, FormFactorClass, Orientation, getFormFactor, onFormFactorChange, useFormFactor } from './formFactor.cjs';
|
|
20
20
|
export { ChromeState, getChromeState, onChromeStateChange, useChromeState } from './chromeState.cjs';
|
|
21
|
+
export { Workspace, getWorkspace, onWorkspaceChange, useWorkspace } from './workspace.cjs';
|
|
21
22
|
export { HostAttention, HostAttentionKind, NO_HOST_ATTENTION, getHostAttention, onHostAttentionChange, useHostAttention } from './hostAttention.cjs';
|
|
22
23
|
export { getRegion, useRegion } from './region.cjs';
|
|
23
24
|
export { Invite, MountQuery, MountRemoveReason, MountRule, RemovedMount, SandboxMount, SessionMount, SpaceError, acceptInvite, awaitMatchingMount, createSpace, declineInvite, findMount, getAppMountPath, getInvites, getMounts, getSessionMounts, importSettingsFromParent, listMyInvites, listPendingInvites, listSettingsApps, makeContentRef, mount, mountSpace, onInvitesChange, onMountsChange, onSessionMountsChange, openSettings, openSettingsOf, requestMount, requestSpace, resolveContentRef, resolveContentRefs, revokeInvite, unmountSpace, useInvites, useMounts, useSessionMounts, waitForMount } from './mounts.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { EditorContext, getEditorContext, onEditorContextChange, useEditorContex
|
|
|
18
18
|
export { EditTarget, EditorOpenError, EditorOpenOptions, EditorSelection, EditorSessionError, EditorWriteError, RequestEditError, closeFile, createFile, createFolder, deleteEntry, openInEditor, renameEntry, requestEdit, setActiveFile, uploadFile } from './editor.js';
|
|
19
19
|
export { FormFactor, FormFactorClass, Orientation, getFormFactor, onFormFactorChange, useFormFactor } from './formFactor.js';
|
|
20
20
|
export { ChromeState, getChromeState, onChromeStateChange, useChromeState } from './chromeState.js';
|
|
21
|
+
export { Workspace, getWorkspace, onWorkspaceChange, useWorkspace } from './workspace.js';
|
|
21
22
|
export { HostAttention, HostAttentionKind, NO_HOST_ATTENTION, getHostAttention, onHostAttentionChange, useHostAttention } from './hostAttention.js';
|
|
22
23
|
export { getRegion, useRegion } from './region.js';
|
|
23
24
|
export { Invite, MountQuery, MountRemoveReason, MountRule, RemovedMount, SandboxMount, SessionMount, SpaceError, acceptInvite, awaitMatchingMount, createSpace, declineInvite, findMount, getAppMountPath, getInvites, getMounts, getSessionMounts, importSettingsFromParent, listMyInvites, listPendingInvites, listSettingsApps, makeContentRef, mount, mountSpace, onInvitesChange, onMountsChange, onSessionMountsChange, openSettings, openSettingsOf, requestMount, requestSpace, resolveContentRef, resolveContentRefs, revokeInvite, unmountSpace, useInvites, useMounts, useSessionMounts, waitForMount } from './mounts.js';
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './MDXProvider';\nexport * from './routing';\nexport * from './boot';\nexport * from './components/Include';\n// Only the component is public. `stripFrontmatter`/`appMountRelative` are module-level\n// exports so they can be unit-tested directly, NOT public API — the SDK's surface is\n// backwards-compatible forever, so an internal helper exported for a test's convenience is a\n// permanent commitment made for the wrong reason.\nexport { SafeInclude } from './components/SafeInclude';\nexport * from './sourceCache';\nexport * from './components/MDXComponents';\nexport * from './linkSpace';\nexport * from './bundle';\n// Deprecated `Corpus*` spellings of the above (R3-482); see `src/corpus.ts`.\nexport * from './corpus';\nexport * from './components/MountImage';\nexport * from './components/Routes';\nexport * from './hooks';\n// R3-276: the supported way for a viewer app to provide its own metadata store,\n// replacing a wholesale re-provision of `TinkerableContext` in app code.\nexport * from './metadataSource';\n// The deprecated injected-bundler adapters, re-exported so their deprecation notices\n// are visible in the published docs (R3-278; the window only narrows).\nexport { getInjectedMetadataEmitter, getInjectedMetadataSnapshot } from './injectedBundler';\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './editor';\nexport * from './formFactor';\nexport * from './chromeState';\nexport * from './hostAttention';\nexport * from './region';\nexport * from './mounts';\nexport * from './analytics';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './ipc';\nexport * from './dnd';\nexport * from './netFetch';\nexport * from './feed';\nexport * from './secrets';\nexport * from './recents'; // R3-485: the gated recent-projects read (page.home)\nexport * from './llm';\nexport * from './diagnostics';\nexport * from './vcs';\nexport * from './onFsChange';\nexport * from './fs';\nexport * from './debug';\nexport * from './tasks';\nexport * from './launch';\nexport * from './runtime';\nexport * from './irMarkers';\nexport * from './ready';\nexport * from './loading';\nexport * from './protocolStream';\nexport * from './protocolDeadline';\nexport * from './sandboxTypes';\nexport * from './safeContent';\n// R3-489 (GROVE_AGENT_SPEC): the embedded-agent seam every app shares — the tool-use\n// loop ported from agent-demo (`runAgent` over the host chat slot), the MDX metadata\n// query tool, the headings index collector, the deixis context block, and the fence\n// for corpus-derived bytes entering a loop.\nexport * from './agentLoop';\nexport * from './agentSteering';\nexport * from './agentChatClient';\nexport * from './metadataQueryTool';\nexport * from './collectHeadings';\nexport * from './agentContext';\nexport * from './fence';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,SAAS,mBAAmB;AAC5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,SAAS,4BAA4B,mCAAmC;AACxE,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './MDXProvider';\nexport * from './routing';\nexport * from './boot';\nexport * from './components/Include';\n// Only the component is public. `stripFrontmatter`/`appMountRelative` are module-level\n// exports so they can be unit-tested directly, NOT public API — the SDK's surface is\n// backwards-compatible forever, so an internal helper exported for a test's convenience is a\n// permanent commitment made for the wrong reason.\nexport { SafeInclude } from './components/SafeInclude';\nexport * from './sourceCache';\nexport * from './components/MDXComponents';\nexport * from './linkSpace';\nexport * from './bundle';\n// Deprecated `Corpus*` spellings of the above (R3-482); see `src/corpus.ts`.\nexport * from './corpus';\nexport * from './components/MountImage';\nexport * from './components/Routes';\nexport * from './hooks';\n// R3-276: the supported way for a viewer app to provide its own metadata store,\n// replacing a wholesale re-provision of `TinkerableContext` in app code.\nexport * from './metadataSource';\n// The deprecated injected-bundler adapters, re-exported so their deprecation notices\n// are visible in the published docs (R3-278; the window only narrows).\nexport { getInjectedMetadataEmitter, getInjectedMetadataSnapshot } from './injectedBundler';\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './editor';\nexport * from './formFactor';\nexport * from './chromeState';\nexport * from './workspace';\nexport * from './hostAttention';\nexport * from './region';\nexport * from './mounts';\nexport * from './analytics';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './ipc';\nexport * from './dnd';\nexport * from './netFetch';\nexport * from './feed';\nexport * from './secrets';\nexport * from './recents'; // R3-485: the gated recent-projects read (page.home)\nexport * from './llm';\nexport * from './diagnostics';\nexport * from './vcs';\nexport * from './onFsChange';\nexport * from './fs';\nexport * from './debug';\nexport * from './tasks';\nexport * from './launch';\nexport * from './runtime';\nexport * from './irMarkers';\nexport * from './ready';\nexport * from './loading';\nexport * from './protocolStream';\nexport * from './protocolDeadline';\nexport * from './sandboxTypes';\nexport * from './safeContent';\n// R3-489 (GROVE_AGENT_SPEC): the embedded-agent seam every app shares — the tool-use\n// loop ported from agent-demo (`runAgent` over the host chat slot), the MDX metadata\n// query tool, the headings index collector, the deixis context block, and the fence\n// for corpus-derived bytes entering a loop.\nexport * from './agentLoop';\nexport * from './agentSteering';\nexport * from './agentChatClient';\nexport * from './metadataQueryTool';\nexport * from './collectHeadings';\nexport * from './agentContext';\nexport * from './fence';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,SAAS,mBAAmB;AAC5B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,SAAS,4BAA4B,mCAAmC;AACxE,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAKd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
package/dist/version.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
SDK_VERSION: () => SDK_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const SDK_VERSION = "0.
|
|
24
|
+
const SDK_VERSION = "0.58.0";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
SDK_VERSION
|
package/dist/version.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.58.0';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,cAAc;","names":[]}
|
package/dist/version.d.cts
CHANGED
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.58.0';\n"],"mappings":";AAIO,MAAM,cAAc;","names":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var workspace_exports = {};
|
|
20
|
+
__export(workspace_exports, {
|
|
21
|
+
getWorkspace: () => getWorkspace,
|
|
22
|
+
onWorkspaceChange: () => onWorkspaceChange,
|
|
23
|
+
useWorkspace: () => useWorkspace
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(workspace_exports);
|
|
26
|
+
var import_pushChannel = require("./pushChannel");
|
|
27
|
+
var import_protocol = require("./generated/protocol");
|
|
28
|
+
const DEFAULT_WORKSPACE = null;
|
|
29
|
+
const isWorkspace = (v) => {
|
|
30
|
+
const w = v;
|
|
31
|
+
return !!w && typeof w === "object" && typeof w.provider === "string" && typeof w.namespace === "string" && typeof w.repository === "string" && typeof w.ref === "string" && typeof w.label === "string";
|
|
32
|
+
};
|
|
33
|
+
const channel = (0, import_pushChannel.createPushChannel)({
|
|
34
|
+
pushType: import_protocol.WORKSPACE,
|
|
35
|
+
requestType: import_protocol.REQUEST_WORKSPACE,
|
|
36
|
+
initial: DEFAULT_WORKSPACE,
|
|
37
|
+
parse: (msg) => {
|
|
38
|
+
if (msg.workspace === null) return null;
|
|
39
|
+
if (!isWorkspace(msg.workspace)) return void 0;
|
|
40
|
+
const { provider, namespace, repository, ref, label } = msg.workspace;
|
|
41
|
+
return { provider, namespace, repository, ref, label };
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const getWorkspace = () => channel.get();
|
|
45
|
+
const onWorkspaceChange = (listener) => channel.onChange(listener);
|
|
46
|
+
const useWorkspace = () => channel.use();
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
getWorkspace,
|
|
50
|
+
onWorkspaceChange,
|
|
51
|
+
useWorkspace
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=workspace.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/workspace.ts"],"sourcesContent":["import { createPushChannel } from './pushChannel';\nimport { WORKSPACE, REQUEST_WORKSPACE } from './generated/protocol';\n\n/**\n * Which project the immediately.run workbench currently has open — the repository\n * the user is editing, not your app's own repository. `null` when your app is not\n * running inside an editing session at all (a standalone full-tab route, a task\n * overlay): that is a real answer, not a failure, and code here must handle it.\n *\n * ⚠ **`namespace` is not necessarily a GitHub owner.** A `local` session is\n * well-formed but not GitHub-shaped — `/edit/local/my-app-3fa9c2d1/my-app/live`\n * reads back as `{ provider: 'local', namespace: 'my-app-3fa9c2d1', repository:\n * 'my-app', ref: 'live' }`. Branch on `provider` before rendering a GitHub URL.\n *\n * Baseline capability `workspace:read` — every app may read it. It discloses\n * nothing that is not already in the session URL your app can read from\n * {@link onUrlChange} when it drives the host route; this channel exists for the\n * apps that *don't* — a self-routed panel keeps its own route, never receives\n * `urlchange`, and would otherwise have no way to learn which project it is in.\n *\n * There is deliberately no counterpart that lets an app *change* the workspace:\n * navigating the workbench stays a host action under the ordinary consent.\n *\n * ```ts\n * import { useWorkspace } from '@immediately-run/sdk';\n *\n * const workspace = useWorkspace();\n * // Scope your app's stored data to the project it belongs to.\n * const scope = workspace?.label ?? null;\n * ```\n */\nexport interface Workspace {\n /** Loader provider — `'github'`, `'local'`, … Branch on this, never assume. */\n provider: string;\n /** Owner/namespace segment. See the warning above: NOT always a GitHub owner. */\n namespace: string;\n /** Repository/project segment. */\n repository: string;\n /** The branch, tag, or ref-shaped segment of the session. */\n ref: string;\n /**\n * The session's display identity, `` `${namespace}/${repository}` `` — e.g.\n * `neumark-family/recipes`.\n *\n * This is the string to key durable per-project data on. It is the SAME value the\n * host labels the working-tree mount with, so an app that already scopes by that\n * mount's label needs no migration to move onto this channel.\n */\n label: string;\n}\n\n/**\n * Assumed before the host reports — and the value that stands forever on a host too\n * old to push this channel. `null` means \"no project here\", which is also the honest\n * answer outside an editing session, so an app written against it degrades to\n * unscoped rather than to wrong.\n */\nconst DEFAULT_WORKSPACE: Workspace | null = null;\n\nconst isWorkspace = (v: unknown): v is Workspace => {\n const w = v as Partial<Workspace> | null;\n return (\n !!w &&\n typeof w === 'object' &&\n typeof w.provider === 'string' &&\n typeof w.namespace === 'string' &&\n typeof w.repository === 'string' &&\n typeof w.ref === 'string' &&\n typeof w.label === 'string'\n );\n};\n\n// Read over the transport (SDK_PACKAGING_SPEC §4): the host pushes `workspace` and\n// answers `request-workspace` (wire format: site-main channelBridge.ts).\n//\n// `parse` must distinguish the host SAYING `null` from a message it cannot read.\n// `undefined` means \"not a value for this channel\" (createPushChannel ignores it and\n// keeps the last known workspace), while `null` is the host reporting \"no session\"\n// and MUST land — otherwise a frame that navigates out of a session would keep\n// reporting the project it used to be in.\n//\n// It REBUILDS the value field by field rather than passing the host's object through.\n// This channel is baseline-readable by every app, so \"it carries only the session's\n// coordinates\" has to be a property of this code, not of the host's good manners: a\n// host that pushed a token or a user id alongside them would otherwise get it into\n// app-visible memory by reference.\nconst channel = createPushChannel<Workspace | null>({\n pushType: WORKSPACE,\n requestType: REQUEST_WORKSPACE,\n initial: DEFAULT_WORKSPACE,\n parse: (msg) => {\n if (msg.workspace === null) return null;\n if (!isWorkspace(msg.workspace)) return undefined;\n const { provider, namespace, repository, ref, label } = msg.workspace;\n return { provider, namespace, repository, ref, label };\n },\n});\n\n/** Returns the current workspace, or `null` outside an editing session. */\nexport const getWorkspace = (): Workspace | null => channel.get();\n\n/**\n * Subscribe to workspace changes. The listener is invoked immediately with the\n * current value, then again on every change. Returns an unsubscribe fn.\n */\nexport const onWorkspaceChange = (listener: (workspace: Workspace | null) => void): (() => void) =>\n channel.onChange(listener);\n\n/** React hook returning the current workspace, re-rendering on change. */\nexport const useWorkspace = (): Workspace | null => channel.use();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAkC;AAClC,sBAA6C;AAwD7C,MAAM,oBAAsC;AAE5C,MAAM,cAAc,CAAC,MAA+B;AAClD,QAAM,IAAI;AACV,SACE,CAAC,CAAC,KACF,OAAO,MAAM,YACb,OAAO,EAAE,aAAa,YACtB,OAAO,EAAE,cAAc,YACvB,OAAO,EAAE,eAAe,YACxB,OAAO,EAAE,QAAQ,YACjB,OAAO,EAAE,UAAU;AAEvB;AAgBA,MAAM,cAAU,sCAAoC;AAAA,EAClD,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS;AAAA,EACT,OAAO,CAAC,QAAQ;AACd,QAAI,IAAI,cAAc,KAAM,QAAO;AACnC,QAAI,CAAC,YAAY,IAAI,SAAS,EAAG,QAAO;AACxC,UAAM,EAAE,UAAU,WAAW,YAAY,KAAK,MAAM,IAAI,IAAI;AAC5D,WAAO,EAAE,UAAU,WAAW,YAAY,KAAK,MAAM;AAAA,EACvD;AACF,CAAC;AAGM,MAAM,eAAe,MAAwB,QAAQ,IAAI;AAMzD,MAAM,oBAAoB,CAAC,aAChC,QAAQ,SAAS,QAAQ;AAGpB,MAAM,eAAe,MAAwB,QAAQ,IAAI;","names":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which project the immediately.run workbench currently has open — the repository
|
|
3
|
+
* the user is editing, not your app's own repository. `null` when your app is not
|
|
4
|
+
* running inside an editing session at all (a standalone full-tab route, a task
|
|
5
|
+
* overlay): that is a real answer, not a failure, and code here must handle it.
|
|
6
|
+
*
|
|
7
|
+
* ⚠ **`namespace` is not necessarily a GitHub owner.** A `local` session is
|
|
8
|
+
* well-formed but not GitHub-shaped — `/edit/local/my-app-3fa9c2d1/my-app/live`
|
|
9
|
+
* reads back as `{ provider: 'local', namespace: 'my-app-3fa9c2d1', repository:
|
|
10
|
+
* 'my-app', ref: 'live' }`. Branch on `provider` before rendering a GitHub URL.
|
|
11
|
+
*
|
|
12
|
+
* Baseline capability `workspace:read` — every app may read it. It discloses
|
|
13
|
+
* nothing that is not already in the session URL your app can read from
|
|
14
|
+
* {@link onUrlChange} when it drives the host route; this channel exists for the
|
|
15
|
+
* apps that *don't* — a self-routed panel keeps its own route, never receives
|
|
16
|
+
* `urlchange`, and would otherwise have no way to learn which project it is in.
|
|
17
|
+
*
|
|
18
|
+
* There is deliberately no counterpart that lets an app *change* the workspace:
|
|
19
|
+
* navigating the workbench stays a host action under the ordinary consent.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { useWorkspace } from '@immediately-run/sdk';
|
|
23
|
+
*
|
|
24
|
+
* const workspace = useWorkspace();
|
|
25
|
+
* // Scope your app's stored data to the project it belongs to.
|
|
26
|
+
* const scope = workspace?.label ?? null;
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
interface Workspace {
|
|
30
|
+
/** Loader provider — `'github'`, `'local'`, … Branch on this, never assume. */
|
|
31
|
+
provider: string;
|
|
32
|
+
/** Owner/namespace segment. See the warning above: NOT always a GitHub owner. */
|
|
33
|
+
namespace: string;
|
|
34
|
+
/** Repository/project segment. */
|
|
35
|
+
repository: string;
|
|
36
|
+
/** The branch, tag, or ref-shaped segment of the session. */
|
|
37
|
+
ref: string;
|
|
38
|
+
/**
|
|
39
|
+
* The session's display identity, `` `${namespace}/${repository}` `` — e.g.
|
|
40
|
+
* `neumark-family/recipes`.
|
|
41
|
+
*
|
|
42
|
+
* This is the string to key durable per-project data on. It is the SAME value the
|
|
43
|
+
* host labels the working-tree mount with, so an app that already scopes by that
|
|
44
|
+
* mount's label needs no migration to move onto this channel.
|
|
45
|
+
*/
|
|
46
|
+
label: string;
|
|
47
|
+
}
|
|
48
|
+
/** Returns the current workspace, or `null` outside an editing session. */
|
|
49
|
+
declare const getWorkspace: () => Workspace | null;
|
|
50
|
+
/**
|
|
51
|
+
* Subscribe to workspace changes. The listener is invoked immediately with the
|
|
52
|
+
* current value, then again on every change. Returns an unsubscribe fn.
|
|
53
|
+
*/
|
|
54
|
+
declare const onWorkspaceChange: (listener: (workspace: Workspace | null) => void) => (() => void);
|
|
55
|
+
/** React hook returning the current workspace, re-rendering on change. */
|
|
56
|
+
declare const useWorkspace: () => Workspace | null;
|
|
57
|
+
|
|
58
|
+
export { type Workspace, getWorkspace, onWorkspaceChange, useWorkspace };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which project the immediately.run workbench currently has open — the repository
|
|
3
|
+
* the user is editing, not your app's own repository. `null` when your app is not
|
|
4
|
+
* running inside an editing session at all (a standalone full-tab route, a task
|
|
5
|
+
* overlay): that is a real answer, not a failure, and code here must handle it.
|
|
6
|
+
*
|
|
7
|
+
* ⚠ **`namespace` is not necessarily a GitHub owner.** A `local` session is
|
|
8
|
+
* well-formed but not GitHub-shaped — `/edit/local/my-app-3fa9c2d1/my-app/live`
|
|
9
|
+
* reads back as `{ provider: 'local', namespace: 'my-app-3fa9c2d1', repository:
|
|
10
|
+
* 'my-app', ref: 'live' }`. Branch on `provider` before rendering a GitHub URL.
|
|
11
|
+
*
|
|
12
|
+
* Baseline capability `workspace:read` — every app may read it. It discloses
|
|
13
|
+
* nothing that is not already in the session URL your app can read from
|
|
14
|
+
* {@link onUrlChange} when it drives the host route; this channel exists for the
|
|
15
|
+
* apps that *don't* — a self-routed panel keeps its own route, never receives
|
|
16
|
+
* `urlchange`, and would otherwise have no way to learn which project it is in.
|
|
17
|
+
*
|
|
18
|
+
* There is deliberately no counterpart that lets an app *change* the workspace:
|
|
19
|
+
* navigating the workbench stays a host action under the ordinary consent.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { useWorkspace } from '@immediately-run/sdk';
|
|
23
|
+
*
|
|
24
|
+
* const workspace = useWorkspace();
|
|
25
|
+
* // Scope your app's stored data to the project it belongs to.
|
|
26
|
+
* const scope = workspace?.label ?? null;
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
interface Workspace {
|
|
30
|
+
/** Loader provider — `'github'`, `'local'`, … Branch on this, never assume. */
|
|
31
|
+
provider: string;
|
|
32
|
+
/** Owner/namespace segment. See the warning above: NOT always a GitHub owner. */
|
|
33
|
+
namespace: string;
|
|
34
|
+
/** Repository/project segment. */
|
|
35
|
+
repository: string;
|
|
36
|
+
/** The branch, tag, or ref-shaped segment of the session. */
|
|
37
|
+
ref: string;
|
|
38
|
+
/**
|
|
39
|
+
* The session's display identity, `` `${namespace}/${repository}` `` — e.g.
|
|
40
|
+
* `neumark-family/recipes`.
|
|
41
|
+
*
|
|
42
|
+
* This is the string to key durable per-project data on. It is the SAME value the
|
|
43
|
+
* host labels the working-tree mount with, so an app that already scopes by that
|
|
44
|
+
* mount's label needs no migration to move onto this channel.
|
|
45
|
+
*/
|
|
46
|
+
label: string;
|
|
47
|
+
}
|
|
48
|
+
/** Returns the current workspace, or `null` outside an editing session. */
|
|
49
|
+
declare const getWorkspace: () => Workspace | null;
|
|
50
|
+
/**
|
|
51
|
+
* Subscribe to workspace changes. The listener is invoked immediately with the
|
|
52
|
+
* current value, then again on every change. Returns an unsubscribe fn.
|
|
53
|
+
*/
|
|
54
|
+
declare const onWorkspaceChange: (listener: (workspace: Workspace | null) => void) => (() => void);
|
|
55
|
+
/** React hook returning the current workspace, re-rendering on change. */
|
|
56
|
+
declare const useWorkspace: () => Workspace | null;
|
|
57
|
+
|
|
58
|
+
export { type Workspace, getWorkspace, onWorkspaceChange, useWorkspace };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./chunk-VHAA22YE.js";
|
|
2
|
+
import { createPushChannel } from "./pushChannel";
|
|
3
|
+
import { WORKSPACE, REQUEST_WORKSPACE } from "./generated/protocol";
|
|
4
|
+
const DEFAULT_WORKSPACE = null;
|
|
5
|
+
const isWorkspace = (v) => {
|
|
6
|
+
const w = v;
|
|
7
|
+
return !!w && typeof w === "object" && typeof w.provider === "string" && typeof w.namespace === "string" && typeof w.repository === "string" && typeof w.ref === "string" && typeof w.label === "string";
|
|
8
|
+
};
|
|
9
|
+
const channel = createPushChannel({
|
|
10
|
+
pushType: WORKSPACE,
|
|
11
|
+
requestType: REQUEST_WORKSPACE,
|
|
12
|
+
initial: DEFAULT_WORKSPACE,
|
|
13
|
+
parse: (msg) => {
|
|
14
|
+
if (msg.workspace === null) return null;
|
|
15
|
+
if (!isWorkspace(msg.workspace)) return void 0;
|
|
16
|
+
const { provider, namespace, repository, ref, label } = msg.workspace;
|
|
17
|
+
return { provider, namespace, repository, ref, label };
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const getWorkspace = () => channel.get();
|
|
21
|
+
const onWorkspaceChange = (listener) => channel.onChange(listener);
|
|
22
|
+
const useWorkspace = () => channel.use();
|
|
23
|
+
export {
|
|
24
|
+
getWorkspace,
|
|
25
|
+
onWorkspaceChange,
|
|
26
|
+
useWorkspace
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/workspace.ts"],"sourcesContent":["import { createPushChannel } from './pushChannel';\nimport { WORKSPACE, REQUEST_WORKSPACE } from './generated/protocol';\n\n/**\n * Which project the immediately.run workbench currently has open — the repository\n * the user is editing, not your app's own repository. `null` when your app is not\n * running inside an editing session at all (a standalone full-tab route, a task\n * overlay): that is a real answer, not a failure, and code here must handle it.\n *\n * ⚠ **`namespace` is not necessarily a GitHub owner.** A `local` session is\n * well-formed but not GitHub-shaped — `/edit/local/my-app-3fa9c2d1/my-app/live`\n * reads back as `{ provider: 'local', namespace: 'my-app-3fa9c2d1', repository:\n * 'my-app', ref: 'live' }`. Branch on `provider` before rendering a GitHub URL.\n *\n * Baseline capability `workspace:read` — every app may read it. It discloses\n * nothing that is not already in the session URL your app can read from\n * {@link onUrlChange} when it drives the host route; this channel exists for the\n * apps that *don't* — a self-routed panel keeps its own route, never receives\n * `urlchange`, and would otherwise have no way to learn which project it is in.\n *\n * There is deliberately no counterpart that lets an app *change* the workspace:\n * navigating the workbench stays a host action under the ordinary consent.\n *\n * ```ts\n * import { useWorkspace } from '@immediately-run/sdk';\n *\n * const workspace = useWorkspace();\n * // Scope your app's stored data to the project it belongs to.\n * const scope = workspace?.label ?? null;\n * ```\n */\nexport interface Workspace {\n /** Loader provider — `'github'`, `'local'`, … Branch on this, never assume. */\n provider: string;\n /** Owner/namespace segment. See the warning above: NOT always a GitHub owner. */\n namespace: string;\n /** Repository/project segment. */\n repository: string;\n /** The branch, tag, or ref-shaped segment of the session. */\n ref: string;\n /**\n * The session's display identity, `` `${namespace}/${repository}` `` — e.g.\n * `neumark-family/recipes`.\n *\n * This is the string to key durable per-project data on. It is the SAME value the\n * host labels the working-tree mount with, so an app that already scopes by that\n * mount's label needs no migration to move onto this channel.\n */\n label: string;\n}\n\n/**\n * Assumed before the host reports — and the value that stands forever on a host too\n * old to push this channel. `null` means \"no project here\", which is also the honest\n * answer outside an editing session, so an app written against it degrades to\n * unscoped rather than to wrong.\n */\nconst DEFAULT_WORKSPACE: Workspace | null = null;\n\nconst isWorkspace = (v: unknown): v is Workspace => {\n const w = v as Partial<Workspace> | null;\n return (\n !!w &&\n typeof w === 'object' &&\n typeof w.provider === 'string' &&\n typeof w.namespace === 'string' &&\n typeof w.repository === 'string' &&\n typeof w.ref === 'string' &&\n typeof w.label === 'string'\n );\n};\n\n// Read over the transport (SDK_PACKAGING_SPEC §4): the host pushes `workspace` and\n// answers `request-workspace` (wire format: site-main channelBridge.ts).\n//\n// `parse` must distinguish the host SAYING `null` from a message it cannot read.\n// `undefined` means \"not a value for this channel\" (createPushChannel ignores it and\n// keeps the last known workspace), while `null` is the host reporting \"no session\"\n// and MUST land — otherwise a frame that navigates out of a session would keep\n// reporting the project it used to be in.\n//\n// It REBUILDS the value field by field rather than passing the host's object through.\n// This channel is baseline-readable by every app, so \"it carries only the session's\n// coordinates\" has to be a property of this code, not of the host's good manners: a\n// host that pushed a token or a user id alongside them would otherwise get it into\n// app-visible memory by reference.\nconst channel = createPushChannel<Workspace | null>({\n pushType: WORKSPACE,\n requestType: REQUEST_WORKSPACE,\n initial: DEFAULT_WORKSPACE,\n parse: (msg) => {\n if (msg.workspace === null) return null;\n if (!isWorkspace(msg.workspace)) return undefined;\n const { provider, namespace, repository, ref, label } = msg.workspace;\n return { provider, namespace, repository, ref, label };\n },\n});\n\n/** Returns the current workspace, or `null` outside an editing session. */\nexport const getWorkspace = (): Workspace | null => channel.get();\n\n/**\n * Subscribe to workspace changes. The listener is invoked immediately with the\n * current value, then again on every change. Returns an unsubscribe fn.\n */\nexport const onWorkspaceChange = (listener: (workspace: Workspace | null) => void): (() => void) =>\n channel.onChange(listener);\n\n/** React hook returning the current workspace, re-rendering on change. */\nexport const useWorkspace = (): Workspace | null => channel.use();\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,WAAW,yBAAyB;AAwD7C,MAAM,oBAAsC;AAE5C,MAAM,cAAc,CAAC,MAA+B;AAClD,QAAM,IAAI;AACV,SACE,CAAC,CAAC,KACF,OAAO,MAAM,YACb,OAAO,EAAE,aAAa,YACtB,OAAO,EAAE,cAAc,YACvB,OAAO,EAAE,eAAe,YACxB,OAAO,EAAE,QAAQ,YACjB,OAAO,EAAE,UAAU;AAEvB;AAgBA,MAAM,UAAU,kBAAoC;AAAA,EAClD,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS;AAAA,EACT,OAAO,CAAC,QAAQ;AACd,QAAI,IAAI,cAAc,KAAM,QAAO;AACnC,QAAI,CAAC,YAAY,IAAI,SAAS,EAAG,QAAO;AACxC,UAAM,EAAE,UAAU,WAAW,YAAY,KAAK,MAAM,IAAI,IAAI;AAC5D,WAAO,EAAE,UAAU,WAAW,YAAY,KAAK,MAAM;AAAA,EACvD;AACF,CAAC;AAGM,MAAM,eAAe,MAAwB,QAAQ,IAAI;AAMzD,MAAM,oBAAoB,CAAC,aAChC,QAAQ,SAAS,QAAQ;AAGpB,MAAM,eAAe,MAAwB,QAAQ,IAAI;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@immediately-run/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"description": "Runtime SDK for code executing inside an immediately.run sandbox.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "github:immediately-run/immediately-run-sdk",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@immediately-run/mdx-plugins": "0.5.0",
|
|
65
65
|
"@immediately-run/platform-constants": "0.2.0",
|
|
66
66
|
"@immediately-run/safe-content": "0.1.0",
|
|
67
|
-
"@immediately-run/sandbox-protocol": "0.7.
|
|
67
|
+
"@immediately-run/sandbox-protocol": "0.7.7",
|
|
68
68
|
"react-error-boundary": "^6.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|