@gitterm/sdk 0.6.1 → 0.7.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.
@@ -31,51 +31,88 @@ export type DirectOAuthModelCredential = {
31
31
  enterpriseUrl?: string;
32
32
  };
33
33
  export type DirectModelCredential = DirectApiModelCredential | DirectOAuthModelCredential;
34
- export type DirectAuthPrompt = {
35
- type: "text";
34
+ type DirectAuthPromptBase = {
36
35
  key: string;
37
- message: string;
38
- placeholder?: string;
39
- when?: {
36
+ title?: string;
37
+ description?: string;
38
+ required?: boolean;
39
+ hidden?: boolean;
40
+ /** Show the field only when every condition holds for an earlier answer. */
41
+ when?: Array<{
40
42
  key: string;
41
43
  op: "eq" | "neq";
42
- value: string;
43
- };
44
- } | {
45
- type: "select";
46
- key: string;
47
- message: string;
48
- options: Array<{
49
- label: string;
50
- value: string;
51
- hint?: string;
44
+ value: string | number | boolean;
52
45
  }>;
53
- when?: {
54
- key: string;
55
- op: "eq" | "neq";
56
- value: string;
57
- };
58
46
  };
47
+ type DirectAuthPromptOption = {
48
+ value: string;
49
+ label: string;
50
+ description?: string;
51
+ };
52
+ type DirectAuthPromptNumber = number | "Infinity" | "-Infinity" | "NaN";
53
+ /** A field an OAuth or key method asks for (OpenCode 2 `FormField`); answer it with `connectOAuth({ inputs })`. */
54
+ export type DirectAuthPrompt = (DirectAuthPromptBase & {
55
+ type: "string";
56
+ format?: "email" | "uri" | "date" | "date-time";
57
+ minLength?: number;
58
+ maxLength?: number;
59
+ pattern?: string;
60
+ placeholder?: string;
61
+ default?: string;
62
+ options?: DirectAuthPromptOption[];
63
+ custom?: boolean;
64
+ }) | (DirectAuthPromptBase & {
65
+ type: "number" | "integer";
66
+ minimum?: DirectAuthPromptNumber;
67
+ maximum?: DirectAuthPromptNumber;
68
+ default?: DirectAuthPromptNumber;
69
+ }) | (DirectAuthPromptBase & {
70
+ type: "boolean";
71
+ default?: boolean;
72
+ }) | (DirectAuthPromptBase & {
73
+ type: "multiselect";
74
+ options: DirectAuthPromptOption[];
75
+ minItems?: number;
76
+ maxItems?: number;
77
+ custom?: boolean;
78
+ default?: string[];
79
+ }) | {
80
+ key: string;
81
+ type: "external";
82
+ url: string;
83
+ title?: string;
84
+ description?: string;
85
+ };
86
+ /** OpenCode 2 `IntegrationMethod`. */
59
87
  export type DirectAuthMethod = {
60
88
  type: "oauth";
61
89
  id: string;
62
90
  label: string;
63
- prompts?: DirectAuthPrompt[];
91
+ form?: DirectAuthPrompt[];
92
+ } | {
93
+ type: "command";
94
+ id: string;
95
+ label: string;
96
+ command: string[];
64
97
  } | {
65
98
  type: "key";
66
99
  label?: string;
100
+ form?: DirectAuthPrompt[];
67
101
  } | {
68
102
  type: "env";
69
103
  names: string[];
70
104
  };
105
+ /** OpenCode 2 `IntegrationInfo`. */
71
106
  export type DirectAuthIntegration = {
72
107
  id: string;
73
108
  name: string;
109
+ metadata?: Record<string, unknown>;
74
110
  methods: DirectAuthMethod[];
75
111
  connections: Array<{
76
112
  type: "credential";
77
113
  id: string;
78
114
  label: string;
115
+ method: "key" | "oauth";
79
116
  } | {
80
117
  type: "env";
81
118
  name: string;
@@ -321,3 +358,4 @@ export type DirectRun = AgentRun & {
321
358
  };
322
359
  export type DirectRunMessage = AgentRunMessage;
323
360
  export type DirectRunWaitOptions = RunWaitOptions;
361
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitterm/sdk",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -25,14 +25,13 @@
25
25
  "access": "public"
26
26
  },
27
27
  "scripts": {
28
- "build": "rm -rf dist && bun build src/index.ts src/direct/index.ts --outdir dist --target node --format esm --external @trpc/client --external eventsource --external @opencode-ai/sdk --external @opencode-ai/sdk/v2 --external e2b --external @asciidev/box-sdk --external @daytonaio/sdk --external @vercel/sandbox && tsc -p tsconfig.build.json",
28
+ "build": "rm -rf dist && bun build src/index.ts src/direct/index.ts --outdir dist --target node --format esm --external @trpc/client --external eventsource --external e2b --external @asciidev/box-sdk --external @daytonaio/sdk --external @vercel/sandbox && tsc -p tsconfig.build.json",
29
29
  "prepublishOnly": "bun run check-types && bun run build",
30
30
  "check-types": "tsc --noEmit"
31
31
  },
32
32
  "dependencies": {
33
33
  "@asciidev/box-sdk": "^0.0.34",
34
34
  "@daytonaio/sdk": "^0.207.0",
35
- "@opencode-ai/sdk": "^1.18.25",
36
35
  "@trpc/client": "^11.8.1",
37
36
  "@vercel/sandbox": "^3.2.1",
38
37
  "e2b": "^2.46.1",
@@ -41,6 +40,7 @@
41
40
  "devDependencies": {
42
41
  "@gitterm/agent-runtime": "workspace:*",
43
42
  "@gitterm/api": "workspace:*",
43
+ "@opencode/client": "^2.0.19",
44
44
  "@trpc/server": "catalog:",
45
45
  "@types/bun": "^1.2.6",
46
46
  "typescript": "^5.8.2"