@immediately-run/sdk 0.2.2 → 0.2.3

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.
@@ -0,0 +1,77 @@
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 catalog_exports = {};
20
+ __export(catalog_exports, {
21
+ getCatalog: () => getCatalog,
22
+ invoke: () => invoke,
23
+ invokeStream: () => invokeStream,
24
+ onCatalogChange: () => onCatalogChange,
25
+ useCatalog: () => useCatalog
26
+ });
27
+ module.exports = __toCommonJS(catalog_exports);
28
+ var import_react = require("react");
29
+ var import_sandboxUtils = require("./sandboxUtils");
30
+ var import_protocolStream = require("./protocolStream");
31
+ const split = (name) => {
32
+ const i = name.indexOf(":");
33
+ if (i <= 0) throw new Error(`invalid catalog method name: ${name}`);
34
+ return [name.slice(0, i), name.slice(i + 1)];
35
+ };
36
+ const invoke = (name, params = {}) => {
37
+ const [scheme, method] = split(name);
38
+ return (0, import_sandboxUtils.protocolRequest)(scheme, method, [params]);
39
+ };
40
+ const bundlerTransport = {
41
+ send: (msg) => (
42
+ // @ts-ignore - injected by the sandbox runtime
43
+ module.evaluation.module.bundler.messageBus.sendMessage(msg.type, msg)
44
+ ),
45
+ subscribe: (type, handler) => {
46
+ const d = module.evaluation.module.bundler.messageBus.onMessage((m) => {
47
+ if (m && m.type === type) handler(m);
48
+ });
49
+ return () => d.dispose();
50
+ }
51
+ };
52
+ function invokeStream(name, params = {}) {
53
+ const [scheme, method] = split(name);
54
+ return (0, import_protocolStream.consumeStream)(bundlerTransport, `protocol-${scheme}`, method, [params]);
55
+ }
56
+ const catalogService = () => {
57
+ return module.evaluation.module.bundler.catalog;
58
+ };
59
+ const getCatalog = () => catalogService().getCatalog();
60
+ const onCatalogChange = (listener) => {
61
+ const disposable = catalogService().onChange(listener);
62
+ return () => disposable.dispose();
63
+ };
64
+ const useCatalog = () => {
65
+ const [catalog, setCatalog] = (0, import_react.useState)(getCatalog);
66
+ (0, import_react.useEffect)(() => onCatalogChange(setCatalog), []);
67
+ return catalog;
68
+ };
69
+ // Annotate the CommonJS export names for ESM import in node:
70
+ 0 && (module.exports = {
71
+ getCatalog,
72
+ invoke,
73
+ invokeStream,
74
+ onCatalogChange,
75
+ useCatalog
76
+ });
77
+ //# sourceMappingURL=catalog.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/catalog.ts"],"sourcesContent":["// The method catalog (UI_AS_APPS_SPEC §5.5) — the app's own grant-filtered RPC\n// surface, and a generic way to call it. The host advertises exactly the methods\n// this app may invoke (MCP-tool-shaped); `invoke()` calls one by its catalog name.\n// Handing the catalog to an embedded agent as its tool list confines the agent to\n// the app's authority (agent sandboxing falls out of the capability model, §5.9).\nimport { useEffect, useState } from 'react';\nimport { protocolRequest } from './sandboxUtils';\nimport type { StreamFrame } from './protocolStream';\nimport { consumeStream } from './protocolStream';\n\n/** One advertised method, as the host generated it from its gate table. */\nexport interface ApiMethod {\n /** Catalog name, `protocol-` stripped — e.g. `spaces:share`, `contribute:run`. */\n name: string;\n /** The capability this method requires (already held — it's in your catalog). */\n capability: string;\n /** True when the method STREAMS (use {@link invokeStream}) vs. single-reply. */\n stream?: boolean;\n}\n\n// `scheme:method` → ['scheme', 'method'] (the wire protocol is `protocol-scheme`).\nconst split = (name: string): [string, string] => {\n const i = name.indexOf(':');\n if (i <= 0) throw new Error(`invalid catalog method name: ${name}`);\n return [name.slice(0, i), name.slice(i + 1)];\n};\n\n/**\n * Call a catalog method by name — `invoke('spaces:share', { spaceId, login, role })`.\n * A thin generic over the host protocol: the host validates params and gates the\n * call (an un-granted method → `forbidden`, even if you name it directly). For a\n * STREAMING method (`ApiMethod.stream`), use {@link invokeStream}.\n */\nexport const invoke = <T = unknown>(name: string, params: Record<string, unknown> = {}): Promise<T> => {\n const [scheme, method] = split(name);\n return protocolRequest(scheme, method, [params]) as Promise<T>;\n};\n\nconst bundlerTransport = {\n send: (msg: { type: string; method: string; params: unknown[]; msgId: number; stream: true }) =>\n // @ts-ignore - injected by the sandbox runtime\n module.evaluation.module.bundler.messageBus.sendMessage(msg.type, msg),\n subscribe: (type: string, handler: (msg: { msgId?: number; stream?: StreamFrame }) => void) => {\n // @ts-ignore - injected by the sandbox runtime\n const d = module.evaluation.module.bundler.messageBus.onMessage((m: { type?: string }) => {\n if (m && m.type === type) handler(m as { msgId?: number; stream?: StreamFrame });\n });\n return () => d.dispose();\n },\n};\n\n/** Call a STREAMING catalog method by name, yielding its events. */\nexport function invokeStream<T = unknown, R = unknown>(\n name: string,\n params: Record<string, unknown> = {},\n): AsyncGenerator<T, R, void> {\n const [scheme, method] = split(name);\n return consumeStream<T, R>(bundlerTransport, `protocol-${scheme}`, method, [params]);\n}\n\ninterface CatalogService {\n getCatalog(): ApiMethod[];\n onChange(listener: (catalog: ApiMethod[]) => void): { dispose(): void };\n}\n\n// `module.evaluation.module.bundler.catalog` — injected by the sandbox runtime.\nconst catalogService = (): CatalogService => {\n // @ts-ignore - injected by the sandbox runtime\n return module.evaluation.module.bundler.catalog;\n};\n\n/** The methods this app may call (grant-filtered, §5.5). Poll for a one-off read;\n * use {@link onCatalogChange} / {@link useCatalog} to react. */\nexport const getCatalog = (): ApiMethod[] => catalogService().getCatalog();\n\n/** Subscribe to catalog changes (e.g. a grant added/revoked). Invoked immediately\n * with the current catalog, then on every change. Returns an unsubscribe fn. */\nexport const onCatalogChange = (listener: (catalog: ApiMethod[]) => void): (() => void) => {\n const disposable = catalogService().onChange(listener);\n return () => disposable.dispose();\n};\n\n/** React hook returning this app's method catalog, re-rendering on change. Hand\n * it to an embedded agent as its tool list to confine the agent to the app's\n * authority (§5.9). */\nexport const useCatalog = (): ApiMethod[] => {\n const [catalog, setCatalog] = useState<ApiMethod[]>(getCatalog);\n useEffect(() => onCatalogChange(setCatalog), []);\n return catalog;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,mBAAoC;AACpC,0BAAgC;AAEhC,4BAA8B;AAa9B,MAAM,QAAQ,CAAC,SAAmC;AAChD,QAAM,IAAI,KAAK,QAAQ,GAAG;AAC1B,MAAI,KAAK,EAAG,OAAM,IAAI,MAAM,gCAAgC,IAAI,EAAE;AAClE,SAAO,CAAC,KAAK,MAAM,GAAG,CAAC,GAAG,KAAK,MAAM,IAAI,CAAC,CAAC;AAC7C;AAQO,MAAM,SAAS,CAAc,MAAc,SAAkC,CAAC,MAAkB;AACrG,QAAM,CAAC,QAAQ,MAAM,IAAI,MAAM,IAAI;AACnC,aAAO,qCAAgB,QAAQ,QAAQ,CAAC,MAAM,CAAC;AACjD;AAEA,MAAM,mBAAmB;AAAA,EACvB,MAAM,CAAC;AAAA;AAAA,IAEL,OAAO,WAAW,OAAO,QAAQ,WAAW,YAAY,IAAI,MAAM,GAAG;AAAA;AAAA,EACvE,WAAW,CAAC,MAAc,YAAqE;AAE7F,UAAM,IAAI,OAAO,WAAW,OAAO,QAAQ,WAAW,UAAU,CAAC,MAAyB;AACxF,UAAI,KAAK,EAAE,SAAS,KAAM,SAAQ,CAA6C;AAAA,IACjF,CAAC;AACD,WAAO,MAAM,EAAE,QAAQ;AAAA,EACzB;AACF;AAGO,SAAS,aACd,MACA,SAAkC,CAAC,GACP;AAC5B,QAAM,CAAC,QAAQ,MAAM,IAAI,MAAM,IAAI;AACnC,aAAO,qCAAoB,kBAAkB,YAAY,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC;AACrF;AAQA,MAAM,iBAAiB,MAAsB;AAE3C,SAAO,OAAO,WAAW,OAAO,QAAQ;AAC1C;AAIO,MAAM,aAAa,MAAmB,eAAe,EAAE,WAAW;AAIlE,MAAM,kBAAkB,CAAC,aAA2D;AACzF,QAAM,aAAa,eAAe,EAAE,SAAS,QAAQ;AACrD,SAAO,MAAM,WAAW,QAAQ;AAClC;AAKO,MAAM,aAAa,MAAmB;AAC3C,QAAM,CAAC,SAAS,UAAU,QAAI,uBAAsB,UAAU;AAC9D,8BAAU,MAAM,gBAAgB,UAAU,GAAG,CAAC,CAAC;AAC/C,SAAO;AACT;","names":[]}
@@ -0,0 +1,30 @@
1
+ /** One advertised method, as the host generated it from its gate table. */
2
+ interface ApiMethod {
3
+ /** Catalog name, `protocol-` stripped — e.g. `spaces:share`, `contribute:run`. */
4
+ name: string;
5
+ /** The capability this method requires (already held — it's in your catalog). */
6
+ capability: string;
7
+ /** True when the method STREAMS (use {@link invokeStream}) vs. single-reply. */
8
+ stream?: boolean;
9
+ }
10
+ /**
11
+ * Call a catalog method by name — `invoke('spaces:share', { spaceId, login, role })`.
12
+ * A thin generic over the host protocol: the host validates params and gates the
13
+ * call (an un-granted method → `forbidden`, even if you name it directly). For a
14
+ * STREAMING method (`ApiMethod.stream`), use {@link invokeStream}.
15
+ */
16
+ declare const invoke: <T = unknown>(name: string, params?: Record<string, unknown>) => Promise<T>;
17
+ /** Call a STREAMING catalog method by name, yielding its events. */
18
+ declare function invokeStream<T = unknown, R = unknown>(name: string, params?: Record<string, unknown>): AsyncGenerator<T, R, void>;
19
+ /** The methods this app may call (grant-filtered, §5.5). Poll for a one-off read;
20
+ * use {@link onCatalogChange} / {@link useCatalog} to react. */
21
+ declare const getCatalog: () => ApiMethod[];
22
+ /** Subscribe to catalog changes (e.g. a grant added/revoked). Invoked immediately
23
+ * with the current catalog, then on every change. Returns an unsubscribe fn. */
24
+ declare const onCatalogChange: (listener: (catalog: ApiMethod[]) => void) => (() => void);
25
+ /** React hook returning this app's method catalog, re-rendering on change. Hand
26
+ * it to an embedded agent as its tool list to confine the agent to the app's
27
+ * authority (§5.9). */
28
+ declare const useCatalog: () => ApiMethod[];
29
+
30
+ export { type ApiMethod, getCatalog, invoke, invokeStream, onCatalogChange, useCatalog };
@@ -0,0 +1,30 @@
1
+ /** One advertised method, as the host generated it from its gate table. */
2
+ interface ApiMethod {
3
+ /** Catalog name, `protocol-` stripped — e.g. `spaces:share`, `contribute:run`. */
4
+ name: string;
5
+ /** The capability this method requires (already held — it's in your catalog). */
6
+ capability: string;
7
+ /** True when the method STREAMS (use {@link invokeStream}) vs. single-reply. */
8
+ stream?: boolean;
9
+ }
10
+ /**
11
+ * Call a catalog method by name — `invoke('spaces:share', { spaceId, login, role })`.
12
+ * A thin generic over the host protocol: the host validates params and gates the
13
+ * call (an un-granted method → `forbidden`, even if you name it directly). For a
14
+ * STREAMING method (`ApiMethod.stream`), use {@link invokeStream}.
15
+ */
16
+ declare const invoke: <T = unknown>(name: string, params?: Record<string, unknown>) => Promise<T>;
17
+ /** Call a STREAMING catalog method by name, yielding its events. */
18
+ declare function invokeStream<T = unknown, R = unknown>(name: string, params?: Record<string, unknown>): AsyncGenerator<T, R, void>;
19
+ /** The methods this app may call (grant-filtered, §5.5). Poll for a one-off read;
20
+ * use {@link onCatalogChange} / {@link useCatalog} to react. */
21
+ declare const getCatalog: () => ApiMethod[];
22
+ /** Subscribe to catalog changes (e.g. a grant added/revoked). Invoked immediately
23
+ * with the current catalog, then on every change. Returns an unsubscribe fn. */
24
+ declare const onCatalogChange: (listener: (catalog: ApiMethod[]) => void) => (() => void);
25
+ /** React hook returning this app's method catalog, re-rendering on change. Hand
26
+ * it to an embedded agent as its tool list to confine the agent to the app's
27
+ * authority (§5.9). */
28
+ declare const useCatalog: () => ApiMethod[];
29
+
30
+ export { type ApiMethod, getCatalog, invoke, invokeStream, onCatalogChange, useCatalog };
@@ -0,0 +1,49 @@
1
+ import { useEffect, useState } from "react";
2
+ import { protocolRequest } from "./sandboxUtils";
3
+ import { consumeStream } from "./protocolStream";
4
+ const split = (name) => {
5
+ const i = name.indexOf(":");
6
+ if (i <= 0) throw new Error(`invalid catalog method name: ${name}`);
7
+ return [name.slice(0, i), name.slice(i + 1)];
8
+ };
9
+ const invoke = (name, params = {}) => {
10
+ const [scheme, method] = split(name);
11
+ return protocolRequest(scheme, method, [params]);
12
+ };
13
+ const bundlerTransport = {
14
+ send: (msg) => (
15
+ // @ts-ignore - injected by the sandbox runtime
16
+ module.evaluation.module.bundler.messageBus.sendMessage(msg.type, msg)
17
+ ),
18
+ subscribe: (type, handler) => {
19
+ const d = module.evaluation.module.bundler.messageBus.onMessage((m) => {
20
+ if (m && m.type === type) handler(m);
21
+ });
22
+ return () => d.dispose();
23
+ }
24
+ };
25
+ function invokeStream(name, params = {}) {
26
+ const [scheme, method] = split(name);
27
+ return consumeStream(bundlerTransport, `protocol-${scheme}`, method, [params]);
28
+ }
29
+ const catalogService = () => {
30
+ return module.evaluation.module.bundler.catalog;
31
+ };
32
+ const getCatalog = () => catalogService().getCatalog();
33
+ const onCatalogChange = (listener) => {
34
+ const disposable = catalogService().onChange(listener);
35
+ return () => disposable.dispose();
36
+ };
37
+ const useCatalog = () => {
38
+ const [catalog, setCatalog] = useState(getCatalog);
39
+ useEffect(() => onCatalogChange(setCatalog), []);
40
+ return catalog;
41
+ };
42
+ export {
43
+ getCatalog,
44
+ invoke,
45
+ invokeStream,
46
+ onCatalogChange,
47
+ useCatalog
48
+ };
49
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/catalog.ts"],"sourcesContent":["// The method catalog (UI_AS_APPS_SPEC §5.5) — the app's own grant-filtered RPC\n// surface, and a generic way to call it. The host advertises exactly the methods\n// this app may invoke (MCP-tool-shaped); `invoke()` calls one by its catalog name.\n// Handing the catalog to an embedded agent as its tool list confines the agent to\n// the app's authority (agent sandboxing falls out of the capability model, §5.9).\nimport { useEffect, useState } from 'react';\nimport { protocolRequest } from './sandboxUtils';\nimport type { StreamFrame } from './protocolStream';\nimport { consumeStream } from './protocolStream';\n\n/** One advertised method, as the host generated it from its gate table. */\nexport interface ApiMethod {\n /** Catalog name, `protocol-` stripped — e.g. `spaces:share`, `contribute:run`. */\n name: string;\n /** The capability this method requires (already held — it's in your catalog). */\n capability: string;\n /** True when the method STREAMS (use {@link invokeStream}) vs. single-reply. */\n stream?: boolean;\n}\n\n// `scheme:method` → ['scheme', 'method'] (the wire protocol is `protocol-scheme`).\nconst split = (name: string): [string, string] => {\n const i = name.indexOf(':');\n if (i <= 0) throw new Error(`invalid catalog method name: ${name}`);\n return [name.slice(0, i), name.slice(i + 1)];\n};\n\n/**\n * Call a catalog method by name — `invoke('spaces:share', { spaceId, login, role })`.\n * A thin generic over the host protocol: the host validates params and gates the\n * call (an un-granted method → `forbidden`, even if you name it directly). For a\n * STREAMING method (`ApiMethod.stream`), use {@link invokeStream}.\n */\nexport const invoke = <T = unknown>(name: string, params: Record<string, unknown> = {}): Promise<T> => {\n const [scheme, method] = split(name);\n return protocolRequest(scheme, method, [params]) as Promise<T>;\n};\n\nconst bundlerTransport = {\n send: (msg: { type: string; method: string; params: unknown[]; msgId: number; stream: true }) =>\n // @ts-ignore - injected by the sandbox runtime\n module.evaluation.module.bundler.messageBus.sendMessage(msg.type, msg),\n subscribe: (type: string, handler: (msg: { msgId?: number; stream?: StreamFrame }) => void) => {\n // @ts-ignore - injected by the sandbox runtime\n const d = module.evaluation.module.bundler.messageBus.onMessage((m: { type?: string }) => {\n if (m && m.type === type) handler(m as { msgId?: number; stream?: StreamFrame });\n });\n return () => d.dispose();\n },\n};\n\n/** Call a STREAMING catalog method by name, yielding its events. */\nexport function invokeStream<T = unknown, R = unknown>(\n name: string,\n params: Record<string, unknown> = {},\n): AsyncGenerator<T, R, void> {\n const [scheme, method] = split(name);\n return consumeStream<T, R>(bundlerTransport, `protocol-${scheme}`, method, [params]);\n}\n\ninterface CatalogService {\n getCatalog(): ApiMethod[];\n onChange(listener: (catalog: ApiMethod[]) => void): { dispose(): void };\n}\n\n// `module.evaluation.module.bundler.catalog` — injected by the sandbox runtime.\nconst catalogService = (): CatalogService => {\n // @ts-ignore - injected by the sandbox runtime\n return module.evaluation.module.bundler.catalog;\n};\n\n/** The methods this app may call (grant-filtered, §5.5). Poll for a one-off read;\n * use {@link onCatalogChange} / {@link useCatalog} to react. */\nexport const getCatalog = (): ApiMethod[] => catalogService().getCatalog();\n\n/** Subscribe to catalog changes (e.g. a grant added/revoked). Invoked immediately\n * with the current catalog, then on every change. Returns an unsubscribe fn. */\nexport const onCatalogChange = (listener: (catalog: ApiMethod[]) => void): (() => void) => {\n const disposable = catalogService().onChange(listener);\n return () => disposable.dispose();\n};\n\n/** React hook returning this app's method catalog, re-rendering on change. Hand\n * it to an embedded agent as its tool list to confine the agent to the app's\n * authority (§5.9). */\nexport const useCatalog = (): ApiMethod[] => {\n const [catalog, setCatalog] = useState<ApiMethod[]>(getCatalog);\n useEffect(() => onCatalogChange(setCatalog), []);\n return catalog;\n};\n"],"mappings":"AAKA,SAAS,WAAW,gBAAgB;AACpC,SAAS,uBAAuB;AAEhC,SAAS,qBAAqB;AAa9B,MAAM,QAAQ,CAAC,SAAmC;AAChD,QAAM,IAAI,KAAK,QAAQ,GAAG;AAC1B,MAAI,KAAK,EAAG,OAAM,IAAI,MAAM,gCAAgC,IAAI,EAAE;AAClE,SAAO,CAAC,KAAK,MAAM,GAAG,CAAC,GAAG,KAAK,MAAM,IAAI,CAAC,CAAC;AAC7C;AAQO,MAAM,SAAS,CAAc,MAAc,SAAkC,CAAC,MAAkB;AACrG,QAAM,CAAC,QAAQ,MAAM,IAAI,MAAM,IAAI;AACnC,SAAO,gBAAgB,QAAQ,QAAQ,CAAC,MAAM,CAAC;AACjD;AAEA,MAAM,mBAAmB;AAAA,EACvB,MAAM,CAAC;AAAA;AAAA,IAEL,OAAO,WAAW,OAAO,QAAQ,WAAW,YAAY,IAAI,MAAM,GAAG;AAAA;AAAA,EACvE,WAAW,CAAC,MAAc,YAAqE;AAE7F,UAAM,IAAI,OAAO,WAAW,OAAO,QAAQ,WAAW,UAAU,CAAC,MAAyB;AACxF,UAAI,KAAK,EAAE,SAAS,KAAM,SAAQ,CAA6C;AAAA,IACjF,CAAC;AACD,WAAO,MAAM,EAAE,QAAQ;AAAA,EACzB;AACF;AAGO,SAAS,aACd,MACA,SAAkC,CAAC,GACP;AAC5B,QAAM,CAAC,QAAQ,MAAM,IAAI,MAAM,IAAI;AACnC,SAAO,cAAoB,kBAAkB,YAAY,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC;AACrF;AAQA,MAAM,iBAAiB,MAAsB;AAE3C,SAAO,OAAO,WAAW,OAAO,QAAQ;AAC1C;AAIO,MAAM,aAAa,MAAmB,eAAe,EAAE,WAAW;AAIlE,MAAM,kBAAkB,CAAC,aAA2D;AACzF,QAAM,aAAa,eAAe,EAAE,SAAS,QAAQ;AACrD,SAAO,MAAM,WAAW,QAAQ;AAClC;AAKO,MAAM,aAAa,MAAmB;AAC3C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAsB,UAAU;AAC9D,YAAU,MAAM,gBAAgB,UAAU,GAAG,CAAC,CAAC;AAC/C,SAAO;AACT;","names":[]}
package/dist/index.cjs CHANGED
@@ -27,6 +27,7 @@ __reExport(index_exports, require("./editorContext"), module.exports);
27
27
  __reExport(index_exports, require("./formFactor"), module.exports);
28
28
  __reExport(index_exports, require("./mounts"), module.exports);
29
29
  __reExport(index_exports, require("./contribute"), module.exports);
30
+ __reExport(index_exports, require("./catalog"), module.exports);
30
31
  __reExport(index_exports, require("./protocolStream"), module.exports);
31
32
  __reExport(index_exports, require("./sandboxTypes"), module.exports);
32
33
  // Annotate the CommonJS export names for ESM import in node:
@@ -43,6 +44,7 @@ __reExport(index_exports, require("./sandboxTypes"), module.exports);
43
44
  ...require("./formFactor"),
44
45
  ...require("./mounts"),
45
46
  ...require("./contribute"),
47
+ ...require("./catalog"),
46
48
  ...require("./protocolStream"),
47
49
  ...require("./sandboxTypes")
48
50
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./MDXProvider\";\nexport * from \"./routing\";\nexport * from \"./boot\";\nexport * from './components/Include';\nexport * from './components/MDXComponents';\nexport * from './hooks'\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './formFactor';\nexport * from './mounts';\nexport * from './contribute';\nexport * from './protocolStream';\nexport * from './sandboxTypes';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,0BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,mBAFd;AAGA,0BAAc,iCAHd;AAIA,0BAAc,uCAJd;AAKA,0BAAc,oBALd;AAMA,0BAAc,mBANd;AAOA,0BAAc,oBAPd;AAQA,0BAAc,4BARd;AASA,0BAAc,yBATd;AAUA,0BAAc,qBAVd;AAWA,0BAAc,yBAXd;AAYA,0BAAc,6BAZd;AAaA,0BAAc,2BAbd;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./MDXProvider\";\nexport * from \"./routing\";\nexport * from \"./boot\";\nexport * from './components/Include';\nexport * from './components/MDXComponents';\nexport * from './hooks'\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './formFactor';\nexport * from './mounts';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './protocolStream';\nexport * from './sandboxTypes';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,0BAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,mBAFd;AAGA,0BAAc,iCAHd;AAIA,0BAAc,uCAJd;AAKA,0BAAc,oBALd;AAMA,0BAAc,mBANd;AAOA,0BAAc,oBAPd;AAQA,0BAAc,4BARd;AASA,0BAAc,yBATd;AAUA,0BAAc,qBAVd;AAWA,0BAAc,yBAXd;AAYA,0BAAc,sBAZd;AAaA,0BAAc,6BAbd;AAcA,0BAAc,2BAdd;","names":[]}
package/dist/index.d.cts CHANGED
@@ -10,6 +10,7 @@ export { EditorContext, getEditorContext, onEditorContextChange, useEditorContex
10
10
  export { FormFactor, FormFactorClass, Orientation, getFormFactor, onFormFactorChange, useFormFactor } from './formFactor.cjs';
11
11
  export { GrantRecord, Member, MountQuery, ResolvedUser, Role, SandboxMount, SpaceError, SpaceInfo, createSpace, findMount, getMounts, getSpaceMembers, listAllSpaces, listGrants, listSpaces, lookupUser, mount, mountSpace, onMountsChange, openAppSpace, requestMount, requestSpace, revokeGrant, setSpaceRole, shareSpace, unmountSpace, unshareSpace, useMounts, waitForMount } from './mounts.cjs';
12
12
  export { ContributeMode, ContributeOptions, ContributionEvent, ContributionResult, contribute } from './contribute.cjs';
13
+ export { ApiMethod, getCatalog, invoke, invokeStream, onCatalogChange, useCatalog } from './catalog.cjs';
13
14
  export { StreamError, StreamFrame, StreamTransport, consumeStream, protocolStream } from './protocolStream.cjs';
14
15
  export { EvaluationContext, FileQueryResult, FilesMetadata, Metadata, MetadataQueryFunction, MetadataQueryResult, ModuleExports } from './sandboxTypes.cjs';
15
16
  import 'react';
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export { EditorContext, getEditorContext, onEditorContextChange, useEditorContex
10
10
  export { FormFactor, FormFactorClass, Orientation, getFormFactor, onFormFactorChange, useFormFactor } from './formFactor.js';
11
11
  export { GrantRecord, Member, MountQuery, ResolvedUser, Role, SandboxMount, SpaceError, SpaceInfo, createSpace, findMount, getMounts, getSpaceMembers, listAllSpaces, listGrants, listSpaces, lookupUser, mount, mountSpace, onMountsChange, openAppSpace, requestMount, requestSpace, revokeGrant, setSpaceRole, shareSpace, unmountSpace, unshareSpace, useMounts, waitForMount } from './mounts.js';
12
12
  export { ContributeMode, ContributeOptions, ContributionEvent, ContributionResult, contribute } from './contribute.js';
13
+ export { ApiMethod, getCatalog, invoke, invokeStream, onCatalogChange, useCatalog } from './catalog.js';
13
14
  export { StreamError, StreamFrame, StreamTransport, consumeStream, protocolStream } from './protocolStream.js';
14
15
  export { EvaluationContext, FileQueryResult, FilesMetadata, Metadata, MetadataQueryFunction, MetadataQueryResult, ModuleExports } from './sandboxTypes.js';
15
16
  import 'react';
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export * from "./editorContext";
10
10
  export * from "./formFactor";
11
11
  export * from "./mounts";
12
12
  export * from "./contribute";
13
+ export * from "./catalog";
13
14
  export * from "./protocolStream";
14
15
  export * from "./sandboxTypes";
15
16
  //# sourceMappingURL=index.js.map
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';\nexport * from './components/MDXComponents';\nexport * from './hooks'\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './formFactor';\nexport * from './mounts';\nexport * from './contribute';\nexport * from './protocolStream';\nexport * from './sandboxTypes';\n"],"mappings":"AAAA,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;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from \"./MDXProvider\";\nexport * from \"./routing\";\nexport * from \"./boot\";\nexport * from './components/Include';\nexport * from './components/MDXComponents';\nexport * from './hooks'\nexport * from './auth';\nexport * from './theme';\nexport * from './editorContext';\nexport * from './formFactor';\nexport * from './mounts';\nexport * from './contribute';\nexport * from './catalog';\nexport * from './protocolStream';\nexport * from './sandboxTypes';\n"],"mappings":"AAAA,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;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immediately-run/sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
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",