veryfront 0.1.632 → 0.1.633

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.
Files changed (45) hide show
  1. package/esm/deno.d.ts +1 -0
  2. package/esm/deno.js +2 -1
  3. package/esm/src/agent/ag-ui/browser-encoder.d.ts.map +1 -1
  4. package/esm/src/agent/ag-ui/browser-encoder.js +0 -2
  5. package/esm/src/cache/backends/api.d.ts.map +1 -1
  6. package/esm/src/cache/backends/api.js +8 -10
  7. package/esm/src/cache/backends/batch-results.d.ts +21 -0
  8. package/esm/src/cache/backends/batch-results.d.ts.map +1 -0
  9. package/esm/src/cache/backends/batch-results.js +26 -0
  10. package/esm/src/cache/backends/memory.d.ts.map +1 -1
  11. package/esm/src/cache/backends/memory.js +7 -10
  12. package/esm/src/cache/backends/redis.d.ts.map +1 -1
  13. package/esm/src/cache/backends/redis.js +6 -11
  14. package/esm/src/chat/ag-ui.d.ts +0 -257
  15. package/esm/src/chat/ag-ui.d.ts.map +1 -1
  16. package/esm/src/chat/ag-ui.js +1 -21
  17. package/esm/src/chat/compat.d.ts +776 -0
  18. package/esm/src/chat/compat.d.ts.map +1 -0
  19. package/esm/src/chat/compat.js +113 -0
  20. package/esm/src/chat/conversation.d.ts +0 -151
  21. package/esm/src/chat/conversation.d.ts.map +1 -1
  22. package/esm/src/chat/conversation.js +1 -26
  23. package/esm/src/chat/message-prep.d.ts +0 -10
  24. package/esm/src/chat/message-prep.d.ts.map +1 -1
  25. package/esm/src/chat/message-prep.js +0 -10
  26. package/esm/src/chat/types.d.ts +0 -339
  27. package/esm/src/chat/types.d.ts.map +1 -1
  28. package/esm/src/chat/types.js +1 -29
  29. package/esm/src/platform/adapters/runtime/deno/adapter.d.ts.map +1 -1
  30. package/esm/src/platform/adapters/runtime/deno/adapter.js +3 -14
  31. package/esm/src/platform/compat/http/deno-server.d.ts.map +1 -1
  32. package/esm/src/platform/compat/http/deno-server.js +3 -14
  33. package/esm/src/platform/compat/http/native-response.d.ts +29 -0
  34. package/esm/src/platform/compat/http/native-response.d.ts.map +1 -0
  35. package/esm/src/platform/compat/http/native-response.js +43 -0
  36. package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
  37. package/esm/src/server/handlers/dev/dashboard/api.js +1 -10
  38. package/esm/src/server/handlers/dev/http-helpers.d.ts +17 -0
  39. package/esm/src/server/handlers/dev/http-helpers.d.ts.map +1 -0
  40. package/esm/src/server/handlers/dev/http-helpers.js +20 -0
  41. package/esm/src/server/handlers/dev/projects/api.d.ts.map +1 -1
  42. package/esm/src/server/handlers/dev/projects/api.js +1 -7
  43. package/esm/src/utils/version-constant.d.ts +1 -1
  44. package/esm/src/utils/version-constant.js +1 -1
  45. package/package.json +5 -1
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Shared helpers for bridging polyfilled `Response` objects to native ones
3
+ * required by `Deno.serve`.
4
+ *
5
+ * In npm packages, dnt replaces the global `Response` with undici's polyfill,
6
+ * but `Deno.serve` requires native `Response` instances. These helpers access
7
+ * the native constructor via `self` (which dnt does not shim) and re-wrap
8
+ * polyfilled responses as needed.
9
+ *
10
+ * IMPORTANT: this module must remain importable without `--allow-env`. It must
11
+ * NOT read environment variables or import a logger at module load time.
12
+ *
13
+ * @module platform/compat/http/native-response
14
+ */
15
+ /**
16
+ * The native `Response` constructor, accessed via `self` to bypass the dnt
17
+ * shim transform (dnt rewrites bare `Response` to undici's polyfill).
18
+ */
19
+ export function getNativeResponse() {
20
+ return self.Response;
21
+ }
22
+ /**
23
+ * Re-wrap a (possibly polyfilled) `Response` as a native `Response` so it can be
24
+ * returned from `Deno.serve`.
25
+ *
26
+ * If `response` is already a native instance (compiled binary or WebSocket
27
+ * upgrade), it is returned as-is. Otherwise its body/status/headers are copied
28
+ * into a fresh native `Response`.
29
+ */
30
+ export function toNativeResponse(response, NativeResponse) {
31
+ // If already native (compiled binary or WebSocket upgrade), return as-is.
32
+ if (response instanceof NativeResponse)
33
+ return response;
34
+ // Re-wrap polyfilled Response as native Response.
35
+ // At runtime, `response` may be an undici Response (from the dnt shim) that
36
+ // fails Deno's native instanceof check. Cast to access its properties.
37
+ const r = response;
38
+ return new NativeResponse(r.body, {
39
+ status: r.status,
40
+ statusText: r.statusText,
41
+ headers: r.headers,
42
+ });
43
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/dev/dashboard/api.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAwDrD,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,QAAQ,GAAG,IAAI,CAgE5C"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/dev/dashboard/api.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA4CrD,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,cAAc,GAClB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,QAAQ,GAAG,IAAI,CAgE5C"}
@@ -19,6 +19,7 @@ import { getErrorCollector } from "../../../../observability/error-collector.js"
19
19
  import { getLogBuffer } from "../../../../observability/log-buffer.js";
20
20
  import { validatePathSync } from "../../../../security/index.js";
21
21
  import { ReloadNotifier } from "../../../reload-notifier.js";
22
+ import { errorResponse, jsonResponse } from "../http-helpers.js";
22
23
  const WORKFLOW_EXECUTION_TIMEOUT_MS = 30_000;
23
24
  /**
24
25
  * Validate a relative path against the project directory.
@@ -41,10 +42,6 @@ function validateRelativePath(path, projectDir) {
41
42
  return null;
42
43
  return result.canonicalPath;
43
44
  }
44
- const JSON_HEADERS = {
45
- "Content-Type": "application/json",
46
- "Cache-Control": "no-cache",
47
- };
48
45
  const TEXT_EXTENSIONS = new Set([
49
46
  "ts",
50
47
  "tsx",
@@ -62,12 +59,6 @@ const TEXT_EXTENSIONS = new Set([
62
59
  "gitignore",
63
60
  "dockerignore",
64
61
  ]);
65
- function jsonResponse(data, status = 200) {
66
- return new Response(JSON.stringify(data, null, 2), { status, headers: JSON_HEADERS });
67
- }
68
- function errorResponse(message, status = 500) {
69
- return jsonResponse({ error: message }, status);
70
- }
71
62
  export function handleDashboardAPI(req, ctx) {
72
63
  if (!ctx.isLocalProject)
73
64
  return errorResponse("Unauthorized", 401);
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Shared HTTP response helpers for dev handlers.
3
+ *
4
+ * Used by the dev dashboard and projects API handlers to build consistent
5
+ * JSON responses with no-cache headers.
6
+ *
7
+ * @module server/handlers/dev/http-helpers
8
+ */
9
+ export declare const JSON_HEADERS: {
10
+ "Content-Type": string;
11
+ "Cache-Control": string;
12
+ };
13
+ /** Build a pretty-printed JSON `Response` with no-cache headers. */
14
+ export declare function jsonResponse(data: unknown, status?: number): Response;
15
+ /** Build a JSON error `Response` of shape `{ error: message }`. */
16
+ export declare function errorResponse(message: string, status?: number): Response;
17
+ //# sourceMappingURL=http-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/src/server/handlers/dev/http-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,YAAY;;;CAGxB,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,SAAM,GAAG,QAAQ,CAElE;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAM,GAAG,QAAQ,CAErE"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared HTTP response helpers for dev handlers.
3
+ *
4
+ * Used by the dev dashboard and projects API handlers to build consistent
5
+ * JSON responses with no-cache headers.
6
+ *
7
+ * @module server/handlers/dev/http-helpers
8
+ */
9
+ export const JSON_HEADERS = {
10
+ "Content-Type": "application/json",
11
+ "Cache-Control": "no-cache",
12
+ };
13
+ /** Build a pretty-printed JSON `Response` with no-cache headers. */
14
+ export function jsonResponse(data, status = 200) {
15
+ return new Response(JSON.stringify(data, null, 2), { status, headers: JSON_HEADERS });
16
+ }
17
+ /** Build a JSON error `Response` of shape `{ error: message }`. */
18
+ export function errorResponse(message, status = 500) {
19
+ return jsonResponse({ error: message }, status);
20
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/dev/projects/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYrD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,QAAQ,GAAG,IAAI,CAOpF"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../src/src/server/handlers/dev/projects/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIrD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,QAAQ,GAAG,IAAI,CAOpF"}
@@ -1,11 +1,5 @@
1
1
  import { getEffectiveRequestHost } from "../../../utils/request-host.js";
2
- const JSON_HEADERS = {
3
- "Content-Type": "application/json",
4
- "Cache-Control": "no-cache",
5
- };
6
- function jsonResponse(data, status = 200) {
7
- return new Response(JSON.stringify(data, null, 2), { status, headers: JSON_HEADERS });
8
- }
2
+ import { jsonResponse } from "../http-helpers.js";
9
3
  export function handleProjectsAPI(req, ctx) {
10
4
  const { pathname } = new URL(req.url);
11
5
  if (req.method !== "GET")
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.632";
2
+ export declare const VERSION = "0.1.633";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.632";
4
+ export const VERSION = "0.1.633";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.632",
3
+ "version": "0.1.633",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
@@ -53,6 +53,10 @@
53
53
  "import": "./esm/src/chat/ag-ui.js",
54
54
  "types": "./esm/src/chat/ag-ui.d.ts"
55
55
  },
56
+ "./chat/compat": {
57
+ "import": "./esm/src/chat/compat.js",
58
+ "types": "./esm/src/chat/compat.d.ts"
59
+ },
56
60
  "./chat/protocol": {
57
61
  "import": "./esm/src/chat/protocol.js",
58
62
  "types": "./esm/src/chat/protocol.d.ts"