@pstdio/sdk 0.4.0 → 0.4.2

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.
@@ -1,5 +1,6 @@
1
1
  import { type ActionClient } from "./actions";
2
2
  import { type AgentClient } from "./agents";
3
+ import { type ExtensionClient } from "./extensions";
3
4
  import { type ProjectClient } from "./projects";
4
5
  import type { ClientOptions } from "./request";
5
6
  import { type SessionClient } from "./sessions";
@@ -20,5 +21,6 @@ export type PstdioClient = {
20
21
  skills: SkillClient;
21
22
  agents: AgentClient;
22
23
  actions: ActionClient;
24
+ extensions: ExtensionClient;
23
25
  };
24
26
  export declare const createClient: (options?: ClientOptions) => PstdioClient;
@@ -0,0 +1,7 @@
1
+ import type { CommandExecuteRequest, CommandExecuteResponse, EnableInstalledExtensionRequest, EnableInstalledExtensionResponse } from "pstdio-api-contracts";
2
+ import type { RequestFn } from "./request";
3
+ export type ExtensionClient = {
4
+ enableInstalled(projectId: string, installName: string, request: EnableInstalledExtensionRequest): Promise<EnableInstalledExtensionResponse>;
5
+ execute(commandId: string, request: CommandExecuteRequest): Promise<CommandExecuteResponse>;
6
+ };
7
+ export declare const createExtensionClient: (request: RequestFn) => ExtensionClient;
@@ -1,6 +1,7 @@
1
1
  export type { ActionClient } from "./actions";
2
2
  export type { AgentClient } from "./agents";
3
3
  export { createClient, type PstdioClient } from "./client";
4
+ export type { ExtensionClient } from "./extensions";
4
5
  export type { ProjectClient } from "./projects";
5
6
  export { type ClientOptions, createRequest, PstdioApiError, type RequestFn } from "./request";
6
7
  export type { SessionClient } from "./sessions";
@@ -18,6 +18,21 @@ var createAgentClient = (request) => ({
18
18
  delete: (agentId) => request(`/v1/agents/${agentId}`, { method: "DELETE" })
19
19
  });
20
20
 
21
+ // src/client/extensions.ts
22
+ var createExtensionClient = (request) => ({
23
+ enableInstalled: (projectId, installName, body) => request(`/v1/projects/${projectId}/extensions/installed/${encodeURIComponent(installName)}/enable`, {
24
+ method: "POST",
25
+ body
26
+ }),
27
+ execute: (commandId, input) => {
28
+ const { projectId, ...body } = input;
29
+ return request(`/v1/projects/${projectId}/extensions/commands/${encodeURIComponent(commandId)}/execute`, {
30
+ method: "POST",
31
+ body
32
+ });
33
+ }
34
+ });
35
+
21
36
  // src/client/projects.ts
22
37
  var createProjectClient = (request) => ({
23
38
  list: () => request("/v1/projects"),
@@ -298,7 +313,8 @@ var createClient = (options = {}) => {
298
313
  templates: createTemplateClient(request),
299
314
  skills: createSkillClient(request),
300
315
  agents: createAgentClient(request),
301
- actions: createActionClient(request)
316
+ actions: createActionClient(request),
317
+ extensions: createExtensionClient(request)
302
318
  };
303
319
  };
304
320
  export {
@@ -0,0 +1,28 @@
1
+ import type { CommandDefinition, HookDefinition, MiddlewareDefinition } from "./types/extension";
2
+ import type { Struct } from "./types/json";
3
+ import type { ParamObjectSchema } from "./types/params";
4
+ /**
5
+ * Define a single command outside an extension's object literal. Use this when commands
6
+ * grow large enough to split into separate files, or when you need to share a command
7
+ * shape across extensions. The `params` schema drives the inferred shape of `ctx.params`.
8
+ *
9
+ * @example
10
+ * export const sayHello = defineCommand({
11
+ * title: "Say hello",
12
+ * params: { name: params.text() },
13
+ * async run(ctx) {
14
+ * ctx.params.name; // string
15
+ * },
16
+ * });
17
+ */
18
+ export declare const defineCommand: <const TSchema extends ParamObjectSchema | undefined, TResult = unknown>(definition: CommandDefinition<TSchema, TResult>) => CommandDefinition<TSchema, TResult>;
19
+ /**
20
+ * Define middleware for a command. Pass the typed `command` ref (preferred) or
21
+ * `commandId` for cross-extension references where the typed ref isn't importable.
22
+ */
23
+ export declare const defineMiddleware: <TParams extends Struct = Struct, TResult = unknown>(definition: MiddlewareDefinition<TParams, TResult>) => MiddlewareDefinition<TParams, TResult>;
24
+ /**
25
+ * Define a hook for an event. Pass the typed `event` ref (preferred) or `eventId` for
26
+ * cross-extension references where the typed ref isn't importable.
27
+ */
28
+ export declare const defineHook: <TPayload extends Struct = Struct>(definition: HookDefinition<TPayload>) => HookDefinition<TPayload>;
@@ -0,0 +1,16 @@
1
+ import type { ExtensionDefinition } from "./types/extension";
2
+ /**
3
+ * Identity helper that preserves the literal type of the passed extension. Authors get
4
+ * full autocomplete on contributions, and `commandsOf(ext)` can derive typed refs from
5
+ * the returned definition.
6
+ *
7
+ * @example
8
+ * export default defineExtension({
9
+ * id: "pstdio.example",
10
+ * namespace: "example",
11
+ * name: "Example",
12
+ * apiVersion: "1",
13
+ * commands: { ... },
14
+ * });
15
+ */
16
+ export declare const defineExtension: <const TExtension extends ExtensionDefinition>(extension: TExtension) => TExtension;
@@ -0,0 +1,8 @@
1
+ export { defineCommand, defineHook, defineMiddleware } from "./define-command";
2
+ export { defineExtension } from "./define-extension";
3
+ export { projectEvents, projectSlots, sessionEvents, sessionSlots, workspaceEvents, workspaceSlots, } from "./kernel-slots";
4
+ export { packageAsset } from "./package-asset";
5
+ export { params } from "./params";
6
+ export { commandEvent, commandRef, commandsOf, eventRef } from "./refs";
7
+ export { defineSlot } from "./slots";
8
+ export type * from "./types";
@@ -0,0 +1,111 @@
1
+ // src/extensions/define-command.ts
2
+ var defineCommand = (definition) => definition;
3
+ var defineMiddleware = (definition) => definition;
4
+ var defineHook = (definition) => definition;
5
+ // src/extensions/define-extension.ts
6
+ var defineExtension = (extension) => extension;
7
+ // src/extensions/refs.ts
8
+ var commandRef = (id) => ({ id });
9
+ var eventRef = (id) => ({ id });
10
+ var commandEvent = (command, phase) => ({
11
+ id: `command.${phase}:${command.id}`
12
+ });
13
+ var commandsOf = (extension) => {
14
+ const refs = {};
15
+ const commands = extension.commands ?? {};
16
+ for (const key of Object.keys(commands)) {
17
+ refs[key] = { id: `${extension.namespace}.${key}` };
18
+ }
19
+ return refs;
20
+ };
21
+
22
+ // src/extensions/slots.ts
23
+ var defineSlot = (id, options) => ({
24
+ id,
25
+ kind: options.kind,
26
+ label: options.label,
27
+ description: options.description,
28
+ metadata: options.metadata
29
+ });
30
+
31
+ // src/extensions/kernel-slots.ts
32
+ var projectSlots = {
33
+ sidebarNav: defineSlot("project.sidebarNav", { kind: "navigation" }),
34
+ sidebar: defineSlot("project.sidebar", { kind: "view" }),
35
+ headerPrimary: defineSlot("project.headerPrimary", { kind: "menu" }),
36
+ headerOverflow: defineSlot("project.headerOverflow", { kind: "menu" }),
37
+ settingsPanels: defineSlot("project.settingsPanels", { kind: "settings" })
38
+ };
39
+ var sessionSlots = {
40
+ headerPrimary: defineSlot("session.headerPrimary", { kind: "menu" }),
41
+ headerOverflow: defineSlot("session.headerOverflow", { kind: "menu" }),
42
+ transcriptActions: defineSlot("session.transcriptActions", { kind: "menu" })
43
+ };
44
+ var workspaceSlots = {
45
+ headerPrimary: defineSlot("workspace.headerPrimary", { kind: "menu" }),
46
+ headerOverflow: defineSlot("workspace.headerOverflow", { kind: "menu" }),
47
+ tabs: defineSlot("workspace.tabs", { kind: "navigation" }),
48
+ sidebar: defineSlot("workspace.sidebar", { kind: "view" })
49
+ };
50
+ var projectEvents = {
51
+ opened: eventRef("project.opened")
52
+ };
53
+ var sessionEvents = {
54
+ started: eventRef("session.started"),
55
+ completed: eventRef("session.completed")
56
+ };
57
+ var workspaceEvents = {
58
+ created: eventRef("workspace.created"),
59
+ archived: eventRef("workspace.archived"),
60
+ deleted: eventRef("workspace.deleted")
61
+ };
62
+ // src/extensions/package-asset.ts
63
+ var packageAsset = (path, baseUrl) => ({
64
+ kind: "package-asset",
65
+ path,
66
+ baseUrl
67
+ });
68
+ // src/extensions/params.ts
69
+ var params = {
70
+ text: (options = {}) => ({ type: "text", ...options }),
71
+ longText: (options = {}) => ({ type: "longtext", ...options }),
72
+ number: (options = {}) => ({ type: "number", ...options }),
73
+ boolean: (options = {}) => ({ type: "boolean", ...options }),
74
+ select: (options) => ({ type: "select", ...options }),
75
+ multiSelect: (options) => ({
76
+ type: "multi-select",
77
+ ...options
78
+ }),
79
+ repo: (options = {}) => ({ type: "repo", ...options }),
80
+ harness: (options = {}) => ({ type: "harness", ...options }),
81
+ template: (options) => ({
82
+ label: options.label,
83
+ description: options.description,
84
+ required: options.required,
85
+ defaultValue: options.defaultValue,
86
+ metadata: options.metadata,
87
+ type: "template",
88
+ templateType: options.type
89
+ }),
90
+ resource: (options) => ({ type: "resource", ...options }),
91
+ json: (options = {}) => ({ type: "json", ...options })
92
+ };
93
+ export {
94
+ workspaceSlots,
95
+ workspaceEvents,
96
+ sessionSlots,
97
+ sessionEvents,
98
+ projectSlots,
99
+ projectEvents,
100
+ params,
101
+ packageAsset,
102
+ eventRef,
103
+ defineSlot,
104
+ defineMiddleware,
105
+ defineHook,
106
+ defineExtension,
107
+ defineCommand,
108
+ commandsOf,
109
+ commandRef,
110
+ commandEvent
111
+ };
@@ -0,0 +1,46 @@
1
+ import type { JsonObject } from "./types/json";
2
+ import type { ResourceAnchor } from "./types/resources";
3
+ export declare const projectSlots: {
4
+ sidebarNav: import("./types").SlotRef<object, "navigation">;
5
+ sidebar: import("./types").SlotRef<object, "view">;
6
+ headerPrimary: import("./types").SlotRef<object, "menu">;
7
+ headerOverflow: import("./types").SlotRef<object, "menu">;
8
+ settingsPanels: import("./types").SlotRef<object, "settings">;
9
+ };
10
+ export declare const sessionSlots: {
11
+ headerPrimary: import("./types").SlotRef<object, "menu">;
12
+ headerOverflow: import("./types").SlotRef<object, "menu">;
13
+ transcriptActions: import("./types").SlotRef<object, "menu">;
14
+ };
15
+ export declare const workspaceSlots: {
16
+ headerPrimary: import("./types").SlotRef<object, "menu">;
17
+ headerOverflow: import("./types").SlotRef<object, "menu">;
18
+ tabs: import("./types").SlotRef<object, "navigation">;
19
+ sidebar: import("./types").SlotRef<object, "view">;
20
+ };
21
+ export declare const projectEvents: {
22
+ opened: import("./types").EventRef<{
23
+ projectId: string;
24
+ }>;
25
+ };
26
+ export declare const sessionEvents: {
27
+ started: import("./types").EventRef<{
28
+ sessionId: string;
29
+ anchors?: ResourceAnchor[];
30
+ }>;
31
+ completed: import("./types").EventRef<{
32
+ sessionId: string;
33
+ anchors?: ResourceAnchor[];
34
+ }>;
35
+ };
36
+ export declare const workspaceEvents: {
37
+ created: import("./types").EventRef<{
38
+ workspace: JsonObject;
39
+ }>;
40
+ archived: import("./types").EventRef<{
41
+ workspace: JsonObject;
42
+ }>;
43
+ deleted: import("./types").EventRef<{
44
+ workspace: JsonObject;
45
+ }>;
46
+ };
@@ -0,0 +1,10 @@
1
+ import type { PackageAssetDescriptor } from "./types/resources";
2
+ /**
3
+ * Reference an asset shipped alongside the extension's compiled output. `path` is
4
+ * resolved relative to `baseUrl`; in practice authors always pass `import.meta.url`
5
+ * so the runtime can locate the file no matter where the extension is installed.
6
+ *
7
+ * @example
8
+ * webview: { entry: packageAsset("./dist/page.html", import.meta.url) }
9
+ */
10
+ export declare const packageAsset: (path: string, baseUrl: string) => PackageAssetDescriptor;
@@ -0,0 +1,26 @@
1
+ import type { BooleanParam, HarnessParam, JsonParam, LongTextParam, MultiSelectParam, NumberParam, RepoParam, ResourceParam, SelectParam, TemplateParam, TextParam } from "./types/params";
2
+ /**
3
+ * Builders for typed parameter descriptors. Each builder produces a discriminated
4
+ * `ParamDescriptor` so the runtime and editor only see fields valid for that type.
5
+ *
6
+ * @example
7
+ * params: {
8
+ * amount: params.number({ defaultValue: 1 }),
9
+ * mode: params.select({ options: [{ label: "Fast", value: "fast" }] }),
10
+ * }
11
+ */
12
+ export declare const params: {
13
+ text: (options?: Omit<TextParam, "type">) => TextParam;
14
+ longText: (options?: Omit<LongTextParam, "type">) => LongTextParam;
15
+ number: (options?: Omit<NumberParam, "type">) => NumberParam;
16
+ boolean: (options?: Omit<BooleanParam, "type">) => BooleanParam;
17
+ select: (options: Omit<SelectParam, "type">) => SelectParam;
18
+ multiSelect: (options: Omit<MultiSelectParam, "type">) => MultiSelectParam;
19
+ repo: (options?: Omit<RepoParam, "type">) => RepoParam;
20
+ harness: (options?: Omit<HarnessParam, "type">) => HarnessParam;
21
+ template: (options: Omit<TemplateParam, "type" | "templateType"> & {
22
+ type: string;
23
+ }) => TemplateParam;
24
+ resource: (options: Omit<ResourceParam, "type">) => ResourceParam;
25
+ json: <T = unknown>(options?: Omit<JsonParam<T>, "type">) => JsonParam<T>;
26
+ };
@@ -0,0 +1,38 @@
1
+ import type { CommandLifecycleEventPayload, CommandLifecyclePhase, CommandRef } from "./types/commands";
2
+ import type { EventRef } from "./types/events";
3
+ import type { CommandDefinition } from "./types/extension";
4
+ import type { Struct } from "./types/json";
5
+ import type { ParamObjectSchema, ParamsOf } from "./types/params";
6
+ /**
7
+ * Build a typed reference to a command by id. Authors generally prefer `commandsOf(ext)`,
8
+ * which derives refs from the extension definition so a renamed command becomes a type
9
+ * error at every call site.
10
+ */
11
+ export declare const commandRef: <TParams extends Struct = Struct, TResult = unknown>(id: string) => CommandRef<TParams, TResult>;
12
+ /** Build a typed reference to an event by id. */
13
+ export declare const eventRef: <TPayload extends Struct = Struct>(id: string) => EventRef<TPayload>;
14
+ /**
15
+ * Build an `EventRef` for a command lifecycle phase (`requested`, `started`, `completed`,
16
+ * `rejected`, `failed`). The payload type is inferred from the command ref so hooks see
17
+ * the correct shape.
18
+ */
19
+ export declare const commandEvent: <TPhase extends CommandLifecyclePhase, TParams extends Struct = Struct, TResult = unknown>(command: CommandRef<TParams, TResult>, phase: TPhase) => EventRef<CommandLifecycleEventPayload<TPhase, TParams, TResult>>;
20
+ type CommandsRecord = Record<string, CommandDefinition<any, any>>;
21
+ type CommandRefFromDefinition<TDefinition> = TDefinition extends CommandDefinition<infer TSchema, infer TResult> ? CommandRef<TSchema extends ParamObjectSchema ? ParamsOf<TSchema> : Struct, TResult> : never;
22
+ type CommandsRefMap<TCommands extends CommandsRecord> = {
23
+ [K in keyof TCommands]: CommandRefFromDefinition<TCommands[K]>;
24
+ };
25
+ /**
26
+ * Derive typed `CommandRef`s from an extension. Renaming a command in the definition
27
+ * surfaces as a type error wherever the ref is used.
28
+ *
29
+ * @example
30
+ * const ext = defineExtension({ id: "lab", namespace: "lab", commands: { ... } });
31
+ * const labCommands = commandsOf(ext);
32
+ * labCommands.awaken; // CommandRef<{ title: string }, ...>
33
+ */
34
+ export declare const commandsOf: <TExtension extends {
35
+ namespace: string;
36
+ commands?: CommandsRecord;
37
+ }>(extension: TExtension) => CommandsRefMap<NonNullable<TExtension["commands"]>>;
38
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { Struct } from "./types/json";
2
+ import type { SlotOptions, SlotRef, UiSlotKind } from "./types/slots";
3
+ /**
4
+ * Define a UI slot that contributions can target. The `TContext` parameter constrains
5
+ * the data passed to renderers/menus invoked through the slot, and `TKind` picks the
6
+ * contribution shape (`menu`, `navigation`, `view`, `settings`, `renderer`).
7
+ *
8
+ * @example
9
+ * export const projectHeader = defineSlot<{ projectId: string }, "menu">("project.header", {
10
+ * kind: "menu",
11
+ * label: "Project header",
12
+ * });
13
+ */
14
+ export declare const defineSlot: <TContext extends Struct = Struct, TKind extends UiSlotKind = UiSlotKind>(id: string, options: SlotOptions<TKind>) => SlotRef<TContext, TKind>;
@@ -0,0 +1,117 @@
1
+ import type { JsonObject, JsonValue, Struct } from "./json";
2
+ import type { RepoContext, ResourceRef } from "./resources";
3
+ import type { SlotInvocationContext } from "./slots";
4
+ export type CommandSource = "cli" | "dashboard" | "api" | "schedule" | "event" | "automation" | "command-panel";
5
+ export interface CommandRef<TParams extends Struct = Struct, TResult = unknown> {
6
+ id: string;
7
+ params?: TParams;
8
+ result?: TResult;
9
+ }
10
+ export interface SerializedError {
11
+ name?: string;
12
+ message: string;
13
+ stack?: string;
14
+ cause?: JsonValue;
15
+ }
16
+ export interface CommandInvocation<TParams extends Struct = Struct> {
17
+ params: TParams;
18
+ resource?: ResourceRef;
19
+ repoId?: string;
20
+ repoPath?: string;
21
+ slot?: SlotInvocationContext;
22
+ metadata?: JsonObject;
23
+ }
24
+ export interface CommandContinue {
25
+ type: "continue";
26
+ }
27
+ export interface CommandPatchParams<TParams extends Struct = Struct> {
28
+ type: "patchParams";
29
+ params: Partial<TParams>;
30
+ }
31
+ export interface CommandReplaceParams<TParams extends Struct = Struct> {
32
+ type: "replaceParams";
33
+ params: TParams;
34
+ }
35
+ export interface CommandReplaceInvocation<TParams extends Struct = Struct> {
36
+ type: "replaceInvocation";
37
+ invocation: CommandInvocation<TParams>;
38
+ }
39
+ export interface CommandReject {
40
+ type: "reject";
41
+ code?: string;
42
+ reason: string;
43
+ data?: JsonObject;
44
+ }
45
+ export type CommandMiddlewareResult<TParams extends Struct = Struct> = void | CommandContinue | CommandPatchParams<TParams> | CommandReplaceParams<TParams> | CommandReplaceInvocation<TParams> | CommandReject;
46
+ export interface CommandNotice {
47
+ type: "info" | "success" | "warning" | "error";
48
+ title?: string;
49
+ message: string;
50
+ metadata?: JsonObject;
51
+ }
52
+ export interface CommandDiagnostic {
53
+ code: string;
54
+ message: string;
55
+ severity: "info" | "warning" | "error";
56
+ extensionId?: string;
57
+ commandId?: string;
58
+ metadata?: JsonObject;
59
+ }
60
+ export type CommandOutcome<TResult = unknown> = {
61
+ ok: true;
62
+ status: "success";
63
+ value: TResult;
64
+ notices?: CommandNotice[];
65
+ diagnostics?: CommandDiagnostic[];
66
+ } | {
67
+ ok: false;
68
+ status: "rejected";
69
+ code?: string;
70
+ reason: string;
71
+ data?: JsonObject;
72
+ notices?: CommandNotice[];
73
+ diagnostics?: CommandDiagnostic[];
74
+ } | {
75
+ ok: false;
76
+ status: "error";
77
+ code?: string;
78
+ reason: string;
79
+ error?: SerializedError;
80
+ notices?: CommandNotice[];
81
+ diagnostics?: CommandDiagnostic[];
82
+ };
83
+ export interface CommandHelpersApi {
84
+ execute<TParams extends Struct = Struct, TResult = unknown>(command: CommandRef<TParams, TResult> | string, invocation: CommandInvocation<TParams>): Promise<CommandOutcome<TResult>>;
85
+ continue(): CommandContinue;
86
+ patchParams<TParams extends Struct = Struct>(params: Partial<TParams>): CommandPatchParams<TParams>;
87
+ replaceParams<TParams extends Struct = Struct>(params: TParams): CommandReplaceParams<TParams>;
88
+ replaceInvocation<TParams extends Struct = Struct>(invocation: CommandInvocation<TParams>): CommandReplaceInvocation<TParams>;
89
+ reject(input: Omit<CommandReject, "type">): CommandReject;
90
+ }
91
+ export interface CommandRequestedEvent<TParams extends Struct = Struct> {
92
+ commandId: string;
93
+ invocationId: string;
94
+ source?: CommandSource;
95
+ params: TParams;
96
+ resource?: ResourceRef;
97
+ repo?: RepoContext;
98
+ }
99
+ export interface CommandStartedEvent<TParams extends Struct = Struct> extends CommandRequestedEvent<TParams> {
100
+ }
101
+ export interface CommandCompletedEvent<TParams extends Struct = Struct, TResult = unknown> extends CommandStartedEvent<TParams> {
102
+ result: TResult;
103
+ elapsedMs: number;
104
+ }
105
+ export interface CommandRejectedEvent<TParams extends Struct = Struct> extends CommandRequestedEvent<TParams> {
106
+ code?: string;
107
+ reason: string;
108
+ data?: JsonObject;
109
+ }
110
+ export interface CommandFailedEvent<TParams extends Struct = Struct> extends CommandRequestedEvent<TParams> {
111
+ code?: string;
112
+ reason: string;
113
+ error?: SerializedError;
114
+ elapsedMs: number;
115
+ }
116
+ export type CommandLifecyclePhase = "requested" | "started" | "completed" | "rejected" | "failed";
117
+ export type CommandLifecycleEventPayload<TPhase extends CommandLifecyclePhase, TParams extends Struct = Struct, TResult = unknown> = TPhase extends "requested" ? CommandRequestedEvent<TParams> : TPhase extends "started" ? CommandStartedEvent<TParams> : TPhase extends "completed" ? CommandCompletedEvent<TParams, TResult> : TPhase extends "rejected" ? CommandRejectedEvent<TParams> : CommandFailedEvent<TParams>;
@@ -0,0 +1,188 @@
1
+ import type { CommandHelpersApi, CommandInvocation, CommandMiddlewareResult, CommandNotice, CommandSource } from "./commands";
2
+ import type { EventDeliveryResult, EventRef } from "./events";
3
+ import type { JsonObject, MaybePromise, Struct } from "./json";
4
+ import type { RepoContext, ResourceAnchor, ResourceRef } from "./resources";
5
+ import type { SlotInvocationContext } from "./slots";
6
+ export interface ExtensionStorageCollectionApi<TItem = unknown> {
7
+ get(id: string): Promise<TItem | undefined>;
8
+ list(): Promise<TItem[]>;
9
+ put(id: string, value: TItem): Promise<void>;
10
+ create(value: TItem): Promise<TItem & {
11
+ id: string;
12
+ }>;
13
+ delete(id: string): Promise<void>;
14
+ }
15
+ export type StorageScope = {
16
+ type: "project";
17
+ } | {
18
+ type: "repo";
19
+ repoId?: string;
20
+ } | {
21
+ type: "resource";
22
+ resource?: ResourceRef;
23
+ } | {
24
+ type: string;
25
+ id?: string;
26
+ };
27
+ export interface ExtensionStorageApi {
28
+ scope(scope: StorageScope): ExtensionStorageApi;
29
+ get<T = unknown>(key: string): Promise<T | undefined>;
30
+ set<T = unknown>(key: string, value: T): Promise<void>;
31
+ delete(key: string): Promise<void>;
32
+ collection<TItem = unknown>(name: string): ExtensionStorageCollectionApi<TItem>;
33
+ }
34
+ export interface ArtifactFile {
35
+ path: string;
36
+ size?: number;
37
+ updatedAt?: string;
38
+ }
39
+ export interface ArtifactMount {
40
+ exists(path: string): Promise<boolean>;
41
+ readText(path: string): Promise<string>;
42
+ writeText(path: string, value: string): Promise<void>;
43
+ readBytes(path: string): Promise<Uint8Array>;
44
+ writeBytes(path: string, value: Uint8Array): Promise<void>;
45
+ list(pattern?: string): Promise<ArtifactFile[]>;
46
+ listDirs(path?: string): Promise<string[]>;
47
+ delete(path: string): Promise<void>;
48
+ }
49
+ export interface ExtensionArtifactApi {
50
+ mount(key: string): ArtifactMount;
51
+ }
52
+ export interface ExtensionFilesApi {
53
+ readText(fileId: string): Promise<string>;
54
+ writeText(fileId: string, value: string): Promise<void>;
55
+ createText(input: {
56
+ name: string;
57
+ content: string;
58
+ metadata?: JsonObject;
59
+ }): Promise<{
60
+ id: string;
61
+ }>;
62
+ delete(fileId: string): Promise<void>;
63
+ }
64
+ export interface ExtensionSessionsApi {
65
+ create(input: {
66
+ title: string;
67
+ prompt?: string;
68
+ template?: string;
69
+ vars?: JsonObject;
70
+ harness?: unknown;
71
+ workspaceId?: string;
72
+ repoId?: string;
73
+ anchors?: ResourceAnchor[];
74
+ originalSessionId?: string;
75
+ }): Promise<{
76
+ id: string;
77
+ }>;
78
+ followup(input: {
79
+ sessionId: string;
80
+ prompt?: string;
81
+ template?: string;
82
+ vars?: JsonObject;
83
+ }): Promise<void>;
84
+ }
85
+ export interface ExtensionWorkspacesApi {
86
+ get(id: string): Promise<unknown>;
87
+ create(input: JsonObject): Promise<unknown>;
88
+ archive(id: string): Promise<void>;
89
+ delete(id: string): Promise<void>;
90
+ }
91
+ export interface ExtensionReposApi {
92
+ list(): Promise<RepoContext[]>;
93
+ get(repoId: string): Promise<RepoContext>;
94
+ getDefault(): Promise<RepoContext | undefined>;
95
+ resolvePath(repoId: string, relativePath: string, options?: {
96
+ basePath?: string;
97
+ }): Promise<string>;
98
+ }
99
+ export interface ExtensionEventsApi {
100
+ emit<TPayload extends Struct>(event: EventRef<TPayload> | string, payload: TPayload): Promise<EventDeliveryResult>;
101
+ }
102
+ export interface ExtensionActivityApi {
103
+ record(input: {
104
+ message: string;
105
+ target?: ResourceRef;
106
+ related?: ResourceRef[];
107
+ metadata?: JsonObject;
108
+ }): Promise<{
109
+ id: string;
110
+ }>;
111
+ }
112
+ export interface ExtensionNotifyApi {
113
+ toast(notice: CommandNotice): Promise<void>;
114
+ }
115
+ export interface ProcessRunResult {
116
+ exitCode: number;
117
+ stdout: string;
118
+ stderr: string;
119
+ }
120
+ export interface ExtensionProcessApi {
121
+ run(input: {
122
+ command: string[];
123
+ cwd?: string;
124
+ env?: Record<string, string>;
125
+ timeoutMs?: number;
126
+ }): Promise<ProcessRunResult>;
127
+ spawnDetached(input: {
128
+ command: string[];
129
+ cwd?: string;
130
+ env?: Record<string, string>;
131
+ }): Promise<{
132
+ pid?: number;
133
+ }>;
134
+ }
135
+ export interface ExtensionNetApi {
136
+ findFreePort(input?: {
137
+ host?: string;
138
+ }): Promise<number>;
139
+ }
140
+ export interface ExtensionLoggerApi {
141
+ info(message: string, metadata?: JsonObject): void;
142
+ warn(message: string, metadata?: JsonObject): void;
143
+ error(message: string, metadata?: JsonObject): void;
144
+ }
145
+ export interface ExtensionSettingsApi<TSettings extends Struct = Struct> {
146
+ all(): Promise<Partial<TSettings>>;
147
+ get<TKey extends keyof TSettings>(key: TKey): Promise<TSettings[TKey] | undefined>;
148
+ set<TKey extends keyof TSettings>(key: TKey, value: TSettings[TKey]): Promise<void>;
149
+ delete<TKey extends keyof TSettings>(key: TKey): Promise<void>;
150
+ }
151
+ export interface ExtensionContextBase {
152
+ projectId: string;
153
+ extensionId: string;
154
+ namespace: string;
155
+ repo?: RepoContext;
156
+ source?: CommandSource;
157
+ storage: ExtensionStorageApi;
158
+ artifacts: ExtensionArtifactApi;
159
+ files: ExtensionFilesApi;
160
+ sessions: ExtensionSessionsApi;
161
+ workspaces: ExtensionWorkspacesApi;
162
+ repos: ExtensionReposApi;
163
+ commands: CommandHelpersApi;
164
+ events: ExtensionEventsApi;
165
+ activity: ExtensionActivityApi;
166
+ notify: ExtensionNotifyApi;
167
+ process: ExtensionProcessApi;
168
+ net: ExtensionNetApi;
169
+ logger: ExtensionLoggerApi;
170
+ settings: ExtensionSettingsApi;
171
+ }
172
+ export interface CommandContext<TParams extends Struct = Struct> extends ExtensionContextBase {
173
+ commandId: string;
174
+ invocationId: string;
175
+ invocation: CommandInvocation<TParams>;
176
+ resource?: ResourceRef;
177
+ slot?: SlotInvocationContext;
178
+ params: TParams;
179
+ }
180
+ export type CommandMiddlewareContext<TParams extends Struct = Struct> = CommandContext<TParams>;
181
+ export type CommandMiddlewareHandler<TParams extends Struct = Struct> = (ctx: CommandMiddlewareContext<TParams>) => MaybePromise<CommandMiddlewareResult<TParams>>;
182
+ export type CommandRunHandler<TParams extends Struct = Struct, TResult = unknown> = (ctx: CommandContext<TParams>) => MaybePromise<TResult>;
183
+ export interface EventContext extends ExtensionContextBase {
184
+ eventId: string;
185
+ deliveryId: string;
186
+ }
187
+ export type SetupContext = ExtensionContextBase;
188
+ export type MigrationContext = ExtensionContextBase;
@@ -0,0 +1,92 @@
1
+ import type { CommandRef, CommandSource } from "./commands";
2
+ import type { JsonObject, Struct } from "./json";
3
+ import type { PackageAssetDescriptor } from "./resources";
4
+ import type { SlotRef } from "./slots";
5
+ export interface CliContribution {
6
+ path?: string[];
7
+ globalAliases?: string[][];
8
+ description?: string;
9
+ examples?: string[];
10
+ hidden?: boolean;
11
+ }
12
+ export interface WhenExpression {
13
+ source?: CommandSource[];
14
+ resourceType?: string[];
15
+ metadata?: JsonObject;
16
+ }
17
+ export interface CommandPanelContribution {
18
+ group?: string;
19
+ keywords?: string[];
20
+ when?: WhenExpression;
21
+ }
22
+ export interface MenuContribution<TSlotContext extends Struct = Struct, TParams extends Struct = Struct> {
23
+ slot: SlotRef<TSlotContext, "menu"> | string;
24
+ label?: string;
25
+ group?: string;
26
+ placement?: "first" | "default" | "last";
27
+ icon?: string;
28
+ when?: WhenExpression;
29
+ command?: CommandRef<TParams, unknown> | string;
30
+ params?: Partial<TParams>;
31
+ presentation?: "menu-item" | "button" | "icon-button";
32
+ }
33
+ export interface NavigationContribution<TSlotContext extends Struct = Struct, TParams extends Struct = Struct> {
34
+ slot: SlotRef<TSlotContext, "navigation"> | string;
35
+ label: string;
36
+ group?: string;
37
+ placement?: "first" | "default" | "last";
38
+ route?: string;
39
+ href?: string;
40
+ command?: CommandRef<TParams, unknown> | string;
41
+ params?: Partial<TParams>;
42
+ icon?: string;
43
+ when?: WhenExpression;
44
+ }
45
+ export interface WebviewContribution {
46
+ entry: PackageAssetDescriptor;
47
+ title?: string;
48
+ sandbox?: "default" | "strict";
49
+ }
50
+ export interface ViewContribution<TSlotContext extends Struct = Struct> {
51
+ title: string;
52
+ slot: SlotRef<TSlotContext, "view"> | string;
53
+ group?: string;
54
+ placement?: "first" | "default" | "last";
55
+ webview: WebviewContribution;
56
+ }
57
+ export interface RouteContribution {
58
+ path: string;
59
+ label: string;
60
+ webview: WebviewContribution;
61
+ }
62
+ export interface SettingsPanelContribution<TSlotContext extends Struct = Struct> {
63
+ title: string;
64
+ slot: SlotRef<TSlotContext, "settings"> | string;
65
+ webview: WebviewContribution;
66
+ }
67
+ export interface RendererContribution<TSlotContext extends Struct = Struct> {
68
+ slot: SlotRef<TSlotContext, "renderer"> | string;
69
+ for: string;
70
+ webview: WebviewContribution;
71
+ }
72
+ export interface ArtifactMountContribution {
73
+ /** Relative path under .pstdio/<extension.namespace>/. */
74
+ path: string;
75
+ label: string;
76
+ repoRole?: "default" | "selected" | "workspace";
77
+ }
78
+ export interface TemplateTypeContribution {
79
+ label: string;
80
+ description?: string;
81
+ }
82
+ export interface TemplateContribution {
83
+ title: string;
84
+ type: string;
85
+ source: PackageAssetDescriptor;
86
+ description?: string;
87
+ }
88
+ export interface SkillContribution {
89
+ title: string;
90
+ source: PackageAssetDescriptor;
91
+ description?: string;
92
+ }
@@ -0,0 +1,10 @@
1
+ import type { CommandDiagnostic } from "./commands";
2
+ import type { Struct } from "./json";
3
+ export interface EventRef<TPayload extends Struct = Struct> {
4
+ id: string;
5
+ payload?: TPayload;
6
+ }
7
+ export interface EventDeliveryResult {
8
+ delivered: number;
9
+ diagnostics?: CommandDiagnostic[];
10
+ }
@@ -0,0 +1,158 @@
1
+ import type { CommandRef } from "./commands";
2
+ import type { CommandMiddlewareHandler, CommandRunHandler, EventContext, ExtensionContextBase, MigrationContext, SetupContext } from "./context";
3
+ import type { ArtifactMountContribution, CliContribution, CommandPanelContribution, MenuContribution, NavigationContribution, RendererContribution, RouteContribution, SettingsPanelContribution, SkillContribution, TemplateContribution, TemplateTypeContribution, ViewContribution } from "./contributions";
4
+ import type { EventRef } from "./events";
5
+ import type { JsonObject, MaybePromise, Struct } from "./json";
6
+ import type { ParamObjectSchema, ParamsOf } from "./params";
7
+ import type { SlotRef } from "./slots";
8
+ /** API version of an extension's manifest. The runtime uses this to detect old extensions. */
9
+ export type ExtensionApiVersion = "1";
10
+ type SchemaParams<TSchema extends ParamObjectSchema | undefined> = TSchema extends ParamObjectSchema ? ParamsOf<TSchema> : Struct;
11
+ /**
12
+ * A command exposed by an extension. The `params` schema (typed via `params.*`) drives
13
+ * the inferred shape of `ctx.params` in `run`.
14
+ */
15
+ export interface CommandDefinition<TSchema extends ParamObjectSchema | undefined = ParamObjectSchema | undefined, TResult = unknown> {
16
+ title: string;
17
+ description?: string;
18
+ params?: TSchema;
19
+ /** Defaults to true. */
20
+ commandPanel?: boolean | CommandPanelContribution;
21
+ menus?: MenuContribution[];
22
+ cli?: boolean | CliContribution;
23
+ run: CommandRunHandler<SchemaParams<TSchema>, TResult>;
24
+ }
25
+ /**
26
+ * Middleware that runs before a command. Use `command` for a typed `CommandRef`; use
27
+ * `commandId` only when referencing a command from another extension you don't import.
28
+ */
29
+ export interface MiddlewareDefinition<TParams extends Struct = Struct, TResult = unknown> {
30
+ command?: CommandRef<TParams, TResult>;
31
+ commandId?: string;
32
+ handler: CommandMiddlewareHandler<TParams>;
33
+ }
34
+ /**
35
+ * A handler for an event. Use `event` for a typed `EventRef`; use `eventId` for events
36
+ * you cannot import (e.g. originating in another extension).
37
+ */
38
+ export interface HookDefinition<TPayload extends Struct = Struct> {
39
+ event?: EventRef<TPayload>;
40
+ eventId?: string;
41
+ handler(ctx: EventContext, payload: TPayload): MaybePromise<void>;
42
+ }
43
+ export interface ScheduleContribution<TParams extends Struct = Struct> {
44
+ title: string;
45
+ cron: string;
46
+ command?: CommandRef<TParams, unknown>;
47
+ commandId?: string;
48
+ params?: TParams;
49
+ repoId?: string;
50
+ repoPath?: string;
51
+ disabled?: boolean;
52
+ }
53
+ export interface HarnessDetectionResult {
54
+ available: boolean;
55
+ version?: string;
56
+ reason?: string;
57
+ }
58
+ export interface HarnessRun {
59
+ runId: string;
60
+ pid?: number;
61
+ metadata?: JsonObject;
62
+ }
63
+ export interface HarnessProvider {
64
+ id: string;
65
+ label: string;
66
+ detect?(ctx: ExtensionContextBase): MaybePromise<HarnessDetectionResult>;
67
+ start(ctx: ExtensionContextBase, input: {
68
+ workspacePath: string;
69
+ sessionId: string;
70
+ prompt?: string;
71
+ }): MaybePromise<HarnessRun>;
72
+ send?(ctx: ExtensionContextBase, input: {
73
+ runId: string;
74
+ message: string;
75
+ }): MaybePromise<void>;
76
+ stop?(ctx: ExtensionContextBase, input: {
77
+ runId: string;
78
+ }): MaybePromise<void>;
79
+ }
80
+ export interface WorkspaceTypeProvider {
81
+ id: string;
82
+ label: string;
83
+ create(ctx: ExtensionContextBase, input: JsonObject): MaybePromise<JsonObject>;
84
+ resolve(ctx: ExtensionContextBase, workspace: JsonObject): MaybePromise<{
85
+ rootPath: string;
86
+ displayPath?: string;
87
+ }>;
88
+ archive?(ctx: ExtensionContextBase, workspace: JsonObject): MaybePromise<void>;
89
+ delete?(ctx: ExtensionContextBase, workspace: JsonObject): MaybePromise<void>;
90
+ }
91
+ export interface LocalExtensionSource {
92
+ name: string;
93
+ path: string;
94
+ origin?: string;
95
+ installedAt: string;
96
+ updatedAt: string;
97
+ }
98
+ export interface ProjectExtensionInstance {
99
+ projectId: string;
100
+ extensionId: string;
101
+ namespace: string;
102
+ sourceName: string;
103
+ enabled: boolean;
104
+ config: JsonObject;
105
+ }
106
+ /** Identifying metadata for an extension. */
107
+ export interface ExtensionMetadata {
108
+ id: string;
109
+ namespace: string;
110
+ name: string;
111
+ version?: string;
112
+ description?: string;
113
+ /** Manifest API version. The runtime uses this to detect incompatible extensions. */
114
+ apiVersion: ExtensionApiVersion;
115
+ settings?: ParamObjectSchema;
116
+ }
117
+ /** UI surface contributions: slots, routes, panels, renderers. */
118
+ export interface UiContributions {
119
+ slots?: Record<string, SlotRef>;
120
+ routes?: Record<string, RouteContribution>;
121
+ views?: Record<string, ViewContribution>;
122
+ navigation?: Record<string, NavigationContribution>;
123
+ settingsPanels?: Record<string, SettingsPanelContribution>;
124
+ activityRenderers?: Record<string, RendererContribution>;
125
+ sessionAnchorRenderers?: Record<string, RendererContribution>;
126
+ }
127
+ /** Behavioural surface: commands, middleware, hooks, schedules. */
128
+ export interface BehaviourContributions {
129
+ commands?: Record<string, CommandDefinition<any, any>>;
130
+ middlewares?: Record<string, MiddlewareDefinition<any, any>>;
131
+ hooks?: Record<string, HookDefinition<any>>;
132
+ schedules?: Record<string, ScheduleContribution<any>>;
133
+ }
134
+ /** Static asset contributions: artifact mounts, templates, skills. */
135
+ export interface AssetContributions {
136
+ artifactMounts?: Record<string, ArtifactMountContribution>;
137
+ templateTypes?: Record<string, TemplateTypeContribution>;
138
+ templates?: Record<string, TemplateContribution>;
139
+ skills?: Record<string, SkillContribution>;
140
+ }
141
+ /** Provider contributions: harnesses, workspace types. */
142
+ export interface ProviderContributions {
143
+ workspaceTypes?: Record<string, WorkspaceTypeProvider>;
144
+ harnesses?: Record<string, HarnessProvider>;
145
+ }
146
+ /** Lifecycle hooks invoked by the runtime when an extension is installed or upgraded. */
147
+ export interface ExtensionLifecycle {
148
+ initialSetup?: (ctx: SetupContext) => MaybePromise<void>;
149
+ migrate?: (ctx: MigrationContext, fromVersion: string | null) => MaybePromise<void>;
150
+ }
151
+ /**
152
+ * The full shape of an extension manifest. Composed from focused capability mixins so
153
+ * each surface is independently discoverable.
154
+ */
155
+ export interface ExtensionDefinition extends ExtensionMetadata, UiContributions, BehaviourContributions, AssetContributions, ProviderContributions, ExtensionLifecycle {
156
+ }
157
+ export type ExtensionSourceKind = "local" | "package" | "builtin";
158
+ export {};
@@ -0,0 +1,9 @@
1
+ export type * from "./commands";
2
+ export type * from "./context";
3
+ export type * from "./contributions";
4
+ export type * from "./events";
5
+ export type * from "./extension";
6
+ export type * from "./json";
7
+ export type * from "./params";
8
+ export type * from "./resources";
9
+ export type * from "./slots";
@@ -0,0 +1,7 @@
1
+ export type JsonPrimitive = string | number | boolean | null;
2
+ export type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
3
+ export type JsonObject = {
4
+ [key: string]: JsonValue;
5
+ };
6
+ export type MaybePromise<T> = T | Promise<T>;
7
+ export type Struct = object;
@@ -0,0 +1,66 @@
1
+ import type { JsonObject } from "./json";
2
+ import type { ResourceRef } from "./resources";
3
+ export type ParamType = "text" | "longtext" | "number" | "boolean" | "select" | "multi-select" | "repo" | "harness" | "template" | "resource" | "json";
4
+ interface ParamBase<TValue> {
5
+ label?: string;
6
+ description?: string;
7
+ required?: boolean;
8
+ defaultValue?: TValue;
9
+ metadata?: JsonObject;
10
+ }
11
+ export interface TextParam extends ParamBase<string> {
12
+ type: "text";
13
+ }
14
+ export interface LongTextParam extends ParamBase<string> {
15
+ type: "longtext";
16
+ }
17
+ export interface NumberParam extends ParamBase<number> {
18
+ type: "number";
19
+ }
20
+ export interface BooleanParam extends ParamBase<boolean> {
21
+ type: "boolean";
22
+ }
23
+ export interface SelectParam extends ParamBase<string> {
24
+ type: "select";
25
+ options: Array<{
26
+ label: string;
27
+ value: string;
28
+ }>;
29
+ }
30
+ export interface MultiSelectParam extends ParamBase<string[]> {
31
+ type: "multi-select";
32
+ options: Array<{
33
+ label: string;
34
+ value: string;
35
+ }>;
36
+ }
37
+ export interface RepoParam extends ParamBase<{
38
+ repoId: string;
39
+ branch?: string;
40
+ }> {
41
+ type: "repo";
42
+ }
43
+ export interface HarnessParam extends ParamBase<{
44
+ harnessId: string;
45
+ model?: string;
46
+ }> {
47
+ type: "harness";
48
+ }
49
+ export interface TemplateParam extends ParamBase<string> {
50
+ type: "template";
51
+ templateType: string;
52
+ }
53
+ export interface ResourceParam extends ParamBase<ResourceRef> {
54
+ type: "resource";
55
+ resourceType: string;
56
+ }
57
+ export interface JsonParam<T = unknown> extends ParamBase<T> {
58
+ type: "json";
59
+ }
60
+ export type ParamDescriptor<TValue = unknown> = TextParam | LongTextParam | NumberParam | BooleanParam | SelectParam | MultiSelectParam | RepoParam | HarnessParam | TemplateParam | ResourceParam | JsonParam<TValue>;
61
+ export type ParamObjectSchema = Record<string, ParamDescriptor>;
62
+ export type ParamValue<TDescriptor extends ParamDescriptor> = TDescriptor extends ParamDescriptor<infer V> ? V : never;
63
+ export type ParamsOf<TSchema extends ParamObjectSchema> = {
64
+ [K in keyof TSchema]: ParamValue<TSchema[K]>;
65
+ };
66
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { JsonObject } from "./json";
2
+ export type ResourceRole = "primary" | "context" | "source" | "result";
3
+ export interface ResourceRef {
4
+ type: string;
5
+ id: string;
6
+ projectId?: string;
7
+ label?: string;
8
+ extensionId?: string;
9
+ metadata?: JsonObject;
10
+ }
11
+ export interface ResourceAnchor extends ResourceRef {
12
+ role?: ResourceRole;
13
+ }
14
+ export interface RepoContext {
15
+ projectId: string;
16
+ repoId: string;
17
+ path: string;
18
+ remote?: string | null;
19
+ role?: "default" | "selected" | "workspace";
20
+ }
21
+ export interface PackageAssetDescriptor {
22
+ kind: "package-asset";
23
+ path: string;
24
+ baseUrl: string;
25
+ }
@@ -0,0 +1,22 @@
1
+ import type { JsonObject, Struct } from "./json";
2
+ export type UiSlotKind = "menu" | "navigation" | "view" | "settings" | "renderer";
3
+ export interface SlotOptions<TKind extends UiSlotKind = UiSlotKind> {
4
+ kind: TKind;
5
+ label?: string;
6
+ description?: string;
7
+ metadata?: JsonObject;
8
+ }
9
+ export interface SlotRef<TContext extends Struct = Struct, TKind extends UiSlotKind = UiSlotKind> {
10
+ id: string;
11
+ kind: TKind;
12
+ label?: string;
13
+ description?: string;
14
+ metadata?: JsonObject;
15
+ /** Phantom field used to constrain compatible contributions; never populated at runtime. */
16
+ context?: TContext;
17
+ }
18
+ export interface SlotInvocationContext<TContext extends Struct = Struct> {
19
+ id: string;
20
+ kind: UiSlotKind;
21
+ context: TContext;
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pstdio/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/pufflyai/prompt-studio"
@@ -25,6 +25,10 @@
25
25
  "import": "./dist/client/index.js",
26
26
  "types": "./dist/client/index.d.ts"
27
27
  },
28
+ "./extensions": {
29
+ "import": "./dist/extensions/index.js",
30
+ "types": "./dist/extensions/index.d.ts"
31
+ },
28
32
  "./plugins": {
29
33
  "import": "./dist/plugins/index.js",
30
34
  "types": "./dist/plugins/index.d.ts"
@@ -40,7 +44,7 @@
40
44
  },
41
45
  "scripts": {
42
46
  "build": "rm -rf ./dist && bun run build:js && bun run build:types",
43
- "build:js": "bun build ./src/api/index.ts ./src/client/index.ts ./src/plugins/index.ts ./src/prompts/index.ts ./src/hooks/index.ts ./src/resources/index.ts --outdir ./dist --root ./src --target node --format esm --packages external",
47
+ "build:js": "bun build ./src/api/index.ts ./src/client/index.ts ./src/extensions/index.ts ./src/plugins/index.ts ./src/prompts/index.ts ./src/hooks/index.ts ./src/resources/index.ts --outdir ./dist --root ./src --target node --format esm --packages external",
44
48
  "build:types": "tsc --project ./tsconfig.build.json",
45
49
  "prepack": "bun run build",
46
50
  "typecheck": "tsc --noEmit",