@engineer-ai/sdk 1.4.2 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { type Config } from "./gen/client/types.gen.js";
3
- import { OpencodeClient } from "./gen/sdk.gen.js";
4
- export { type Config as OpencodeClientConfig, OpencodeClient };
5
- export declare function createOpencodeClient(config?: Config & {
3
+ import { EngineerClient } from "./gen/sdk.gen.js";
4
+ export { type Config as EngineerClientConfig, EngineerClient };
5
+ export declare function createEngineerClient(config?: Config & {
6
6
  directory?: string;
7
- }): OpencodeClient;
7
+ }): EngineerClient;
package/dist/client.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { createClient } from "./gen/client/client.gen.js";
3
- import { OpencodeClient } from "./gen/sdk.gen.js";
4
- export { OpencodeClient };
5
- export function createOpencodeClient(config) {
3
+ import { EngineerClient } from "./gen/sdk.gen.js";
4
+ export { EngineerClient };
5
+ export function createEngineerClient(config) {
6
6
  if (!config?.fetch) {
7
7
  const customFetch = (req) => {
8
8
  // @ts-ignore
@@ -15,11 +15,22 @@ export function createOpencodeClient(config) {
15
15
  };
16
16
  }
17
17
  if (config?.directory) {
18
- config.headers = {
19
- ...config.headers,
20
- "x-engineer-directory": config.directory,
18
+ const directory = config.directory;
19
+ const userFetch = config.fetch;
20
+ // Inject directory as URL query parameter (auto-encoded by URLSearchParams).
21
+ // This avoids HTTP header charset restrictions for non-ASCII paths (e.g. Chinese).
22
+ // The directory held by the client is authoritative: overwrite any existing
23
+ // value that is empty or differs from the client's directory.
24
+ config.fetch = async (input, init) => {
25
+ const request = new Request(input, init);
26
+ const url = new URL(request.url);
27
+ const existing = url.searchParams.get("directory");
28
+ if (!existing || existing !== directory) {
29
+ url.searchParams.set("directory", directory);
30
+ }
31
+ return userFetch(new Request(url.toString(), request));
21
32
  };
22
33
  }
23
34
  const client = createClient(config);
24
- return new OpencodeClient({ client });
35
+ return new EngineerClient({ client });
25
36
  }
@@ -374,7 +374,7 @@ declare class Event extends _HeyApiClient {
374
374
  */
375
375
  subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>): Promise<import("./core/serverSentEvents.gen.js").ServerSentEventsResult<EventSubscribeResponses, unknown>>;
376
376
  }
377
- export declare class OpencodeClient extends _HeyApiClient {
377
+ export declare class EngineerClient extends _HeyApiClient {
378
378
  /**
379
379
  * Respond to a permission request
380
380
  */
@@ -844,7 +844,7 @@ class Event extends _HeyApiClient {
844
844
  });
845
845
  }
846
846
  }
847
- export class OpencodeClient extends _HeyApiClient {
847
+ export class EngineerClient extends _HeyApiClient {
848
848
  /**
849
849
  * Respond to a permission request
850
850
  */
@@ -437,10 +437,6 @@ export type Todo = {
437
437
  * Current status of the task: pending, in_progress, completed, cancelled
438
438
  */
439
439
  status: string;
440
- /**
441
- * Priority level of the task: high, medium, low
442
- */
443
- priority: string;
444
440
  /**
445
441
  * Unique identifier for the todo item
446
442
  */
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export * from "./client.js";
2
2
  export * from "./server.js";
3
3
  import type { ServerOptions } from "./server.js";
4
4
  export declare function createOpencode(options?: ServerOptions): Promise<{
5
- client: import("./client.js").OpencodeClient;
5
+ client: import("./client.js").EngineerClient;
6
6
  server: {
7
7
  url: string;
8
8
  close(): void;
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  export * from "./client.js";
2
2
  export * from "./server.js";
3
- import { createOpencodeClient } from "./client.js";
3
+ import { createEngineerClient } from "./client.js";
4
4
  import { createOpencodeServer } from "./server.js";
5
5
  export async function createOpencode(options) {
6
6
  const server = await createOpencodeServer({
7
7
  ...options,
8
8
  });
9
- const client = createOpencodeClient({
9
+ const client = createEngineerClient({
10
10
  baseUrl: server.url,
11
11
  });
12
12
  return {
@@ -1,7 +1,7 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { type Config } from "./gen/client/types.gen.js";
3
- import { OpencodeClient } from "./gen/sdk.gen.js";
4
- export { type Config as OpencodeClientConfig, OpencodeClient };
5
- export declare function createOpencodeClient(config?: Config & {
3
+ import { EngineerClient } from "./gen/sdk.gen.js";
4
+ export { type Config as EngineerClientConfig, EngineerClient };
5
+ export declare function createEngineerClient(config?: Config & {
6
6
  directory?: string;
7
- }): OpencodeClient;
7
+ }): EngineerClient;
package/dist/v2/client.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export * from "./gen/types.gen.js";
2
2
  import { createClient } from "./gen/client/client.gen.js";
3
- import { OpencodeClient } from "./gen/sdk.gen.js";
4
- export { OpencodeClient };
5
- export function createOpencodeClient(config) {
3
+ import { EngineerClient } from "./gen/sdk.gen.js";
4
+ export { EngineerClient };
5
+ export function createEngineerClient(config) {
6
6
  if (!config?.fetch) {
7
7
  const customFetch = (req) => {
8
8
  // @ts-ignore
@@ -15,13 +15,22 @@ export function createOpencodeClient(config) {
15
15
  };
16
16
  }
17
17
  if (config?.directory) {
18
- const isNonASCII = /[^\x00-\x7F]/.test(config.directory);
19
- const encodedDirectory = isNonASCII ? encodeURIComponent(config.directory) : config.directory;
20
- config.headers = {
21
- ...config.headers,
22
- "x-engineer-directory": encodedDirectory,
18
+ const directory = config.directory;
19
+ const userFetch = config.fetch;
20
+ // Inject directory as URL query parameter (auto-encoded by URLSearchParams).
21
+ // This avoids HTTP header charset restrictions for non-ASCII paths (e.g. Chinese).
22
+ // The directory held by the client is authoritative: overwrite any existing
23
+ // value that is empty or differs from the client's directory.
24
+ config.fetch = async (input, init) => {
25
+ const request = new Request(input, init);
26
+ const url = new URL(request.url);
27
+ const existing = url.searchParams.get("directory");
28
+ if (!existing || existing !== directory) {
29
+ url.searchParams.set("directory", directory);
30
+ }
31
+ return userFetch(new Request(url.toString(), request));
23
32
  };
24
33
  }
25
34
  const client = createClient(config);
26
- return new OpencodeClient({ client });
35
+ return new EngineerClient({ client });
27
36
  }
@@ -1140,8 +1140,8 @@ export declare class Event extends HeyApiClient {
1140
1140
  directory?: string;
1141
1141
  }, options?: Options<never, ThrowOnError>): Promise<import("./core/serverSentEvents.gen.js").ServerSentEventsResult<EventSubscribeResponses, unknown>>;
1142
1142
  }
1143
- export declare class OpencodeClient extends HeyApiClient {
1144
- static readonly __registry: HeyApiRegistry<OpencodeClient>;
1143
+ export declare class EngineerClient extends HeyApiClient {
1144
+ static readonly __registry: HeyApiRegistry<EngineerClient>;
1145
1145
  constructor(args?: {
1146
1146
  client?: Client;
1147
1147
  key?: string;
@@ -13,7 +13,7 @@ class HeyApiRegistry {
13
13
  get(key) {
14
14
  const instance = this.instances.get(key ?? this.defaultKey);
15
15
  if (!instance) {
16
- throw new Error(`No SDK client found. Create one with "new OpencodeClient()" to fix this error.`);
16
+ throw new Error(`No SDK client found. Create one with "new EngineerClient()" to fix this error.`);
17
17
  }
18
18
  return instance;
19
19
  }
@@ -2245,11 +2245,11 @@ export class Event extends HeyApiClient {
2245
2245
  });
2246
2246
  }
2247
2247
  }
2248
- export class OpencodeClient extends HeyApiClient {
2248
+ export class EngineerClient extends HeyApiClient {
2249
2249
  static __registry = new HeyApiRegistry();
2250
2250
  constructor(args) {
2251
2251
  super(args);
2252
- OpencodeClient.__registry.set(this, args?.key);
2252
+ EngineerClient.__registry.set(this, args?.key);
2253
2253
  }
2254
2254
  _global;
2255
2255
  get global() {
@@ -709,10 +709,6 @@ export type Todo = {
709
709
  * Current status of the task
710
710
  */
711
711
  status: "pending" | "in_progress" | "completed" | "cancelled";
712
- /**
713
- * Priority level of the task
714
- */
715
- priority: "high" | "medium" | "low";
716
712
  /**
717
713
  * Present-tense description for UI spinner (e.g. 'Running tests')
718
714
  */
@@ -822,6 +818,21 @@ export type EventTeamWorkerStatusChanged = {
822
818
  currentTask?: string;
823
819
  };
824
820
  };
821
+ export type EventMavenIndexReady = {
822
+ type: "maven.index.ready";
823
+ properties: {
824
+ pomFiles: Array<string>;
825
+ classCount: number;
826
+ coordinateCount: number;
827
+ error?: string;
828
+ };
829
+ };
830
+ export type EventMavenIndexBuilding = {
831
+ type: "maven.index.building";
832
+ properties: {
833
+ pomFiles: Array<string>;
834
+ };
835
+ };
825
836
  export type EventVcsBranchUpdated = {
826
837
  type: "vcs.branch.updated";
827
838
  properties: {
@@ -938,7 +949,7 @@ export type EventPtyDeleted = {
938
949
  id: string;
939
950
  };
940
951
  };
941
- export type Event = EventInstallationUpdated | EventEngineerUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventFileEdited | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventWorktreeReady | EventWorktreeFailed | EventCommandExecuted | EventSkillCreated | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventTaskNotification | EventSessionMemoryExtracted | EventSessionCompacted | EventFileWatcherUpdated | EventRuleCreated | EventTodoUpdated | EventTeamWorkerStarted | EventTeamWorkerStopped | EventTeamTaskAssigned | EventTeamTaskCompleted | EventTeamTaskFailed | EventTeamMessageReceived | EventTeamMemberHired | EventTeamMemberFired | EventTeamWorkerStatusChanged | EventVcsBranchUpdated | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted;
952
+ export type Event = EventInstallationUpdated | EventEngineerUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventServerConnected | EventGlobalDisposed | EventLspClientDiagnostics | EventLspUpdated | EventFileEdited | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionAsked | EventPermissionReplied | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventTuiSessionSelect | EventMcpToolsChanged | EventMcpBrowserOpenFailed | EventWorktreeReady | EventWorktreeFailed | EventCommandExecuted | EventSkillCreated | EventSessionStatus | EventSessionIdle | EventQuestionAsked | EventQuestionReplied | EventQuestionRejected | EventTaskNotification | EventSessionMemoryExtracted | EventSessionCompacted | EventFileWatcherUpdated | EventRuleCreated | EventTodoUpdated | EventTeamWorkerStarted | EventTeamWorkerStopped | EventTeamTaskAssigned | EventTeamTaskCompleted | EventTeamTaskFailed | EventTeamMessageReceived | EventTeamMemberHired | EventTeamMemberFired | EventTeamWorkerStatusChanged | EventMavenIndexReady | EventMavenIndexBuilding | EventVcsBranchUpdated | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted;
942
953
  export type GlobalEvent = {
943
954
  directory: string;
944
955
  payload: Event;
@@ -2,7 +2,7 @@ export * from "./client.js";
2
2
  export * from "./server.js";
3
3
  import type { ServerOptions } from "./server.js";
4
4
  export declare function createOpencode(options?: ServerOptions): Promise<{
5
- client: import("./client.js").OpencodeClient;
5
+ client: import("./client.js").EngineerClient;
6
6
  server: {
7
7
  url: string;
8
8
  close(): void;
package/dist/v2/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  export * from "./client.js";
2
2
  export * from "./server.js";
3
- import { createOpencodeClient } from "./client.js";
3
+ import { createEngineerClient } from "./client.js";
4
4
  import { createOpencodeServer } from "./server.js";
5
5
  export async function createOpencode(options) {
6
6
  const server = await createOpencodeServer({
7
7
  ...options,
8
8
  });
9
- const client = createOpencodeClient({
9
+ const client = createEngineerClient({
10
10
  baseUrl: server.url,
11
11
  });
12
12
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@engineer-ai/sdk",
4
- "version": "1.4.2",
4
+ "version": "1.5.1",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {