@qorejs/qore 0.7.3 → 0.9.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.
Files changed (44) hide show
  1. package/README.md +275 -5
  2. package/dist/src/core/owner.d.ts +14 -0
  3. package/dist/src/core/owner.js +66 -0
  4. package/dist/src/core/signal-context.js +19 -9
  5. package/dist/src/core/signal-nodes.d.ts +5 -0
  6. package/dist/src/core/signal-nodes.js +51 -21
  7. package/dist/src/core/signal-types.d.ts +2 -0
  8. package/dist/src/core/signal.d.ts +1 -0
  9. package/dist/src/core/signal.js +2 -0
  10. package/dist/src/core/stream-types.d.ts +12 -0
  11. package/dist/src/core/stream.d.ts +1 -1
  12. package/dist/src/core/stream.js +144 -0
  13. package/dist/src/dom/app.js +2 -3
  14. package/dist/src/dom/dom.d.ts +1 -0
  15. package/dist/src/dom/dom.js +96 -9
  16. package/dist/src/dom/scope.d.ts +3 -1
  17. package/dist/src/dom/scope.js +10 -3
  18. package/dist/src/index.d.ts +10 -4
  19. package/dist/src/index.js +7 -2
  20. package/dist/src/providers/anthropic.js +6 -4
  21. package/dist/src/providers/deepseek.d.ts +2 -0
  22. package/dist/src/providers/deepseek.js +90 -0
  23. package/dist/src/providers/line-adapter.d.ts +2 -0
  24. package/dist/src/providers/line-adapter.js +83 -0
  25. package/dist/src/providers/line-parser.d.ts +5 -0
  26. package/dist/src/providers/line-parser.js +103 -0
  27. package/dist/src/providers/metadata.d.ts +8 -0
  28. package/dist/src/providers/metadata.js +193 -0
  29. package/dist/src/providers/ollama.d.ts +2 -0
  30. package/dist/src/providers/ollama.js +82 -0
  31. package/dist/src/providers/openai.js +6 -4
  32. package/dist/src/providers/openrouter.d.ts +2 -0
  33. package/dist/src/providers/openrouter.js +90 -0
  34. package/dist/src/providers/sse-adapter.js +129 -44
  35. package/dist/src/providers/sse-parser.d.ts +1 -1
  36. package/dist/src/providers/sse-parser.js +74 -38
  37. package/dist/src/providers/sse.d.ts +7 -1
  38. package/dist/src/providers/sse.js +6 -0
  39. package/dist/src/providers/types.d.ts +145 -0
  40. package/dist/src/server/sse-response.d.ts +16 -0
  41. package/dist/src/server/sse-response.js +102 -0
  42. package/dist/src/shared/utils.d.ts +1 -0
  43. package/dist/src/shared/utils.js +8 -1
  44. package/package.json +9 -2
@@ -1,2 +1,3 @@
1
1
  export declare function normalizeError(error: unknown): Error;
2
+ export declare function normalizeAbortReason(reason: unknown, fallbackMessage?: string): Error;
2
3
  export declare function sleep(ms: number, signal?: AbortSignal | null): Promise<void>;
@@ -8,6 +8,13 @@ export function normalizeError(error) {
8
8
  }
9
9
  return new Error('Unknown Qore error');
10
10
  }
11
+ // Convert abort reasons into stable Error instances for transport and runtime code.
12
+ export function normalizeAbortReason(reason, fallbackMessage = 'Operation aborted') {
13
+ if (reason == null) {
14
+ return new Error(fallbackMessage);
15
+ }
16
+ return normalizeError(reason);
17
+ }
11
18
  // Sleep for a fixed time and reject early if the surrounding operation is aborted.
12
19
  export function sleep(ms, signal) {
13
20
  return new Promise((resolve, reject) => {
@@ -17,7 +24,7 @@ export function sleep(ms, signal) {
17
24
  }, ms);
18
25
  const onAbort = () => {
19
26
  cleanup();
20
- reject(normalizeError(signal?.reason ?? 'Operation aborted'));
27
+ reject(normalizeAbortReason(signal?.reason, 'Operation aborted'));
21
28
  };
22
29
  const cleanup = () => {
23
30
  clearTimeout(timer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qorejs/qore",
3
- "version": "0.7.3",
3
+ "version": "0.9.0",
4
4
  "description": "Qore is a streaming-response framework where stream becomes signal.",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -23,13 +23,17 @@
23
23
  "browsers:install": "playwright install chromium",
24
24
  "typecheck": "node ./scripts/typecheck.mjs",
25
25
  "check:dist": "node ./scripts/check-dist-sync.mjs",
26
+ "check:api-surface": "node ./scripts/check-public-api.mjs",
27
+ "check:release-docs": "node ./scripts/check-release-docs.mjs",
26
28
  "test:browser": "node ./scripts/browser-smoke.mjs",
29
+ "test:benchmark": "node ./scripts/benchmark-gate.mjs",
27
30
  "smoke:package-types": "node ./scripts/package-type-smoke.mjs",
28
31
  "smoke:package-runtime": "node ./scripts/package-runtime-smoke.mjs",
29
32
  "test": "node ./scripts/test.mjs",
30
33
  "release:check": "node ./scripts/release-check.mjs",
34
+ "publish:preflight": "node ./scripts/publish-preflight.mjs",
31
35
  "publish:github": "npm publish --registry=https://npm.pkg.github.com",
32
- "publish:npm": "npm publish --access public",
36
+ "publish:npm": "node ./scripts/publish-npm.mjs",
33
37
  "prepublishOnly": "node ./scripts/release-check.mjs"
34
38
  },
35
39
  "engines": {
@@ -42,9 +46,12 @@
42
46
  "signal",
43
47
  "reactive",
44
48
  "sse",
49
+ "ndjson",
45
50
  "ai",
46
51
  "openai",
47
52
  "anthropic",
53
+ "deepseek",
54
+ "ollama",
48
55
  "framework",
49
56
  "async-iterable"
50
57
  ],