@digo-labs/backend 0.2.8 → 0.2.9
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/README.md +1 -1
- package/dist/index.d.cts +60 -17
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Patterns are documented in the design system: [Backend Patterns](https://design.
|
|
|
17
17
|
npm run dev # tsx watch on port 3000
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Requires env vars (`DATABASE_URL_MONOREPO` at minimum; `FAL_KEY` and `REPLICATE_API_TOKEN` for the proxy and AI jobs, `OPENAI_API_KEY` for AI jobs' OpenAI links) — the usual workflow is developing apps against the deployed backend instead, which needs nothing locally. See [Environment and Local Backend](https://design.digo-labs.com/docs/guide/environment-and-local-backend).
|
|
20
|
+
Requires env vars (`DATABASE_URL_MONOREPO` at minimum; `FAL_KEY` and `REPLICATE_API_TOKEN` for the proxy and AI jobs, `OPENAI_API_KEY` for AI jobs' OpenAI links and OpenAI text, `ANTHROPIC_API_KEY` for Anthropic text) — the usual workflow is developing apps against the deployed backend instead, which needs nothing locally. See [Environment and Local Backend](https://design.digo-labs.com/docs/guide/environment-and-local-backend).
|
|
21
21
|
|
|
22
22
|
## Build
|
|
23
23
|
|
package/dist/index.d.cts
CHANGED
|
@@ -247,6 +247,8 @@ declare const bedrockRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, hono_t
|
|
|
247
247
|
id: string;
|
|
248
248
|
version: string;
|
|
249
249
|
} | undefined;
|
|
250
|
+
reasoningEffort?: "max" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
251
|
+
thinking?: "adaptive" | "disabled" | "between_tools" | undefined;
|
|
250
252
|
};
|
|
251
253
|
};
|
|
252
254
|
output: {};
|
|
@@ -283,6 +285,46 @@ declare const anthropicRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, hono
|
|
|
283
285
|
id: string;
|
|
284
286
|
version: string;
|
|
285
287
|
} | undefined;
|
|
288
|
+
reasoningEffort?: "max" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
289
|
+
thinking?: "adaptive" | "disabled" | "between_tools" | undefined;
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
output: {};
|
|
293
|
+
outputFormat: string;
|
|
294
|
+
status: hono_utils_http_status.StatusCode;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
}, "/ai">, "/", "/">;
|
|
298
|
+
|
|
299
|
+
declare const openAiRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, hono_types.BlankSchema | hono_types.MergeSchemaPath<{
|
|
300
|
+
"openai-text": {
|
|
301
|
+
$post: {
|
|
302
|
+
input: {
|
|
303
|
+
json: {
|
|
304
|
+
messages: ({
|
|
305
|
+
content: string | ({
|
|
306
|
+
type: "text";
|
|
307
|
+
text: string;
|
|
308
|
+
} | {
|
|
309
|
+
type: "image";
|
|
310
|
+
source: {
|
|
311
|
+
base64: string;
|
|
312
|
+
mediaType: string;
|
|
313
|
+
};
|
|
314
|
+
})[];
|
|
315
|
+
role: "user";
|
|
316
|
+
} | {
|
|
317
|
+
role: "assistant";
|
|
318
|
+
content: string | {
|
|
319
|
+
type: "text";
|
|
320
|
+
text: string;
|
|
321
|
+
}[];
|
|
322
|
+
})[];
|
|
323
|
+
systemPrompt?: string | undefined;
|
|
324
|
+
temperature?: number | undefined;
|
|
325
|
+
reasoningEffort?: "max" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
326
|
+
model?: "gpt-6-luna" | "gpt-6.1-terra" | "gpt-6.1-sol" | undefined;
|
|
327
|
+
maxTokens?: number | undefined;
|
|
286
328
|
};
|
|
287
329
|
};
|
|
288
330
|
output: {};
|
|
@@ -410,7 +452,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
410
452
|
}[];
|
|
411
453
|
tasks: {
|
|
412
454
|
key: string;
|
|
413
|
-
endpoint: "fake:echo" | `
|
|
455
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
414
456
|
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
415
457
|
attempt: number;
|
|
416
458
|
outputPath: string;
|
|
@@ -425,7 +467,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
425
467
|
}[];
|
|
426
468
|
error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
|
|
427
469
|
estimatedUsd: number;
|
|
428
|
-
servedBy?: "fake:echo" | `
|
|
470
|
+
servedBy?: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}` | null | undefined;
|
|
429
471
|
}[];
|
|
430
472
|
createdAt: string;
|
|
431
473
|
updatedAt: string;
|
|
@@ -443,14 +485,14 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
443
485
|
key: string;
|
|
444
486
|
tasks: {
|
|
445
487
|
key: string;
|
|
446
|
-
endpoint: "fake:echo" | `
|
|
488
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
447
489
|
input: Record<string, unknown>;
|
|
448
490
|
output: {
|
|
449
491
|
path: string;
|
|
450
492
|
};
|
|
451
493
|
priority?: number | undefined;
|
|
452
494
|
fallbacks?: {
|
|
453
|
-
endpoint: "fake:echo" | `
|
|
495
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
454
496
|
input?: Record<string, unknown> | undefined;
|
|
455
497
|
}[] | undefined;
|
|
456
498
|
fallbackAfter?: number | undefined;
|
|
@@ -543,7 +585,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
543
585
|
}[];
|
|
544
586
|
tasks: {
|
|
545
587
|
key: string;
|
|
546
|
-
endpoint: "fake:echo" | `
|
|
588
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
547
589
|
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
548
590
|
attempt: number;
|
|
549
591
|
outputPath: string;
|
|
@@ -558,7 +600,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
558
600
|
}[];
|
|
559
601
|
error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
|
|
560
602
|
estimatedUsd: number;
|
|
561
|
-
servedBy?: "fake:echo" | `
|
|
603
|
+
servedBy?: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}` | null | undefined;
|
|
562
604
|
}[];
|
|
563
605
|
createdAt: string;
|
|
564
606
|
updatedAt: string;
|
|
@@ -576,14 +618,14 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
576
618
|
id: string;
|
|
577
619
|
tasks: {
|
|
578
620
|
key: string;
|
|
579
|
-
endpoint: "fake:echo" | `
|
|
621
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
580
622
|
input: Record<string, unknown>;
|
|
581
623
|
output: {
|
|
582
624
|
path: string;
|
|
583
625
|
};
|
|
584
626
|
priority?: number | undefined;
|
|
585
627
|
fallbacks?: {
|
|
586
|
-
endpoint: "fake:echo" | `
|
|
628
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
587
629
|
input?: Record<string, unknown> | undefined;
|
|
588
630
|
}[] | undefined;
|
|
589
631
|
fallbackAfter?: number | undefined;
|
|
@@ -606,7 +648,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
606
648
|
}[];
|
|
607
649
|
tasks: {
|
|
608
650
|
key: string;
|
|
609
|
-
endpoint: "fake:echo" | `
|
|
651
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
610
652
|
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
611
653
|
attempt: number;
|
|
612
654
|
outputPath: string;
|
|
@@ -621,7 +663,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
621
663
|
}[];
|
|
622
664
|
error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
|
|
623
665
|
estimatedUsd: number;
|
|
624
|
-
servedBy?: "fake:echo" | `
|
|
666
|
+
servedBy?: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}` | null | undefined;
|
|
625
667
|
}[];
|
|
626
668
|
createdAt: string;
|
|
627
669
|
updatedAt: string;
|
|
@@ -713,7 +755,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
713
755
|
}[];
|
|
714
756
|
tasks: {
|
|
715
757
|
key: string;
|
|
716
|
-
endpoint: "fake:echo" | `
|
|
758
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
717
759
|
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
718
760
|
attempt: number;
|
|
719
761
|
outputPath: string;
|
|
@@ -728,7 +770,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
728
770
|
}[];
|
|
729
771
|
error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
|
|
730
772
|
estimatedUsd: number;
|
|
731
|
-
servedBy?: "fake:echo" | `
|
|
773
|
+
servedBy?: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}` | null | undefined;
|
|
732
774
|
}[];
|
|
733
775
|
createdAt: string;
|
|
734
776
|
updatedAt: string;
|
|
@@ -762,7 +804,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
762
804
|
}[];
|
|
763
805
|
tasks: {
|
|
764
806
|
key: string;
|
|
765
|
-
endpoint: "fake:echo" | `
|
|
807
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
766
808
|
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
767
809
|
attempt: number;
|
|
768
810
|
outputPath: string;
|
|
@@ -777,7 +819,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
777
819
|
}[];
|
|
778
820
|
error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
|
|
779
821
|
estimatedUsd: number;
|
|
780
|
-
servedBy?: "fake:echo" | `
|
|
822
|
+
servedBy?: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}` | null | undefined;
|
|
781
823
|
}[];
|
|
782
824
|
createdAt: string;
|
|
783
825
|
updatedAt: string;
|
|
@@ -815,7 +857,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
815
857
|
}[];
|
|
816
858
|
tasks: {
|
|
817
859
|
key: string;
|
|
818
|
-
endpoint: "fake:echo" | `
|
|
860
|
+
endpoint: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}`;
|
|
819
861
|
status: "done" | "rejected" | "failed" | "cancelled" | "pending" | "submitted" | "saving";
|
|
820
862
|
attempt: number;
|
|
821
863
|
outputPath: string;
|
|
@@ -830,7 +872,7 @@ declare const aiJobsRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, ((({
|
|
|
830
872
|
}[];
|
|
831
873
|
error: "submit failed" | "provider error" | "provider timed out" | "save failed" | null;
|
|
832
874
|
estimatedUsd: number;
|
|
833
|
-
servedBy?: "fake:echo" | `
|
|
875
|
+
servedBy?: "fake:echo" | `openai:${string}` | `fal:${string}` | `replicate:${string}` | null | undefined;
|
|
834
876
|
}[];
|
|
835
877
|
createdAt: string;
|
|
836
878
|
updatedAt: string;
|
|
@@ -1096,9 +1138,10 @@ type StorageRouter = typeof storageRouter;
|
|
|
1096
1138
|
type DatabaseRouter = typeof databaseRouter;
|
|
1097
1139
|
type BedrockRouter = typeof bedrockRouter;
|
|
1098
1140
|
type AnthropicRouter = typeof anthropicRouter;
|
|
1141
|
+
type OpenAiRouter = typeof openAiRouter;
|
|
1099
1142
|
type DevicesRouter = typeof devicesRouter;
|
|
1100
1143
|
type AiJobsRouter = typeof aiJobsRouter;
|
|
1101
1144
|
type RealtimeRouter = typeof realtimeRouter;
|
|
1102
1145
|
type InstancesRouter = typeof instancesRouter;
|
|
1103
1146
|
|
|
1104
|
-
export { type AiJobsRouter, type AnthropicRouter, type BedrockRouter, type DatabaseRouter, type DevicesRouter, type DmxRouter, type InstancesRouter, type RealtimeRouter, type StorageRouter, app as default };
|
|
1147
|
+
export { type AiJobsRouter, type AnthropicRouter, type BedrockRouter, type DatabaseRouter, type DevicesRouter, type DmxRouter, type InstancesRouter, type OpenAiRouter, type RealtimeRouter, type StorageRouter, app as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digo-labs/backend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
]
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@digo-labs/common": "^0.2.
|
|
41
|
+
"@digo-labs/common": "^0.2.17"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@anthropic-ai/sdk": "^1.6.0",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"dotenv": "^17.2.3",
|
|
56
56
|
"drizzle-orm": "^0.45.2",
|
|
57
57
|
"hono": "^4.9.8",
|
|
58
|
+
"openai": "^7.55.0",
|
|
58
59
|
"pg": "^8.20.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|