@ryuhq/sdk 0.1.13 → 0.2.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.
Files changed (90) hide show
  1. package/README.md +19 -6
  2. package/dist/agent-plugin.cjs +46 -0
  3. package/dist/agent-plugin.d.cts +42 -32
  4. package/dist/agent-plugin.d.ts +42 -32
  5. package/dist/agent-plugin.js +1 -1
  6. package/dist/agent.cjs +9 -0
  7. package/dist/agent.d.cts +377 -1
  8. package/dist/agent.d.ts +377 -1
  9. package/dist/agent.js +4 -2
  10. package/dist/app-Bkw7LlCK.d.ts +129 -0
  11. package/dist/app-DNaGmLVf.d.cts +129 -0
  12. package/dist/builder.cjs +1095 -0
  13. package/dist/builder.d.cts +212 -0
  14. package/dist/builder.d.ts +212 -0
  15. package/dist/builder.js +28 -0
  16. package/dist/chunk-A3RGEPDG.js +250 -0
  17. package/dist/chunk-FZSFZOIN.js +200 -0
  18. package/dist/{chunk-ODFEUVPW.js → chunk-HACAGK65.js} +1 -18
  19. package/dist/{chunk-AO2KJRDD.js → chunk-IEUQ3CDG.js} +125 -2
  20. package/dist/chunk-IKEDLLFY.js +19 -0
  21. package/dist/chunk-IOLP5FFE.js +354 -0
  22. package/dist/{chunk-G6FLVEC4.js → chunk-JX6DDRXV.js} +46 -0
  23. package/dist/chunk-T5676WL2.js +240 -0
  24. package/dist/chunk-TLDPEGC7.js +21 -0
  25. package/dist/chunk-TXSHHZF2.js +0 -0
  26. package/dist/{chunk-MTUBUPIV.js → chunk-ULSVL7EC.js} +8 -227
  27. package/dist/chunk-VLIRNNAE.js +154 -0
  28. package/dist/chunk-W3KPP4WN.js +135 -0
  29. package/dist/cli.cjs +258 -14
  30. package/dist/cli.js +96 -16
  31. package/dist/client-D5U6ssPc.d.cts +84 -0
  32. package/dist/client-D5U6ssPc.d.ts +84 -0
  33. package/dist/index.cjs +519 -5
  34. package/dist/index.d.cts +16 -632
  35. package/dist/index.d.ts +16 -632
  36. package/dist/index.js +63 -695
  37. package/dist/manifest.cjs +129 -3
  38. package/dist/manifest.d.cts +105 -2
  39. package/dist/manifest.d.ts +105 -2
  40. package/dist/manifest.js +7 -1
  41. package/dist/mcp/client.cjs +180 -0
  42. package/dist/mcp/client.d.cts +49 -0
  43. package/dist/mcp/client.d.ts +49 -0
  44. package/dist/mcp/client.js +10 -0
  45. package/dist/mcp/server.cjs +370 -0
  46. package/dist/mcp/server.d.cts +126 -0
  47. package/dist/mcp/server.d.ts +126 -0
  48. package/dist/mcp/server.js +9 -0
  49. package/dist/mcp.cjs +376 -0
  50. package/dist/mcp.d.cts +2 -0
  51. package/dist/mcp.d.ts +2 -0
  52. package/dist/mcp.js +17 -0
  53. package/dist/model.cjs +141 -0
  54. package/dist/model.d.cts +33 -0
  55. package/dist/model.d.ts +33 -0
  56. package/dist/model.js +18 -0
  57. package/dist/plugin.cjs +46 -0
  58. package/dist/plugin.d.cts +215 -0
  59. package/dist/plugin.d.ts +215 -0
  60. package/dist/plugin.js +8 -0
  61. package/dist/runnable.cjs +1230 -0
  62. package/dist/runnable.d.cts +271 -0
  63. package/dist/runnable.d.ts +271 -0
  64. package/dist/runnable.js +28 -0
  65. package/dist/{index-B6SkaAjJ.d.ts → tool-DSx2bFx8.d.ts} +35 -458
  66. package/dist/{index-BvAB5eMk.d.cts → tool-u-VR0fLF.d.cts} +35 -458
  67. package/package.json +38 -2
  68. package/src/agent/loop.test.ts +4 -4
  69. package/src/agent/tools.ts +3 -3
  70. package/src/agent-plugin.test.ts +58 -0
  71. package/src/agent-plugin.ts +108 -35
  72. package/src/cli/dev.test.ts +26 -47
  73. package/src/cli/dev.ts +10 -2
  74. package/src/cli.ts +98 -15
  75. package/src/exports-lockstep.test.ts +92 -0
  76. package/src/generated/plugin-manifest.ts +243 -27
  77. package/src/index.ts +35 -0
  78. package/src/manifest-schema.test.ts +30 -1
  79. package/src/manifest.fixtures.test.ts +13 -3
  80. package/src/manifest.test.ts +96 -10
  81. package/src/manifest.ts +334 -187
  82. package/src/mcp/index.ts +18 -0
  83. package/src/model/index.ts +22 -0
  84. package/src/plugin/ryu-plugin.ts +82 -0
  85. package/src/runnable/app.test.ts +2 -0
  86. package/src/runnable/app.ts +5 -2
  87. package/src/runnable/index.ts +2 -0
  88. package/src/runnable/primitives.ts +57 -0
  89. package/src/runnable/tool.ts +1 -1
  90. package/src/runnable/turn-hook.ts +4 -1
package/dist/model.cjs ADDED
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/model/index.ts
31
+ var model_exports = {};
32
+ __export(model_exports, {
33
+ DEFAULT_GATEWAY_URL: () => DEFAULT_GATEWAY_URL,
34
+ ModelClient: () => ModelClient2,
35
+ assertAllowedEgressUrl: () => assertAllowedEgressUrl,
36
+ defineModel: () => defineModel,
37
+ resolveGatewayToken: () => resolveGatewayToken2,
38
+ resolveGatewayUrl: () => resolveGatewayUrl3
39
+ });
40
+ module.exports = __toCommonJS(model_exports);
41
+
42
+ // src/model/client.ts
43
+ var native = __toESM(require("@ryuhq/sdk-native"), 1);
44
+ var ModelClient2 = class {
45
+ model;
46
+ baseUrl;
47
+ native;
48
+ constructor(model, options = {}) {
49
+ this.native = new native.ModelClient(
50
+ model,
51
+ options.baseUrl ?? null,
52
+ options.token ?? null
53
+ );
54
+ this.model = model;
55
+ this.baseUrl = options.baseUrl ?? native.resolveGatewayUrl();
56
+ }
57
+ /** Send a non-streaming chat completion request to the gateway. */
58
+ async chat(messages) {
59
+ const res = await this.native.chat(messages);
60
+ const usage = res.promptTokens === void 0 && res.completionTokens === void 0 && res.totalTokens === void 0 ? void 0 : {
61
+ promptTokens: res.promptTokens ?? 0,
62
+ completionTokens: res.completionTokens ?? 0,
63
+ totalTokens: res.totalTokens ?? 0
64
+ };
65
+ return {
66
+ content: res.content,
67
+ finishReason: res.finishReason ?? null,
68
+ usage
69
+ };
70
+ }
71
+ /** Send a streaming chat completion request, yielding deltas as they arrive. */
72
+ async *stream(messages) {
73
+ const queue = [];
74
+ let done = false;
75
+ let failure = null;
76
+ let wake = null;
77
+ const notify = () => {
78
+ if (wake) {
79
+ const w = wake;
80
+ wake = null;
81
+ w();
82
+ }
83
+ };
84
+ this.native.stream(messages, (err, delta) => {
85
+ if (err) {
86
+ failure = err;
87
+ done = true;
88
+ } else if (delta === null || delta === void 0) {
89
+ done = true;
90
+ } else {
91
+ queue.push({
92
+ content: delta.content ?? null,
93
+ finishReason: delta.finishReason ?? null
94
+ });
95
+ }
96
+ notify();
97
+ });
98
+ while (true) {
99
+ while (queue.length > 0) {
100
+ const next = queue.shift();
101
+ if (next) {
102
+ yield next;
103
+ }
104
+ }
105
+ if (failure) {
106
+ throw failure;
107
+ }
108
+ if (done) {
109
+ return;
110
+ }
111
+ await new Promise((resolve) => {
112
+ wake = resolve;
113
+ });
114
+ }
115
+ }
116
+ };
117
+ function defineModel(modelId, options = {}) {
118
+ return new ModelClient2(modelId, options);
119
+ }
120
+
121
+ // src/model/gateway.ts
122
+ var native2 = __toESM(require("@ryuhq/sdk-native"), 1);
123
+ var DEFAULT_GATEWAY_URL = "http://127.0.0.1:7981";
124
+ function resolveGatewayUrl3() {
125
+ return native2.resolveGatewayUrl();
126
+ }
127
+ function resolveGatewayToken2() {
128
+ return native2.resolveGatewayToken() ?? void 0;
129
+ }
130
+ function assertAllowedEgressUrl(baseUrl) {
131
+ native2.assertAllowedEgress(baseUrl);
132
+ }
133
+ // Annotate the CommonJS export names for ESM import in node:
134
+ 0 && (module.exports = {
135
+ DEFAULT_GATEWAY_URL,
136
+ ModelClient,
137
+ assertAllowedEgressUrl,
138
+ defineModel,
139
+ resolveGatewayToken,
140
+ resolveGatewayUrl
141
+ });
@@ -0,0 +1,33 @@
1
+ export { C as ChatDelta, a as ChatMessage, b as ChatResult, M as ModelClient, c as ModelClientOptions, d as defineModel } from './client-D5U6ssPc.cjs';
2
+
3
+ /**
4
+ * Gateway configuration + egress enforcement for the Ryu SDK model client.
5
+ *
6
+ * Rust-cored: every function here delegates to the `@ryuhq/sdk-native` addon, so
7
+ * the gateway URL/token resolution and the direct-provider egress blocklist are
8
+ * the exact same implementation (`crates/ryu-sdk/src/gateway.rs`) used by the
9
+ * Go/Python bindings and Core itself — one source of truth, no drift.
10
+ */
11
+ /** Default base URL for the local Ryu gateway — matches Core's DEFAULT_GATEWAY_URL. */
12
+ declare const DEFAULT_GATEWAY_URL = "http://127.0.0.1:7981";
13
+ /**
14
+ * Resolve the effective gateway base URL.
15
+ *
16
+ * Resolution order (in the Rust core):
17
+ * 1. `RYU_GATEWAY_URL` env var (when non-empty).
18
+ * 2. `DEFAULT_GATEWAY_URL`.
19
+ */
20
+ declare function resolveGatewayUrl(): string;
21
+ /**
22
+ * Resolve the optional gateway bearer token (`RYU_GATEWAY_TOKEN`), or
23
+ * `undefined` when unset/empty.
24
+ */
25
+ declare function resolveGatewayToken(): string | undefined;
26
+ /**
27
+ * Validate that `baseUrl` is an allowed egress target. Throws a descriptive
28
+ * `Error` (from the Rust core) when the URL matches a known direct-provider
29
+ * pattern, enforcing the BYOK-at-the-gateway rule.
30
+ */
31
+ declare function assertAllowedEgressUrl(baseUrl: string): void;
32
+
33
+ export { DEFAULT_GATEWAY_URL, assertAllowedEgressUrl, resolveGatewayToken, resolveGatewayUrl };
@@ -0,0 +1,33 @@
1
+ export { C as ChatDelta, a as ChatMessage, b as ChatResult, M as ModelClient, c as ModelClientOptions, d as defineModel } from './client-D5U6ssPc.js';
2
+
3
+ /**
4
+ * Gateway configuration + egress enforcement for the Ryu SDK model client.
5
+ *
6
+ * Rust-cored: every function here delegates to the `@ryuhq/sdk-native` addon, so
7
+ * the gateway URL/token resolution and the direct-provider egress blocklist are
8
+ * the exact same implementation (`crates/ryu-sdk/src/gateway.rs`) used by the
9
+ * Go/Python bindings and Core itself — one source of truth, no drift.
10
+ */
11
+ /** Default base URL for the local Ryu gateway — matches Core's DEFAULT_GATEWAY_URL. */
12
+ declare const DEFAULT_GATEWAY_URL = "http://127.0.0.1:7981";
13
+ /**
14
+ * Resolve the effective gateway base URL.
15
+ *
16
+ * Resolution order (in the Rust core):
17
+ * 1. `RYU_GATEWAY_URL` env var (when non-empty).
18
+ * 2. `DEFAULT_GATEWAY_URL`.
19
+ */
20
+ declare function resolveGatewayUrl(): string;
21
+ /**
22
+ * Resolve the optional gateway bearer token (`RYU_GATEWAY_TOKEN`), or
23
+ * `undefined` when unset/empty.
24
+ */
25
+ declare function resolveGatewayToken(): string | undefined;
26
+ /**
27
+ * Validate that `baseUrl` is an allowed egress target. Throws a descriptive
28
+ * `Error` (from the Rust core) when the URL matches a known direct-provider
29
+ * pattern, enforcing the BYOK-at-the-gateway rule.
30
+ */
31
+ declare function assertAllowedEgressUrl(baseUrl: string): void;
32
+
33
+ export { DEFAULT_GATEWAY_URL, assertAllowedEgressUrl, resolveGatewayToken, resolveGatewayUrl };
package/dist/model.js ADDED
@@ -0,0 +1,18 @@
1
+ import {
2
+ ModelClient,
3
+ defineModel
4
+ } from "./chunk-HACAGK65.js";
5
+ import {
6
+ DEFAULT_GATEWAY_URL,
7
+ assertAllowedEgressUrl,
8
+ resolveGatewayToken,
9
+ resolveGatewayUrl
10
+ } from "./chunk-IKEDLLFY.js";
11
+ export {
12
+ DEFAULT_GATEWAY_URL,
13
+ ModelClient,
14
+ assertAllowedEgressUrl,
15
+ defineModel,
16
+ resolveGatewayToken,
17
+ resolveGatewayUrl
18
+ };
@@ -0,0 +1,46 @@
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
+
20
+ // src/plugin/ryu-plugin.ts
21
+ var ryu_plugin_exports = {};
22
+ __export(ryu_plugin_exports, {
23
+ definePlugin: () => definePlugin,
24
+ toDisposable: () => toDisposable
25
+ });
26
+ module.exports = __toCommonJS(ryu_plugin_exports);
27
+ function toDisposable(teardown) {
28
+ let done = false;
29
+ return {
30
+ dispose() {
31
+ if (done) {
32
+ return;
33
+ }
34
+ done = true;
35
+ teardown();
36
+ }
37
+ };
38
+ }
39
+ function definePlugin(plugin) {
40
+ return plugin;
41
+ }
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ definePlugin,
45
+ toDisposable
46
+ });
@@ -0,0 +1,215 @@
1
+ /** A handle that undoes a registration. Idempotent: calling `dispose()` twice is
2
+ * a no-op. */
3
+ interface Disposable {
4
+ dispose(): void;
5
+ }
6
+ /** Build a {@link Disposable} from a teardown function. */
7
+ declare function toDisposable(teardown: () => void): Disposable;
8
+ /** A tab/route a plugin adds. `path` is matched against `tab.path` (exact match
9
+ * unless `pattern` is set). The host loads `webview.entry` in a sandboxed
10
+ * surface as the tab body.
11
+ *
12
+ * Note: the OSS contract is declarative + sandboxed-webview only. A trusted,
13
+ * in-process React component is a desktop-host capability (the host's registry
14
+ * accepts a `(tab) => ReactNode` render-fn for BUILT-INS and first-party bundled
15
+ * plugins); it is intentionally absent from this framework-agnostic contract. */
16
+ interface RouteContribution {
17
+ /** Exact path (e.g. "/my-plugin") or, with `pattern: true`, a RegExp source
18
+ * string matched against the full path (e.g. "^/my-plugin/[^/]+$"). */
19
+ path: string;
20
+ /** Treat `path` as a RegExp source string rather than an exact match. */
21
+ pattern?: boolean;
22
+ /** Human title (tab label, command-palette entry). */
23
+ title: string;
24
+ /** Load plugin UI in a SANDBOXED webview with NO Tauri IPC; the plugin reaches
25
+ * capabilities only over the host RPC bridge. */
26
+ webview: {
27
+ entry: string;
28
+ };
29
+ }
30
+ /** A named mount region a panel can target. Generalizes the desktop's existing
31
+ * per-section slots (sidebar sections, settings tabs, the chat side-panel, the
32
+ * companion overlay) into declared contribution points. */
33
+ type PanelRegion = "sidebar-section" | "settings-tab" | "chat-side-panel" | "companion-overlay";
34
+ interface PanelContribution {
35
+ /** Stable id within the region (also the host's key). */
36
+ id: string;
37
+ region: PanelRegion;
38
+ title: string;
39
+ webview: {
40
+ entry: string;
41
+ };
42
+ }
43
+ /** A command-palette entry. Shaped to map 1:1 onto the desktop's
44
+ * `CommandAction` (from `@ryu/command/types`) so a contributed command lands in
45
+ * the same palette as built-ins with no shim. */
46
+ interface CommandContribution {
47
+ /** Group heading in the palette. Defaults to the plugin's display name. */
48
+ group?: string;
49
+ id: string;
50
+ /** Extra fuzzy-search terms. */
51
+ keywords?: string;
52
+ /** The side effect. Runs in the host; for sandboxed plugins it is an RPC. */
53
+ run(): void | Promise<void>;
54
+ /** Right-aligned keyboard hint (e.g. "⌘⇧P"). */
55
+ shortcut?: string;
56
+ title: string;
57
+ }
58
+ interface SettingsSectionContribution {
59
+ id: string;
60
+ title: string;
61
+ webview: {
62
+ entry: string;
63
+ };
64
+ }
65
+ /** A section in the unified Store/marketplace surface. */
66
+ interface StoreSectionContribution {
67
+ id: string;
68
+ title: string;
69
+ webview: {
70
+ entry: string;
71
+ };
72
+ }
73
+ /** A theme a plugin contributes (CSS custom-property overrides keyed by token). */
74
+ interface ThemeContribution {
75
+ id: string;
76
+ name: string;
77
+ tokens: Record<string, string>;
78
+ }
79
+ /** The host-service surface a plugin calls back into. Each method is mediated by
80
+ * the host and grant-gated by the manifest (#443). For a sandboxed plugin these
81
+ * are RPCs over the postMessage bridge; the plugin never holds a Core token or
82
+ * Tauri IPC handle directly. */
83
+ interface RyuHostServices {
84
+ /** Read and cooperatively stop Core-visible background processes. */
85
+ background: {
86
+ list(input?: {
87
+ producer?: string;
88
+ running_only?: boolean;
89
+ }): Promise<{
90
+ process_id: string;
91
+ command: string;
92
+ cwd: string;
93
+ elapsed_ms: number;
94
+ running: boolean;
95
+ [key: string]: unknown;
96
+ }[]>;
97
+ stop(input: {
98
+ process_id: string;
99
+ }): Promise<{
100
+ ok: boolean;
101
+ requested: boolean;
102
+ process_id: string;
103
+ }>;
104
+ };
105
+ /** Read-only feature discovery. Older hosts may omit this method; treat that
106
+ * as an empty capability set rather than assuming a native surface exists. */
107
+ capabilities?(): Promise<RyuHostCapabilities>;
108
+ /** Run a registered command by id (built-in or contributed). */
109
+ commands: {
110
+ execute(id: string, ...args: unknown[]): Promise<unknown>;
111
+ };
112
+ /** Gateway-governed model access (chat/embed). Mirrors `@ryuhq/sdk` model
113
+ * client semantics; every call still routes through the Gateway. */
114
+ gateway: {
115
+ chat(model: string, messages: {
116
+ role: string;
117
+ content: string;
118
+ }[]): Promise<string>;
119
+ };
120
+ /** List the agents on the active node, PROJECTED to `{id,name}` only. The host
121
+ * holds the Core token and performs the fetch; the plugin never sees a token
122
+ * or any other agent field (invariant: no capability returns a secret). Gated
123
+ * by the `core:list_agents` grant. */
124
+ listAgents(): Promise<{
125
+ id: string;
126
+ name: string;
127
+ }[]>;
128
+ /** Mobile-native effects. These methods remain optional at the type boundary
129
+ * because desktop, web, extension, and terminal hosts fail closed. */
130
+ native?: {
131
+ haptics(input: RyuNativeHapticsInput): Promise<RyuNativeHapticsResult>;
132
+ notifications: {
133
+ create(input: RyuNativeNotificationInput): Promise<RyuNativeNotificationResult>;
134
+ };
135
+ liveActivities: {
136
+ update(input: RyuNativeLiveActivityInput): Promise<RyuNativeLiveActivityResult>;
137
+ };
138
+ };
139
+ /** Open a tab at a path (built-in or a route this plugin contributed). */
140
+ openTab(path: string): void;
141
+ /** Read/write the plugin's own Spaces docs (scoped by grant). */
142
+ spaces: {
143
+ ingestDocument(spaceId: string, title: string, markdown: string): Promise<{
144
+ docId: string;
145
+ }>;
146
+ };
147
+ }
148
+ /** The token-free, read-only native feature inventory returned by a host. */
149
+ interface RyuHostCapabilities {
150
+ androidOngoingNotifications: boolean;
151
+ browserNotifications: boolean;
152
+ dynamicIsland: boolean;
153
+ haptics: boolean;
154
+ hardwareBleRelay: boolean;
155
+ liveActivities: boolean;
156
+ localNotifications: boolean;
157
+ platform: "android" | "browser" | "ios" | "unknown";
158
+ pushRegistration: boolean;
159
+ quickActions: boolean;
160
+ sounds: boolean;
161
+ }
162
+ type RyuNativeHapticStyle = "light" | "success" | "warning" | "error";
163
+ interface RyuNativeHapticsInput {
164
+ style: RyuNativeHapticStyle;
165
+ }
166
+ interface RyuNativeNotificationInput {
167
+ body: string;
168
+ title: string;
169
+ }
170
+ interface RyuNativeLiveActivityInput {
171
+ conversationId: string;
172
+ detail: string;
173
+ status: "running" | "waiting" | "review" | "done" | "error";
174
+ title: string;
175
+ }
176
+ interface RyuNativeHapticsResult {
177
+ signaled: true;
178
+ }
179
+ interface RyuNativeNotificationResult {
180
+ id: string;
181
+ scheduled: true;
182
+ }
183
+ interface RyuNativeLiveActivityResult {
184
+ updated: true;
185
+ }
186
+ /** Everything a plugin can contribute. Each `register*` returns a
187
+ * {@link Disposable}; collect them in {@link PluginContext.subscriptions}. */
188
+ interface RyuPlugin {
189
+ /** Host services the plugin calls back into (grant-gated). */
190
+ readonly host: RyuHostServices;
191
+ registerCommand(contribution: CommandContribution): Disposable;
192
+ registerPanel(contribution: PanelContribution): Disposable;
193
+ registerRoute(contribution: RouteContribution): Disposable;
194
+ registerSettingsSection(contribution: SettingsSectionContribution): Disposable;
195
+ registerStoreSection(contribution: StoreSectionContribution): Disposable;
196
+ registerTheme(contribution: ThemeContribution): Disposable;
197
+ }
198
+ /** Passed to `activate(context)`. The plugin pushes its disposables onto
199
+ * `subscriptions`; the host disposes them all on `deactivate`. */
200
+ interface PluginContext {
201
+ readonly plugin: RyuPlugin;
202
+ /** The plugin's own id (from `manifest.json`). */
203
+ readonly pluginId: string;
204
+ /** Disposables auto-cleaned on deactivate. */
205
+ readonly subscriptions: Disposable[];
206
+ }
207
+ /** The shape the host expects a plugin's entry module to export. */
208
+ interface RyuPluginModule {
209
+ activate(context: PluginContext): void | Promise<void>;
210
+ deactivate?(): void | Promise<void>;
211
+ }
212
+ /** Identity helper for authoring a typed plugin module (no runtime behavior). */
213
+ declare function definePlugin(plugin: RyuPluginModule): RyuPluginModule;
214
+
215
+ export { type CommandContribution, type Disposable, type PanelContribution, type PanelRegion, type PluginContext, type RouteContribution, type RyuHostCapabilities, type RyuHostServices, type RyuNativeHapticStyle, type RyuNativeHapticsInput, type RyuNativeHapticsResult, type RyuNativeLiveActivityInput, type RyuNativeLiveActivityResult, type RyuNativeNotificationInput, type RyuNativeNotificationResult, type RyuPlugin, type RyuPluginModule, type SettingsSectionContribution, type StoreSectionContribution, type ThemeContribution, definePlugin, toDisposable };