sparkecoder 0.1.107 → 0.1.109
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/agent/index.d.ts +3 -3
- package/dist/agent/index.js +14 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/cli.js +109 -12
- package/dist/cli.js.map +1 -1
- package/dist/db/index.d.ts +2 -2
- package/dist/{index-D5l-DMGC.d.ts → index-Biy5JTop.d.ts} +96 -83
- package/dist/index.d.ts +5 -5
- package/dist/index.js +87 -10
- package/dist/index.js.map +1 -1
- package/dist/{schema-ecQSnCMz.d.ts → schema-CYSKJZ3m.d.ts} +3 -3
- package/dist/{search-DOzC4ojH.d.ts → search-CVVfuBPZ.d.ts} +4 -4
- package/dist/server/index.js +87 -10
- package/dist/server/index.js.map +1 -1
- package/dist/tools/index.d.ts +3 -3
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/web/.next/build-manifest.json +2 -2
- package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.html +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
- package/web/.next/standalone/web/.next/server/app/docs.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.html +1 -1
- package/web/.next/standalone/web/.next/server/app/index.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
- package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
- package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
- /package/web/.next/standalone/web/.next/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_ssgManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_buildManifest.js +0 -0
- /package/web/.next/standalone/web/.next/static/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/standalone/web/.next/static/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_ssgManifest.js +0 -0
- /package/web/.next/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_buildManifest.js +0 -0
- /package/web/.next/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{9B80CeRYeYvnsEougmuLs → 56Y89huUkFkd-4Ip1HcYY}/_ssgManifest.js +0 -0
package/dist/db/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Checkpoint, F as FileBackup, M as ModelMessage, a as Message, S as Session, L as LoadedSkill, T as TodoItem, b as ToolExecution, A as ActiveStream, I as IndexStatusRecord, c as IndexedChunk, d as SubagentExecution, e as SubagentStep, f as Terminal } from '../schema-
|
|
2
|
-
export { N as NewActiveStream, g as NewCheckpoint, h as NewFileBackup, i as NewIndexStatusRecord, j as NewIndexedChunk, k as NewMessage, l as NewSession, m as NewSubagentExecution, n as NewTerminal, o as NewTodoItem, p as NewToolExecution, q as SessionConfig, r as TaskConfig, U as UserContentPart, s as UserFilePart, t as UserImagePart, u as UserModelMessage, v as UserTextPart } from '../schema-
|
|
1
|
+
import { C as Checkpoint, F as FileBackup, M as ModelMessage, a as Message, S as Session, L as LoadedSkill, T as TodoItem, b as ToolExecution, A as ActiveStream, I as IndexStatusRecord, c as IndexedChunk, d as SubagentExecution, e as SubagentStep, f as Terminal } from '../schema-CYSKJZ3m.js';
|
|
2
|
+
export { N as NewActiveStream, g as NewCheckpoint, h as NewFileBackup, i as NewIndexStatusRecord, j as NewIndexedChunk, k as NewMessage, l as NewSession, m as NewSubagentExecution, n as NewTerminal, o as NewTodoItem, p as NewToolExecution, q as SessionConfig, r as TaskConfig, U as UserContentPart, s as UserFilePart, t as UserImagePart, u as UserModelMessage, v as UserTextPart } from '../schema-CYSKJZ3m.js';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModelMessage, streamText } from 'ai';
|
|
2
|
-
import { S as Session, b as ToolExecution, r as TaskConfig } from './schema-
|
|
2
|
+
import { S as Session, b as ToolExecution, r as TaskConfig } from './schema-CYSKJZ3m.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from './search-
|
|
4
|
+
import { B as BashToolProgress, W as WriteFileProgress, S as SearchToolProgress } from './search-CVVfuBPZ.js';
|
|
5
5
|
|
|
6
6
|
declare const ToolApprovalConfigSchema: z.ZodObject<{
|
|
7
7
|
bash: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
@@ -38,25 +38,25 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
38
38
|
iterations: z.ZodOptional<z.ZodNumber>;
|
|
39
39
|
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
40
40
|
}, "strip", z.ZodTypeAny, {
|
|
41
|
-
status: "
|
|
41
|
+
status: "running" | "completed" | "failed";
|
|
42
42
|
enabled: boolean;
|
|
43
43
|
outputSchema: Record<string, unknown>;
|
|
44
|
-
error?: string | undefined;
|
|
45
|
-
maxIterations?: number | undefined;
|
|
46
44
|
webhookUrl?: string | undefined;
|
|
47
|
-
|
|
45
|
+
maxIterations?: number | undefined;
|
|
48
46
|
result?: unknown;
|
|
47
|
+
error?: string | undefined;
|
|
49
48
|
iterations?: number | undefined;
|
|
49
|
+
parentTaskId?: string | undefined;
|
|
50
50
|
}, {
|
|
51
|
-
status: "
|
|
51
|
+
status: "running" | "completed" | "failed";
|
|
52
52
|
enabled: boolean;
|
|
53
53
|
outputSchema: Record<string, unknown>;
|
|
54
|
-
error?: string | undefined;
|
|
55
|
-
maxIterations?: number | undefined;
|
|
56
54
|
webhookUrl?: string | undefined;
|
|
57
|
-
|
|
55
|
+
maxIterations?: number | undefined;
|
|
58
56
|
result?: unknown;
|
|
57
|
+
error?: string | undefined;
|
|
59
58
|
iterations?: number | undefined;
|
|
59
|
+
parentTaskId?: string | undefined;
|
|
60
60
|
}>>;
|
|
61
61
|
computerUseEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
62
62
|
computerUseDisplayWidth: z.ZodOptional<z.ZodNumber>;
|
|
@@ -87,20 +87,20 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
87
87
|
lastFiredAt: z.ZodOptional<z.ZodString>;
|
|
88
88
|
createdAt: z.ZodString;
|
|
89
89
|
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
enabled: boolean;
|
|
90
91
|
id: string;
|
|
91
92
|
name: string;
|
|
92
|
-
enabled: boolean;
|
|
93
|
-
createdAt: string;
|
|
94
|
-
prompt: string;
|
|
95
93
|
cron: string;
|
|
94
|
+
prompt: string;
|
|
95
|
+
createdAt: string;
|
|
96
96
|
replyChannel?: string | undefined;
|
|
97
97
|
lastFiredAt?: string | undefined;
|
|
98
98
|
}, {
|
|
99
99
|
id: string;
|
|
100
100
|
name: string;
|
|
101
|
-
createdAt: string;
|
|
102
|
-
prompt: string;
|
|
103
101
|
cron: string;
|
|
102
|
+
prompt: string;
|
|
103
|
+
createdAt: string;
|
|
104
104
|
enabled?: boolean | undefined;
|
|
105
105
|
replyChannel?: string | undefined;
|
|
106
106
|
lastFiredAt?: string | undefined;
|
|
@@ -137,36 +137,36 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
137
137
|
maxContextChars: number;
|
|
138
138
|
toolApprovals?: Record<string, boolean> | undefined;
|
|
139
139
|
approvalWebhook?: string | undefined;
|
|
140
|
-
|
|
141
|
-
channel?: string | undefined;
|
|
142
|
-
threadTs?: string | undefined;
|
|
143
|
-
teamId?: string | undefined;
|
|
144
|
-
} | undefined;
|
|
140
|
+
skillsDirectory?: string | undefined;
|
|
145
141
|
task?: {
|
|
146
|
-
status: "
|
|
142
|
+
status: "running" | "completed" | "failed";
|
|
147
143
|
enabled: boolean;
|
|
148
144
|
outputSchema: Record<string, unknown>;
|
|
149
|
-
error?: string | undefined;
|
|
150
|
-
maxIterations?: number | undefined;
|
|
151
145
|
webhookUrl?: string | undefined;
|
|
152
|
-
|
|
146
|
+
maxIterations?: number | undefined;
|
|
153
147
|
result?: unknown;
|
|
148
|
+
error?: string | undefined;
|
|
154
149
|
iterations?: number | undefined;
|
|
150
|
+
parentTaskId?: string | undefined;
|
|
155
151
|
} | undefined;
|
|
156
|
-
skillsDirectory?: string | undefined;
|
|
157
152
|
computerUseEnabled?: boolean | undefined;
|
|
158
153
|
computerUseDisplayWidth?: number | undefined;
|
|
159
154
|
computerUseDisplayHeight?: number | undefined;
|
|
160
155
|
role?: "orchestrator" | "worker" | "chat" | undefined;
|
|
161
156
|
personality?: string | undefined;
|
|
162
157
|
orchestratorSessionId?: string | undefined;
|
|
158
|
+
slack?: {
|
|
159
|
+
channel?: string | undefined;
|
|
160
|
+
threadTs?: string | undefined;
|
|
161
|
+
teamId?: string | undefined;
|
|
162
|
+
} | undefined;
|
|
163
163
|
schedules?: {
|
|
164
|
+
enabled: boolean;
|
|
164
165
|
id: string;
|
|
165
166
|
name: string;
|
|
166
|
-
enabled: boolean;
|
|
167
|
-
createdAt: string;
|
|
168
|
-
prompt: string;
|
|
169
167
|
cron: string;
|
|
168
|
+
prompt: string;
|
|
169
|
+
createdAt: string;
|
|
170
170
|
replyChannel?: string | undefined;
|
|
171
171
|
lastFiredAt?: string | undefined;
|
|
172
172
|
}[] | undefined;
|
|
@@ -183,36 +183,36 @@ declare const SessionConfigSchema: z.ZodObject<{
|
|
|
183
183
|
}, {
|
|
184
184
|
toolApprovals?: Record<string, boolean> | undefined;
|
|
185
185
|
approvalWebhook?: string | undefined;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
threadTs?: string | undefined;
|
|
189
|
-
teamId?: string | undefined;
|
|
190
|
-
} | undefined;
|
|
186
|
+
skillsDirectory?: string | undefined;
|
|
187
|
+
maxContextChars?: number | undefined;
|
|
191
188
|
task?: {
|
|
192
|
-
status: "
|
|
189
|
+
status: "running" | "completed" | "failed";
|
|
193
190
|
enabled: boolean;
|
|
194
191
|
outputSchema: Record<string, unknown>;
|
|
195
|
-
error?: string | undefined;
|
|
196
|
-
maxIterations?: number | undefined;
|
|
197
192
|
webhookUrl?: string | undefined;
|
|
198
|
-
|
|
193
|
+
maxIterations?: number | undefined;
|
|
199
194
|
result?: unknown;
|
|
195
|
+
error?: string | undefined;
|
|
200
196
|
iterations?: number | undefined;
|
|
197
|
+
parentTaskId?: string | undefined;
|
|
201
198
|
} | undefined;
|
|
202
|
-
skillsDirectory?: string | undefined;
|
|
203
|
-
maxContextChars?: number | undefined;
|
|
204
199
|
computerUseEnabled?: boolean | undefined;
|
|
205
200
|
computerUseDisplayWidth?: number | undefined;
|
|
206
201
|
computerUseDisplayHeight?: number | undefined;
|
|
207
202
|
role?: "orchestrator" | "worker" | "chat" | undefined;
|
|
208
203
|
personality?: string | undefined;
|
|
209
204
|
orchestratorSessionId?: string | undefined;
|
|
205
|
+
slack?: {
|
|
206
|
+
channel?: string | undefined;
|
|
207
|
+
threadTs?: string | undefined;
|
|
208
|
+
teamId?: string | undefined;
|
|
209
|
+
} | undefined;
|
|
210
210
|
schedules?: {
|
|
211
211
|
id: string;
|
|
212
212
|
name: string;
|
|
213
|
-
createdAt: string;
|
|
214
|
-
prompt: string;
|
|
215
213
|
cron: string;
|
|
214
|
+
prompt: string;
|
|
215
|
+
createdAt: string;
|
|
216
216
|
enabled?: boolean | undefined;
|
|
217
217
|
replyChannel?: string | undefined;
|
|
218
218
|
lastFiredAt?: string | undefined;
|
|
@@ -287,6 +287,13 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
287
287
|
host?: string | undefined;
|
|
288
288
|
publicUrl?: string | undefined;
|
|
289
289
|
}>>;
|
|
290
|
+
webhooks: z.ZodOptional<z.ZodObject<{
|
|
291
|
+
token: z.ZodOptional<z.ZodString>;
|
|
292
|
+
}, "strip", z.ZodTypeAny, {
|
|
293
|
+
token?: string | undefined;
|
|
294
|
+
}, {
|
|
295
|
+
token?: string | undefined;
|
|
296
|
+
}>>;
|
|
290
297
|
databasePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
291
298
|
remoteServer: z.ZodOptional<z.ZodObject<{
|
|
292
299
|
url: z.ZodOptional<z.ZodString>;
|
|
@@ -385,15 +392,15 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
385
392
|
expiresAt?: string | undefined;
|
|
386
393
|
}>>;
|
|
387
394
|
}, "strip", z.ZodTypeAny, {
|
|
395
|
+
enabled: boolean;
|
|
388
396
|
id: string;
|
|
389
397
|
name: string;
|
|
390
|
-
transport: "http" | "sse" | "stdio";
|
|
391
|
-
enabled: boolean;
|
|
392
398
|
createdAt: string;
|
|
399
|
+
transport: "http" | "sse" | "stdio";
|
|
400
|
+
args?: string[] | undefined;
|
|
393
401
|
url?: string | undefined;
|
|
394
402
|
headers?: Record<string, string> | undefined;
|
|
395
403
|
command?: string | undefined;
|
|
396
|
-
args?: string[] | undefined;
|
|
397
404
|
oauth?: {
|
|
398
405
|
authorizationUrl?: string | undefined;
|
|
399
406
|
tokenUrl?: string | undefined;
|
|
@@ -406,13 +413,13 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
406
413
|
}, {
|
|
407
414
|
id: string;
|
|
408
415
|
name: string;
|
|
409
|
-
transport: "http" | "sse" | "stdio";
|
|
410
416
|
createdAt: string;
|
|
417
|
+
transport: "http" | "sse" | "stdio";
|
|
418
|
+
enabled?: boolean | undefined;
|
|
419
|
+
args?: string[] | undefined;
|
|
411
420
|
url?: string | undefined;
|
|
412
421
|
headers?: Record<string, string> | undefined;
|
|
413
422
|
command?: string | undefined;
|
|
414
|
-
args?: string[] | undefined;
|
|
415
|
-
enabled?: boolean | undefined;
|
|
416
423
|
oauth?: {
|
|
417
424
|
authorizationUrl?: string | undefined;
|
|
418
425
|
tokenUrl?: string | undefined;
|
|
@@ -425,15 +432,15 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
425
432
|
}>, "many">>>>;
|
|
426
433
|
}, "strip", z.ZodTypeAny, {
|
|
427
434
|
servers?: {
|
|
435
|
+
enabled: boolean;
|
|
428
436
|
id: string;
|
|
429
437
|
name: string;
|
|
430
|
-
transport: "http" | "sse" | "stdio";
|
|
431
|
-
enabled: boolean;
|
|
432
438
|
createdAt: string;
|
|
439
|
+
transport: "http" | "sse" | "stdio";
|
|
440
|
+
args?: string[] | undefined;
|
|
433
441
|
url?: string | undefined;
|
|
434
442
|
headers?: Record<string, string> | undefined;
|
|
435
443
|
command?: string | undefined;
|
|
436
|
-
args?: string[] | undefined;
|
|
437
444
|
oauth?: {
|
|
438
445
|
authorizationUrl?: string | undefined;
|
|
439
446
|
tokenUrl?: string | undefined;
|
|
@@ -448,13 +455,13 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
448
455
|
servers?: {
|
|
449
456
|
id: string;
|
|
450
457
|
name: string;
|
|
451
|
-
transport: "http" | "sse" | "stdio";
|
|
452
458
|
createdAt: string;
|
|
459
|
+
transport: "http" | "sse" | "stdio";
|
|
460
|
+
enabled?: boolean | undefined;
|
|
461
|
+
args?: string[] | undefined;
|
|
453
462
|
url?: string | undefined;
|
|
454
463
|
headers?: Record<string, string> | undefined;
|
|
455
464
|
command?: string | undefined;
|
|
456
|
-
args?: string[] | undefined;
|
|
457
|
-
enabled?: boolean | undefined;
|
|
458
465
|
oauth?: {
|
|
459
466
|
authorizationUrl?: string | undefined;
|
|
460
467
|
tokenUrl?: string | undefined;
|
|
@@ -497,7 +504,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
497
504
|
allowedEmails?: string[] | undefined;
|
|
498
505
|
}>>;
|
|
499
506
|
}, "strip", z.ZodTypeAny, {
|
|
500
|
-
defaultModel: string;
|
|
501
507
|
toolApprovals: {
|
|
502
508
|
bash: boolean;
|
|
503
509
|
write_file: boolean;
|
|
@@ -505,6 +511,7 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
505
511
|
load_skill: boolean;
|
|
506
512
|
todo: boolean;
|
|
507
513
|
};
|
|
514
|
+
defaultModel: string;
|
|
508
515
|
skills: {
|
|
509
516
|
directory: string;
|
|
510
517
|
additionalDirectories: string[];
|
|
@@ -520,8 +527,21 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
520
527
|
publicUrl?: string | undefined;
|
|
521
528
|
};
|
|
522
529
|
databasePath: string;
|
|
523
|
-
workingDirectory?: string | undefined;
|
|
524
530
|
approvalWebhook?: string | undefined;
|
|
531
|
+
slack?: {
|
|
532
|
+
botToken?: string | undefined;
|
|
533
|
+
signingSecret?: string | undefined;
|
|
534
|
+
defaultOrchestratorName?: string | undefined;
|
|
535
|
+
allowedUsers?: string[] | undefined;
|
|
536
|
+
allowedChannels?: string[] | undefined;
|
|
537
|
+
allowDmsFromAnyone?: boolean | undefined;
|
|
538
|
+
deniedReplyEnabled?: boolean | undefined;
|
|
539
|
+
deniedReplyTemplate?: string | undefined;
|
|
540
|
+
} | undefined;
|
|
541
|
+
webhooks?: {
|
|
542
|
+
token?: string | undefined;
|
|
543
|
+
} | undefined;
|
|
544
|
+
workingDirectory?: string | undefined;
|
|
525
545
|
remoteServer?: {
|
|
526
546
|
url?: string | undefined;
|
|
527
547
|
authKey?: string | undefined;
|
|
@@ -534,27 +554,17 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
534
554
|
httpUrl?: string | undefined;
|
|
535
555
|
namespace?: string | undefined;
|
|
536
556
|
} | undefined;
|
|
537
|
-
slack?: {
|
|
538
|
-
botToken?: string | undefined;
|
|
539
|
-
signingSecret?: string | undefined;
|
|
540
|
-
defaultOrchestratorName?: string | undefined;
|
|
541
|
-
allowedUsers?: string[] | undefined;
|
|
542
|
-
allowedChannels?: string[] | undefined;
|
|
543
|
-
allowDmsFromAnyone?: boolean | undefined;
|
|
544
|
-
deniedReplyEnabled?: boolean | undefined;
|
|
545
|
-
deniedReplyTemplate?: string | undefined;
|
|
546
|
-
} | undefined;
|
|
547
557
|
mcp?: {
|
|
548
558
|
servers?: {
|
|
559
|
+
enabled: boolean;
|
|
549
560
|
id: string;
|
|
550
561
|
name: string;
|
|
551
|
-
transport: "http" | "sse" | "stdio";
|
|
552
|
-
enabled: boolean;
|
|
553
562
|
createdAt: string;
|
|
563
|
+
transport: "http" | "sse" | "stdio";
|
|
564
|
+
args?: string[] | undefined;
|
|
554
565
|
url?: string | undefined;
|
|
555
566
|
headers?: Record<string, string> | undefined;
|
|
556
567
|
command?: string | undefined;
|
|
557
|
-
args?: string[] | undefined;
|
|
558
568
|
oauth?: {
|
|
559
569
|
authorizationUrl?: string | undefined;
|
|
560
570
|
tokenUrl?: string | undefined;
|
|
@@ -575,8 +585,6 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
575
585
|
allowedEmails?: string[] | undefined;
|
|
576
586
|
} | undefined;
|
|
577
587
|
}, {
|
|
578
|
-
defaultModel?: string | undefined;
|
|
579
|
-
workingDirectory?: string | undefined;
|
|
580
588
|
toolApprovals?: {
|
|
581
589
|
bash?: boolean | undefined;
|
|
582
590
|
write_file?: boolean | undefined;
|
|
@@ -585,6 +593,21 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
585
593
|
todo?: boolean | undefined;
|
|
586
594
|
} | undefined;
|
|
587
595
|
approvalWebhook?: string | undefined;
|
|
596
|
+
slack?: {
|
|
597
|
+
botToken?: string | undefined;
|
|
598
|
+
signingSecret?: string | undefined;
|
|
599
|
+
defaultOrchestratorName?: string | undefined;
|
|
600
|
+
allowedUsers?: string[] | undefined;
|
|
601
|
+
allowedChannels?: string[] | undefined;
|
|
602
|
+
allowDmsFromAnyone?: boolean | undefined;
|
|
603
|
+
deniedReplyEnabled?: boolean | undefined;
|
|
604
|
+
deniedReplyTemplate?: string | undefined;
|
|
605
|
+
} | undefined;
|
|
606
|
+
webhooks?: {
|
|
607
|
+
token?: string | undefined;
|
|
608
|
+
} | undefined;
|
|
609
|
+
workingDirectory?: string | undefined;
|
|
610
|
+
defaultModel?: string | undefined;
|
|
588
611
|
skills?: {
|
|
589
612
|
directory?: string | undefined;
|
|
590
613
|
additionalDirectories?: string[] | undefined;
|
|
@@ -612,27 +635,17 @@ declare const SparkcoderConfigSchema: z.ZodObject<{
|
|
|
612
635
|
include?: string[] | undefined;
|
|
613
636
|
exclude?: string[] | undefined;
|
|
614
637
|
} | undefined;
|
|
615
|
-
slack?: {
|
|
616
|
-
botToken?: string | undefined;
|
|
617
|
-
signingSecret?: string | undefined;
|
|
618
|
-
defaultOrchestratorName?: string | undefined;
|
|
619
|
-
allowedUsers?: string[] | undefined;
|
|
620
|
-
allowedChannels?: string[] | undefined;
|
|
621
|
-
allowDmsFromAnyone?: boolean | undefined;
|
|
622
|
-
deniedReplyEnabled?: boolean | undefined;
|
|
623
|
-
deniedReplyTemplate?: string | undefined;
|
|
624
|
-
} | undefined;
|
|
625
638
|
mcp?: {
|
|
626
639
|
servers?: {
|
|
627
640
|
id: string;
|
|
628
641
|
name: string;
|
|
629
|
-
transport: "http" | "sse" | "stdio";
|
|
630
642
|
createdAt: string;
|
|
643
|
+
transport: "http" | "sse" | "stdio";
|
|
644
|
+
enabled?: boolean | undefined;
|
|
645
|
+
args?: string[] | undefined;
|
|
631
646
|
url?: string | undefined;
|
|
632
647
|
headers?: Record<string, string> | undefined;
|
|
633
648
|
command?: string | undefined;
|
|
634
|
-
args?: string[] | undefined;
|
|
635
|
-
enabled?: boolean | undefined;
|
|
636
649
|
oauth?: {
|
|
637
650
|
authorizationUrl?: string | undefined;
|
|
638
651
|
tokenUrl?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { R as ResolvedConfig } from './index-
|
|
2
|
-
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-
|
|
1
|
+
import { R as ResolvedConfig } from './index-Biy5JTop.js';
|
|
2
|
+
export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, S as SparkcoderConfig, T as ToolApprovalConfig } from './index-Biy5JTop.js';
|
|
3
3
|
export { ServerOptions, createApp, startServer, stopServer } from './server/index.js';
|
|
4
4
|
export { checkpointQueries, closeDatabase, fileBackupQueries, getDb, initDatabase, messageQueries, sessionQueries, skillQueries, todoQueries, toolExecutionQueries } from './db/index.js';
|
|
5
|
-
import { F as FileBackup, C as Checkpoint } from './schema-
|
|
6
|
-
export { a as Message, M as ModelMessage, S as Session, q as SessionConfig, f as Terminal, T as TodoItem, b as ToolExecution } from './schema-
|
|
5
|
+
import { F as FileBackup, C as Checkpoint } from './schema-CYSKJZ3m.js';
|
|
6
|
+
export { a as Message, M as ModelMessage, S as Session, q as SessionConfig, f as Terminal, T as TodoItem, b as ToolExecution } from './schema-CYSKJZ3m.js';
|
|
7
7
|
export { createLoadSkillTool, createReadFileTool, createTodoTool, createTools } from './tools/index.js';
|
|
8
|
-
export { c as createBashTool, a as createWriteFileTool } from './search-
|
|
8
|
+
export { c as createBashTool, a as createWriteFileTool } from './search-CVVfuBPZ.js';
|
|
9
9
|
import 'ai';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import 'hono/types';
|
package/dist/index.js
CHANGED
|
@@ -340,6 +340,14 @@ var init_types = __esm({
|
|
|
340
340
|
// If not set, defaults to http://{host}:{port}
|
|
341
341
|
publicUrl: z.string().url().optional()
|
|
342
342
|
}).default({ port: 3141, host: "127.0.0.1" }),
|
|
343
|
+
// Per-tunnel unguessable webhook URL prefix. Set by
|
|
344
|
+
// `cloudflared-setup --remote` from the response of POST
|
|
345
|
+
// /tunnels/ensure. When present, the local server mounts public
|
|
346
|
+
// inbound webhooks (Slack events, inbox) under /w/<token>/...
|
|
347
|
+
// instead of /api/*. When absent, falls back to /api/*.
|
|
348
|
+
webhooks: z.object({
|
|
349
|
+
token: z.string().optional()
|
|
350
|
+
}).optional(),
|
|
343
351
|
// Database path (used for local SQLite - ignored if remoteServer is configured)
|
|
344
352
|
databasePath: z.string().optional().default("./sparkecoder.db"),
|
|
345
353
|
// Remote server configuration (for centralized storage)
|
|
@@ -447,7 +455,9 @@ __export(config_exports, {
|
|
|
447
455
|
saveAuthKey: () => saveAuthKey,
|
|
448
456
|
setApiKey: () => setApiKey,
|
|
449
457
|
setMcpServers: () => setMcpServers,
|
|
450
|
-
|
|
458
|
+
setPublicUrl: () => setPublicUrl,
|
|
459
|
+
setSlackConfig: () => setSlackConfig,
|
|
460
|
+
setWebhookToken: () => setWebhookToken
|
|
451
461
|
});
|
|
452
462
|
import { existsSync, readFileSync, mkdirSync, writeFileSync } from "fs";
|
|
453
463
|
import { resolve, dirname, join } from "path";
|
|
@@ -709,6 +719,55 @@ function setMcpServers(servers2) {
|
|
|
709
719
|
console.warn("[config] failed to persist mcp config:", err?.message || err);
|
|
710
720
|
}
|
|
711
721
|
}
|
|
722
|
+
function setWebhookToken(token) {
|
|
723
|
+
if (cachedConfig) {
|
|
724
|
+
cachedConfig.webhooks = {
|
|
725
|
+
...cachedConfig.webhooks ?? {},
|
|
726
|
+
token
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
try {
|
|
730
|
+
const cwdPath = resolve(process.cwd(), "sparkecoder.config.json");
|
|
731
|
+
const target = existsSync(cwdPath) ? cwdPath : join(ensureAppDataDirectory(), "sparkecoder.config.json");
|
|
732
|
+
let raw = {};
|
|
733
|
+
if (existsSync(target)) {
|
|
734
|
+
try {
|
|
735
|
+
raw = JSON.parse(readFileSync(target, "utf-8"));
|
|
736
|
+
} catch {
|
|
737
|
+
raw = {};
|
|
738
|
+
}
|
|
739
|
+
} else {
|
|
740
|
+
raw = createDefaultConfig();
|
|
741
|
+
}
|
|
742
|
+
raw.webhooks = { ...raw.webhooks || {}, token };
|
|
743
|
+
writeFileSync(target, JSON.stringify(raw, null, 2));
|
|
744
|
+
} catch (err) {
|
|
745
|
+
console.warn("[config] failed to persist webhook token:", err?.message || err);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
function setPublicUrl(publicUrl) {
|
|
749
|
+
if (cachedConfig) {
|
|
750
|
+
cachedConfig.server = { ...cachedConfig.server ?? {}, publicUrl };
|
|
751
|
+
}
|
|
752
|
+
try {
|
|
753
|
+
const cwdPath = resolve(process.cwd(), "sparkecoder.config.json");
|
|
754
|
+
const target = existsSync(cwdPath) ? cwdPath : join(ensureAppDataDirectory(), "sparkecoder.config.json");
|
|
755
|
+
let raw = {};
|
|
756
|
+
if (existsSync(target)) {
|
|
757
|
+
try {
|
|
758
|
+
raw = JSON.parse(readFileSync(target, "utf-8"));
|
|
759
|
+
} catch {
|
|
760
|
+
raw = {};
|
|
761
|
+
}
|
|
762
|
+
} else {
|
|
763
|
+
raw = createDefaultConfig();
|
|
764
|
+
}
|
|
765
|
+
raw.server = { ...raw.server || {}, publicUrl };
|
|
766
|
+
writeFileSync(target, JSON.stringify(raw, null, 2));
|
|
767
|
+
} catch (err) {
|
|
768
|
+
console.warn("[config] failed to persist publicUrl:", err?.message || err);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
712
771
|
function clearSlackConfig() {
|
|
713
772
|
if (cachedConfig) cachedConfig.slack = {};
|
|
714
773
|
try {
|
|
@@ -8819,7 +8878,9 @@ function buildScheduleTool(opts) {
|
|
|
8819
8878
|
}
|
|
8820
8879
|
function buildWebhookUrl(opts, token) {
|
|
8821
8880
|
const base = opts.publicBaseUrl?.replace(/\/$/, "") || opts.baseUrl.replace(/\/$/, "");
|
|
8822
|
-
|
|
8881
|
+
const cfg = getConfig();
|
|
8882
|
+
const webhookPrefix2 = cfg?.webhooks?.token ? `/w/${cfg.webhooks.token}` : "/api";
|
|
8883
|
+
return `${base}${webhookPrefix2}/inbox/${token}`;
|
|
8823
8884
|
}
|
|
8824
8885
|
function buildWebhookTool(opts) {
|
|
8825
8886
|
return tool14({
|
|
@@ -8869,6 +8930,7 @@ var init_orchestrator_actions = __esm({
|
|
|
8869
8930
|
"use strict";
|
|
8870
8931
|
init_messenger();
|
|
8871
8932
|
init_schedules_store();
|
|
8933
|
+
init_config();
|
|
8872
8934
|
init_webhooks_store();
|
|
8873
8935
|
AGENT_STATUS_ENUM = z15.enum(["running", "needs_attention", "completed", "failed", "idle"]);
|
|
8874
8936
|
agentInputSchema = z15.object({
|
|
@@ -13835,8 +13897,8 @@ async function findOrCreateOrchestratorId() {
|
|
|
13835
13897
|
const all = await sessionQueries.list(500, 0);
|
|
13836
13898
|
const existing = all.find((s) => s.config?.role === "orchestrator");
|
|
13837
13899
|
if (existing) return existing.id;
|
|
13838
|
-
const { getConfig:
|
|
13839
|
-
const cfg =
|
|
13900
|
+
const { getConfig: getConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
|
|
13901
|
+
const cfg = getConfig2();
|
|
13840
13902
|
const created = await sessionQueries.create({
|
|
13841
13903
|
name: getDefaultOrchestratorName() || "Orchestrator",
|
|
13842
13904
|
workingDirectory: cfg.resolvedWorkingDirectory,
|
|
@@ -13961,6 +14023,11 @@ function publicBase() {
|
|
|
13961
14023
|
const cfg = getConfig();
|
|
13962
14024
|
return cfg.server?.publicUrl?.replace(/\/$/, "") || `http://${cfg.server?.host || "127.0.0.1"}:${cfg.server?.port || 3141}`;
|
|
13963
14025
|
}
|
|
14026
|
+
function webhookPrefix() {
|
|
14027
|
+
const cfg = getConfig();
|
|
14028
|
+
const token = cfg?.webhooks?.token;
|
|
14029
|
+
return token ? `/w/${token}` : "/api";
|
|
14030
|
+
}
|
|
13964
14031
|
integrations.get("/", async (c) => {
|
|
13965
14032
|
const cfg = getConfig();
|
|
13966
14033
|
return c.json({
|
|
@@ -13970,7 +14037,7 @@ integrations.get("/", async (c) => {
|
|
|
13970
14037
|
botTokenSet: !!cfg?.slack?.botToken,
|
|
13971
14038
|
signingSecretSet: !!cfg?.slack?.signingSecret,
|
|
13972
14039
|
defaultOrchestratorName: cfg?.slack?.defaultOrchestratorName || null,
|
|
13973
|
-
eventsUrl: `${publicBase()}/
|
|
14040
|
+
eventsUrl: `${publicBase()}${webhookPrefix()}/slack/events`,
|
|
13974
14041
|
allowedUsers: cfg?.slack?.allowedUsers ?? [],
|
|
13975
14042
|
allowedChannels: cfg?.slack?.allowedChannels ?? [],
|
|
13976
14043
|
allowDmsFromAnyone: cfg?.slack?.allowDmsFromAnyone !== false,
|
|
@@ -14063,7 +14130,7 @@ schedulesRouter.delete("/:id", async (c) => {
|
|
|
14063
14130
|
});
|
|
14064
14131
|
var webhooksRouter = new Hono8();
|
|
14065
14132
|
function withUrl(row) {
|
|
14066
|
-
return { ...row, url: `${publicBase()}/
|
|
14133
|
+
return { ...row, url: `${publicBase()}${webhookPrefix()}/inbox/${row.token}` };
|
|
14067
14134
|
}
|
|
14068
14135
|
webhooksRouter.get("/", async (c) => {
|
|
14069
14136
|
const orcId = await getOrchestratorId();
|
|
@@ -14166,7 +14233,7 @@ mcpRouter.post("/:id/test", async (c) => {
|
|
|
14166
14233
|
// src/server/auth/cf-access.ts
|
|
14167
14234
|
init_config();
|
|
14168
14235
|
import { createRemoteJWKSet, jwtVerify } from "jose";
|
|
14169
|
-
var EXEMPT_PATH_PREFIXES = ["/health", "/api/slack/events", "/api/inbox/"];
|
|
14236
|
+
var EXEMPT_PATH_PREFIXES = ["/health", "/api/slack/events", "/api/inbox/", "/w/"];
|
|
14170
14237
|
var cachedJWKS = null;
|
|
14171
14238
|
var cachedJWKSUrl = null;
|
|
14172
14239
|
function getOrCreateJWKS(teamDomain) {
|
|
@@ -14595,13 +14662,23 @@ async function createApp(options = {}) {
|
|
|
14595
14662
|
app.route("/sessions", terminals);
|
|
14596
14663
|
app.route("/terminals", terminals);
|
|
14597
14664
|
app.route("/tasks", tasks_default);
|
|
14598
|
-
app.route("/api/slack", slack);
|
|
14599
|
-
app.route("/api/inbox", inbox);
|
|
14600
14665
|
app.route("/api/integrations", integrations);
|
|
14601
14666
|
app.route("/api/schedules", schedulesRouter);
|
|
14602
|
-
app.route("/api/webhooks", webhooksRouter);
|
|
14603
14667
|
app.route("/api/orchestrator", orchestratorRouter);
|
|
14604
14668
|
app.route("/api/mcp", mcpRouter);
|
|
14669
|
+
app.route("/api/webhooks", webhooksRouter);
|
|
14670
|
+
const config = getConfig();
|
|
14671
|
+
const webhookToken = config?.webhooks?.token;
|
|
14672
|
+
if (webhookToken) {
|
|
14673
|
+
app.route(`/w/${webhookToken}/slack`, slack);
|
|
14674
|
+
app.route(`/w/${webhookToken}/inbox`, inbox);
|
|
14675
|
+
if (!options.quiet) {
|
|
14676
|
+
console.log(` \u2192 Public webhooks mounted at /w/${webhookToken.slice(0, 4)}\u2026/<service>`);
|
|
14677
|
+
}
|
|
14678
|
+
} else {
|
|
14679
|
+
app.route("/api/slack", slack);
|
|
14680
|
+
app.route("/api/inbox", inbox);
|
|
14681
|
+
}
|
|
14605
14682
|
app.get("/openapi.json", async (c) => {
|
|
14606
14683
|
return c.json(generateOpenAPISpec());
|
|
14607
14684
|
});
|