@happyvertical/smrt-ingestion 0.55.5 → 0.55.7

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 (85) hide show
  1. package/AGENTS.md +13 -3
  2. package/FEEDBACK.md +117 -0
  3. package/PROPOSALS.md +173 -0
  4. package/README.md +14 -0
  5. package/REVIEW.md +136 -0
  6. package/agents/execution.md +132 -0
  7. package/dist/chunks/execution-CYjtj9_l.js +8031 -0
  8. package/dist/chunks/execution-CYjtj9_l.js.map +1 -0
  9. package/dist/chunks/execution-internal-DWteDHM2.js +7 -0
  10. package/dist/chunks/execution-internal-DWteDHM2.js.map +1 -0
  11. package/dist/chunks/feedback-B_NILilH.js +577 -0
  12. package/dist/chunks/feedback-B_NILilH.js.map +1 -0
  13. package/dist/chunks/proposal-errors-z24VKWnQ.js +301 -0
  14. package/dist/chunks/proposal-errors-z24VKWnQ.js.map +1 -0
  15. package/dist/dto.d.ts +3 -0
  16. package/dist/dto.d.ts.map +1 -1
  17. package/dist/execution-contracts.d.ts +3 -0
  18. package/dist/execution-contracts.d.ts.map +1 -1
  19. package/dist/execution-internal.d.ts +9 -0
  20. package/dist/execution-internal.d.ts.map +1 -0
  21. package/dist/execution.d.ts +23 -1
  22. package/dist/execution.d.ts.map +1 -1
  23. package/dist/execution.js +1 -7614
  24. package/dist/extraction.d.ts.map +1 -1
  25. package/dist/feedback-contracts.d.ts +40 -0
  26. package/dist/feedback-contracts.d.ts.map +1 -0
  27. package/dist/feedback-dto.d.ts +100 -0
  28. package/dist/feedback-dto.d.ts.map +1 -0
  29. package/dist/feedback-internal.d.ts +19 -0
  30. package/dist/feedback-internal.d.ts.map +1 -0
  31. package/dist/feedback.d.ts +53 -0
  32. package/dist/feedback.d.ts.map +1 -0
  33. package/dist/manifest.json +13 -1
  34. package/dist/models.js +1 -1
  35. package/dist/models.js.map +1 -1
  36. package/dist/proposal-contracts.d.ts +89 -0
  37. package/dist/proposal-contracts.d.ts.map +1 -0
  38. package/dist/proposal-dto.d.ts +124 -0
  39. package/dist/proposal-dto.d.ts.map +1 -0
  40. package/dist/proposal-errors.d.ts +5 -0
  41. package/dist/proposal-errors.d.ts.map +1 -0
  42. package/dist/proposal-sdk.d.ts +12 -0
  43. package/dist/proposal-sdk.d.ts.map +1 -0
  44. package/dist/proposal-validation.d.ts +188 -0
  45. package/dist/proposal-validation.d.ts.map +1 -0
  46. package/dist/proposals.d.ts +44 -0
  47. package/dist/proposals.d.ts.map +1 -0
  48. package/dist/proposals.js +964 -0
  49. package/dist/proposals.js.map +1 -0
  50. package/dist/review-dto.d.ts +115 -0
  51. package/dist/review-dto.d.ts.map +1 -0
  52. package/dist/server.d.ts +56 -0
  53. package/dist/server.d.ts.map +1 -1
  54. package/dist/server.js +263 -341
  55. package/dist/server.js.map +1 -1
  56. package/dist/smrt-knowledge.json +87 -12
  57. package/dist/svelte/components/ActionReview.svelte +232 -0
  58. package/dist/svelte/components/ActionReview.svelte.d.ts +15 -0
  59. package/dist/svelte/components/ActionReview.svelte.d.ts.map +1 -0
  60. package/dist/svelte/components/EvidenceViewer.svelte +31 -0
  61. package/dist/svelte/components/EvidenceViewer.svelte.d.ts +8 -0
  62. package/dist/svelte/components/EvidenceViewer.svelte.d.ts.map +1 -0
  63. package/dist/svelte/components/InboxView.svelte +119 -0
  64. package/dist/svelte/components/InboxView.svelte.d.ts +9 -0
  65. package/dist/svelte/components/InboxView.svelte.d.ts.map +1 -0
  66. package/dist/svelte/components/IntakeInbox.svelte +11 -0
  67. package/dist/svelte/components/IntakeInbox.svelte.d.ts +10 -0
  68. package/dist/svelte/components/IntakeInbox.svelte.d.ts.map +1 -0
  69. package/dist/svelte/components/IntakeReview.svelte +11 -0
  70. package/dist/svelte/components/IntakeReview.svelte.d.ts +10 -0
  71. package/dist/svelte/components/IntakeReview.svelte.d.ts.map +1 -0
  72. package/dist/svelte/components/ReviewView.svelte +243 -0
  73. package/dist/svelte/components/ReviewView.svelte.d.ts +9 -0
  74. package/dist/svelte/components/ReviewView.svelte.d.ts.map +1 -0
  75. package/dist/svelte/i18n.d.ts +72 -0
  76. package/dist/svelte/i18n.d.ts.map +1 -0
  77. package/dist/svelte/i18n.js +72 -0
  78. package/dist/svelte/index.d.ts +5 -0
  79. package/dist/svelte/index.d.ts.map +1 -0
  80. package/dist/svelte/index.js +3 -0
  81. package/dist/svelte/view-utils.d.ts +13 -0
  82. package/dist/svelte/view-utils.d.ts.map +1 -0
  83. package/dist/svelte/view-utils.js +96 -0
  84. package/package.json +53 -22
  85. package/dist/execution.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ export { default as EvidenceViewer } from './components/EvidenceViewer.svelte';
2
+ export { default as IntakeInbox } from './components/IntakeInbox.svelte';
3
+ export { default as IntakeReview } from './components/IntakeReview.svelte';
@@ -0,0 +1,13 @@
1
+ import type { EvidenceLocation } from '../extraction-types.js';
2
+ /** Only host-authorized same-origin HTTP URLs may reach original media elements. */
3
+ export declare function evidenceUrl(value?: string, origin?: string): string | undefined;
4
+ export declare function argumentsObject(value: string): Record<string, unknown>;
5
+ export declare function pageGroups(value: string): number[][];
6
+ /** Project useful extraction content; never present internal configuration/provenance JSON. */
7
+ export declare function extractedContent(output: Record<string, unknown>): Array<{
8
+ evidenceId: string;
9
+ text: string;
10
+ location?: EvidenceLocation;
11
+ confidence?: number;
12
+ }>;
13
+ //# sourceMappingURL=view-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-utils.d.ts","sourceRoot":"","sources":["../../src/svelte/view-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,oFAAoF;AACpF,wBAAgB,WAAW,CACzB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAmBpB;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKtE;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,CAcpD;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAsED"}
@@ -0,0 +1,96 @@
1
+ /** Only host-authorized same-origin HTTP URLs may reach original media elements. */
2
+ export function evidenceUrl(value, origin) {
3
+ if (!value)
4
+ return undefined;
5
+ const base = origin ??
6
+ (typeof window === 'undefined' ? undefined : window.location.origin);
7
+ if (!base)
8
+ return value.startsWith('/') &&
9
+ !value.startsWith('//') &&
10
+ !value.includes('\\')
11
+ ? value
12
+ : undefined;
13
+ try {
14
+ const url = new URL(value, base);
15
+ return ['http:', 'https:'].includes(url.protocol) && url.origin === base
16
+ ? url.href
17
+ : undefined;
18
+ }
19
+ catch {
20
+ return undefined;
21
+ }
22
+ }
23
+ export function argumentsObject(value) {
24
+ const result = JSON.parse(value);
25
+ if (!result || typeof result !== 'object' || Array.isArray(result))
26
+ throw new Error('Invalid arguments');
27
+ return result;
28
+ }
29
+ export function pageGroups(value) {
30
+ const result = JSON.parse(value);
31
+ if (!Array.isArray(result) ||
32
+ !result.length ||
33
+ !result.every((group) => Array.isArray(group) &&
34
+ group.length &&
35
+ group.every((page) => Number.isSafeInteger(page) && page > 0)))
36
+ throw new Error('Invalid groups');
37
+ return result;
38
+ }
39
+ /** Project useful extraction content; never present internal configuration/provenance JSON. */
40
+ export function extractedContent(output) {
41
+ const content = [];
42
+ if (!Array.isArray(output.results))
43
+ return content;
44
+ for (const result of output.results) {
45
+ if (!result ||
46
+ typeof result !== 'object' ||
47
+ !result.evidence ||
48
+ typeof result.evidence.id !== 'string' ||
49
+ !Array.isArray(result.segments))
50
+ continue;
51
+ for (const segment of result.segments) {
52
+ if (!segment ||
53
+ typeof segment !== 'object' ||
54
+ typeof segment.text !== 'string')
55
+ continue;
56
+ const value = segment.location;
57
+ let location;
58
+ if (value?.kind === 'source')
59
+ location = { kind: 'source' };
60
+ if (value?.kind === 'page' &&
61
+ Number.isSafeInteger(value.page) &&
62
+ value.page > 0)
63
+ location = { kind: 'page', page: value.page };
64
+ if (value?.kind === 'pages' &&
65
+ Number.isSafeInteger(value.startPage) &&
66
+ value.startPage > 0 &&
67
+ Number.isSafeInteger(value.endPage) &&
68
+ value.endPage >= value.startPage)
69
+ location = {
70
+ kind: 'pages',
71
+ startPage: value.startPage,
72
+ endPage: value.endPage,
73
+ };
74
+ if (value?.kind === 'time' &&
75
+ Number.isFinite(value.startMs) &&
76
+ value.startMs >= 0 &&
77
+ Number.isFinite(value.endMs) &&
78
+ value.endMs >= value.startMs)
79
+ location = { kind: 'time', startMs: value.startMs, endMs: value.endMs };
80
+ const confidence = segment.confidence?.scale === '0-1' &&
81
+ typeof segment.confidence.value === 'number' &&
82
+ Number.isFinite(segment.confidence.value) &&
83
+ segment.confidence.value >= 0 &&
84
+ segment.confidence.value <= 1
85
+ ? segment.confidence.value
86
+ : undefined;
87
+ content.push({
88
+ evidenceId: result.evidence.id,
89
+ text: segment.text,
90
+ ...(location ? { location } : {}),
91
+ ...(confidence !== undefined ? { confidence } : {}),
92
+ });
93
+ }
94
+ }
95
+ return content;
96
+ }
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-ingestion",
3
- "version": "0.55.5",
3
+ "version": "0.55.7",
4
4
  "description": "Durable tenant-scoped intake and evidence foundations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "files": [
9
9
  "dist",
10
+ "agents",
10
11
  "AGENTS.md",
11
12
  "CLAUDE.md",
12
- "EXTRACTION.md"
13
+ "EXTRACTION.md",
14
+ "PROPOSALS.md",
15
+ "REVIEW.md",
16
+ "FEEDBACK.md"
13
17
  ],
14
18
  "exports": {
15
19
  ".": {
@@ -33,32 +37,51 @@
33
37
  "./execution": {
34
38
  "types": "./dist/execution.d.ts",
35
39
  "import": "./dist/execution.js"
40
+ },
41
+ "./proposals": {
42
+ "types": "./dist/proposals.d.ts",
43
+ "import": "./dist/proposals.js"
44
+ },
45
+ "./svelte": {
46
+ "types": "./dist/svelte/index.d.ts",
47
+ "svelte": "./dist/svelte/index.js",
48
+ "import": "./dist/svelte/index.js",
49
+ "default": "./dist/svelte/index.js"
36
50
  }
37
51
  },
38
52
  "dependencies": {
39
- "@happyvertical/smrt-core": "0.55.5",
40
- "@happyvertical/smrt-types": "0.55.5",
41
- "@happyvertical/smrt-tenancy": "0.55.5",
42
- "@happyvertical/smrt-assets": "0.55.5",
43
- "@happyvertical/smrt-jobs": "0.55.5",
44
- "@happyvertical/sql": "^0.102.4",
53
+ "@happyvertical/smrt-core": "0.55.7",
54
+ "@happyvertical/smrt-types": "0.55.7",
55
+ "@happyvertical/smrt-tenancy": "0.55.7",
56
+ "@happyvertical/smrt-assets": "0.55.7",
57
+ "@happyvertical/smrt-jobs": "0.55.7",
58
+ "@happyvertical/sql": "^0.102.5",
45
59
  "@happyvertical/pdf": "^0.65.9",
46
60
  "@happyvertical/ocr": "^0.61.6",
47
- "@happyvertical/speech": "^0.102.4",
48
- "@happyvertical/ai": "^0.102.4",
61
+ "@happyvertical/speech": "^0.102.5",
62
+ "@happyvertical/ai": "^0.102.5",
49
63
  "sharp": "^0.35.5",
50
- "@happyvertical/smrt-agents": "0.55.5",
51
- "@happyvertical/smrt-playbooks": "0.55.5",
52
- "ajv": "8.20.0"
64
+ "@happyvertical/smrt-agents": "0.55.7",
65
+ "@happyvertical/smrt-playbooks": "0.55.7",
66
+ "ajv": "8.20.0",
67
+ "@happyvertical/smrt-ui": "0.55.7"
53
68
  },
54
69
  "devDependencies": {
55
- "@happyvertical/smrt-vitest": "0.55.5",
70
+ "@happyvertical/smrt-vitest": "0.55.7",
56
71
  "@types/node": "24.13.6",
57
72
  "typescript": "6.0.3",
58
73
  "vite": "8.1.4",
59
74
  "vitest": "4.1.10",
60
- "@happyvertical/smrt-content": "0.55.5",
61
- "@happyvertical/smrt-users": "0.55.5"
75
+ "@happyvertical/smrt-content": "0.55.7",
76
+ "@happyvertical/smrt-users": "0.55.7",
77
+ "@sveltejs/package": "^2.5.8",
78
+ "@sveltejs/vite-plugin-svelte": "^7.3.0",
79
+ "svelte": "^5.57.1",
80
+ "svelte-check": "^4.7.6",
81
+ "@testing-library/svelte": "^5.4.2",
82
+ "@testing-library/user-event": "^14.6.7",
83
+ "jsdom": "^29.1.1",
84
+ "@playwright/test": "^1.63.0"
62
85
  },
63
86
  "publishConfig": {
64
87
  "registry": "https://registry.npmjs.org",
@@ -70,14 +93,22 @@
70
93
  "url": "https://github.com/happyvertical/smrt.git",
71
94
  "directory": "packages/ingestion"
72
95
  },
96
+ "peerDependencies": {
97
+ "svelte": "^5.57.0"
98
+ },
99
+ "peerDependenciesMeta": {
100
+ "svelte": {
101
+ "optional": true
102
+ }
103
+ },
73
104
  "scripts": {
74
- "build": "vite build --mode library && node scripts/check-browser.mjs",
75
- "test": "vitest run",
105
+ "build": "vite build --mode library && node scripts/check-browser.mjs && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json && node ../../scripts/prune-svelte-package-artifacts.js dist",
106
+ "test": "vitest run && pnpm test:components",
76
107
  "test:postgres": "node ../../scripts/run-with-ci-postgres.mjs -- pnpm exec vitest run --config vitest.postgres.config.ts",
77
- "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
78
- "test:providers": "vitest run src/extraction.providers.test.ts",
79
- "test:components": "node scripts/unavailable-lane.mjs components",
80
- "test:e2e": "node scripts/unavailable-lane.mjs e2e",
108
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json && node ../../scripts/svelte-check-a11y.mjs --tsconfig ./tsconfig.svelte.json",
109
+ "test:providers": "vitest run src/extraction.providers.test.ts src/proposals.providers.test.ts",
110
+ "test:components": "vitest run --config vitest.components.config.ts",
111
+ "test:e2e": "playwright test -c e2e/review/playwright.config.ts",
81
112
  "test:evaluation": "node scripts/unavailable-lane.mjs evaluation"
82
113
  }
83
114
  }