@yarvelle/ui 0.0.0-stage → 0.1.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.
- package/bin/yarvelle-ui-codegen.js +115 -0
- package/dist/index-DLbrj3Po.d.ts +90 -0
- package/dist/index.d.ts +706 -0
- package/dist/index.js +4418 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api/index.d.ts +99 -0
- package/dist/lib/api/index.js +113 -0
- package/dist/lib/api/index.js.map +1 -0
- package/dist/lib/auth/index.d.ts +21 -0
- package/dist/lib/auth/index.js +37 -0
- package/dist/lib/auth/index.js.map +1 -0
- package/dist/lib/cn.d.ts +5 -0
- package/dist/lib/cn.js +10 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/i18n/index.d.ts +7 -0
- package/dist/lib/i18n/index.js +45 -0
- package/dist/lib/i18n/index.js.map +1 -0
- package/dist/lib/index.d.ts +8 -0
- package/dist/lib/index.js +272 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/sse/index.d.ts +11 -0
- package/dist/lib/sse/index.js +43 -0
- package/dist/lib/sse/index.js.map +1 -0
- package/dist/lib/storage-namespace.d.ts +6 -0
- package/dist/lib/storage-namespace.js +34 -0
- package/dist/lib/storage-namespace.js.map +1 -0
- package/dist/slots/index.d.ts +12 -0
- package/dist/slots/index.js +86 -0
- package/dist/slots/index.js.map +1 -0
- package/dist/styles.css +270 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.js +36 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tokens/index.d.ts +37 -0
- package/dist/tokens/index.js +155 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/tailwind-preset.d.ts +5 -0
- package/dist/tokens/tailwind-preset.js +155 -0
- package/dist/tokens/tailwind-preset.js.map +1 -0
- package/dist/types-CP_CDg6G.d.ts +51 -0
- package/package.json +69 -4
- package/README.md +0 -3
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Yarvelle Core — Domain-Neutral AI Agent Runtime & Execution Engine
|
|
3
|
+
// Copyright 2026 Spectrayan (https://spectrayan.com)
|
|
4
|
+
//
|
|
5
|
+
// Licensed under the PolyForm Noncommercial License 1.0.0 and the
|
|
6
|
+
// Yarvelle Core Additional Terms (see LICENSE and ADDITIONAL-TERMS.md).
|
|
7
|
+
// Personal and household local use only. Commercial use, hosted service
|
|
8
|
+
// offering, rebranding, white-labeling, and redistribution of modified
|
|
9
|
+
// forks are prohibited without a written commercial license from Spectrayan.
|
|
10
|
+
//
|
|
11
|
+
// Required Notice: Copyright 2026 Spectrayan (https://spectrayan.com)
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* CLI tool: yarvelle-ui-codegen
|
|
15
|
+
* Generates pack-registry.generated.ts based on enabled packs.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import fs from 'node:fs';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
|
|
21
|
+
function printHelp() {
|
|
22
|
+
console.log(`Usage: yarvelle-ui-codegen [options]
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
--config <path> Path to config YAML or JSON (e.g. yarvelle.yaml)
|
|
26
|
+
--packs <list> Comma-separated list of enabled pack IDs (e.g. health,finance)
|
|
27
|
+
--out <path> Output path for pack-registry.generated.ts (default: src/pack-registry.generated.ts)
|
|
28
|
+
--help Show this help message
|
|
29
|
+
`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function parseArgs() {
|
|
33
|
+
const args = process.argv.slice(2);
|
|
34
|
+
let configPath = null;
|
|
35
|
+
let packs = [];
|
|
36
|
+
let outPath = 'src/pack-registry.generated.ts';
|
|
37
|
+
|
|
38
|
+
for (let i = 0; i < args.length; i++) {
|
|
39
|
+
if (args[i] === '--config' && args[i + 1]) {
|
|
40
|
+
configPath = args[++i];
|
|
41
|
+
} else if (args[i] === '--packs' && args[i + 1]) {
|
|
42
|
+
packs = args[++i].split(',').map((p) => p.trim()).filter(Boolean);
|
|
43
|
+
} else if (args[i] === '--out' && args[i + 1]) {
|
|
44
|
+
outPath = args[++i];
|
|
45
|
+
} else if (args[i] === '--help') {
|
|
46
|
+
printHelp();
|
|
47
|
+
process.exit(0);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (configPath && fs.existsSync(configPath)) {
|
|
52
|
+
const content = fs.readFileSync(configPath, 'utf-8');
|
|
53
|
+
// Simple regex parse for packs.enabled or YAML list
|
|
54
|
+
const match = content.match(/packs(?:\.enabled)?:\s*\[(.*?)\]/s);
|
|
55
|
+
if (match) {
|
|
56
|
+
const parsed = match[1]
|
|
57
|
+
.split(',')
|
|
58
|
+
.map((s) => s.replace(/['"\s]/g, ''))
|
|
59
|
+
.filter(Boolean);
|
|
60
|
+
if (parsed.length > 0) packs = parsed;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return { packs, outPath };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function generatePackRegistryCode(packs) {
|
|
68
|
+
const imports = [];
|
|
69
|
+
const packEntries = [];
|
|
70
|
+
|
|
71
|
+
for (const pack of packs) {
|
|
72
|
+
const varName = `${pack.replace(/[^a-zA-Z0-9]/g, '_')}Ui`;
|
|
73
|
+
if (pack === 'health') {
|
|
74
|
+
imports.push(`import { healthUi } from '@carefold/health-ui';`);
|
|
75
|
+
packEntries.push(` health: healthUi,`);
|
|
76
|
+
} else {
|
|
77
|
+
imports.push(`// Pack ${pack} UI contribution`);
|
|
78
|
+
packEntries.push(` // ${pack}: ${varName},`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return `// Emitted automatically by yarvelle-ui-codegen — DO NOT EDIT DIRECTLY
|
|
83
|
+
import type { PackUi, SlotContribution } from '@yarvelle/ui/slots';
|
|
84
|
+
${imports.join('\n')}
|
|
85
|
+
|
|
86
|
+
export const ENABLED_PACKS: string[] = ${JSON.stringify(packs, null, 2)};
|
|
87
|
+
|
|
88
|
+
export const PACK_REGISTRY: Record<string, PackUi | undefined> = {
|
|
89
|
+
${packEntries.join('\n')}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export function getAllSlotContributions(): SlotContribution[] {
|
|
93
|
+
const result: SlotContribution[] = [];
|
|
94
|
+
for (const packId of ENABLED_PACKS) {
|
|
95
|
+
const pack = PACK_REGISTRY[packId];
|
|
96
|
+
if (pack?.contributions) {
|
|
97
|
+
result.push(...pack.contributions);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function main() {
|
|
106
|
+
const { packs, outPath } = parseArgs();
|
|
107
|
+
const finalPacks = packs.length > 0 ? packs : ['health'];
|
|
108
|
+
const code = generatePackRegistryCode(finalPacks);
|
|
109
|
+
const resolvedOut = path.resolve(process.cwd(), outPath);
|
|
110
|
+
fs.mkdirSync(path.dirname(resolvedOut), { recursive: true });
|
|
111
|
+
fs.writeFileSync(resolvedOut, code);
|
|
112
|
+
console.log(`Generated pack registry for [${finalPacks.join(', ')}] at ${resolvedOut}`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
main();
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { S as SlotContribution } from './types-CP_CDg6G.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type MessageRole = 'user' | 'assistant' | 'system';
|
|
5
|
+
type MessageStatus = 'sending' | 'sent' | 'streaming' | 'error';
|
|
6
|
+
type RiskLevel = 'info' | 'warn' | 'danger';
|
|
7
|
+
interface ChatAttachment {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
mimeType?: string;
|
|
11
|
+
sizeBytes?: number;
|
|
12
|
+
url?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ToolCallTrace {
|
|
15
|
+
id: string;
|
|
16
|
+
toolName: string;
|
|
17
|
+
input?: Record<string, unknown> | string;
|
|
18
|
+
output?: Record<string, unknown> | string;
|
|
19
|
+
status: 'running' | 'success' | 'error';
|
|
20
|
+
durationMs?: number;
|
|
21
|
+
}
|
|
22
|
+
interface ExecutionPlanStep {
|
|
23
|
+
id: string;
|
|
24
|
+
description: string;
|
|
25
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
26
|
+
}
|
|
27
|
+
interface ApprovalRequest {
|
|
28
|
+
id: string;
|
|
29
|
+
level: RiskLevel;
|
|
30
|
+
label: string;
|
|
31
|
+
details?: Record<string, unknown>;
|
|
32
|
+
status?: 'pending' | 'approved' | 'rejected';
|
|
33
|
+
}
|
|
34
|
+
interface ChatMessage {
|
|
35
|
+
id: string;
|
|
36
|
+
role: MessageRole;
|
|
37
|
+
content: string;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
status?: MessageStatus;
|
|
40
|
+
authorName?: string;
|
|
41
|
+
avatarUrl?: string;
|
|
42
|
+
attachments?: ChatAttachment[];
|
|
43
|
+
toolTraces?: ToolCallTrace[];
|
|
44
|
+
executionPlan?: ExecutionPlanStep[];
|
|
45
|
+
approval?: ApprovalRequest;
|
|
46
|
+
reasoning?: string;
|
|
47
|
+
}
|
|
48
|
+
interface ChatSlotHooks {
|
|
49
|
+
beforeSend?: (content: string, attachments: ChatAttachment[]) => Promise<boolean | string>;
|
|
50
|
+
composerAction?: React.ReactNode;
|
|
51
|
+
messageRenderer?: (message: ChatMessage) => React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type ProfileRole = 'owner' | 'steward' | 'member' | 'viewer';
|
|
55
|
+
interface ProfileMember {
|
|
56
|
+
id: string;
|
|
57
|
+
displayName: string;
|
|
58
|
+
relationship?: string;
|
|
59
|
+
role: ProfileRole;
|
|
60
|
+
avatarUrl?: string;
|
|
61
|
+
colorToken?: string;
|
|
62
|
+
dateOfBirth?: string;
|
|
63
|
+
teenTransitionDate?: string;
|
|
64
|
+
scopes?: string[];
|
|
65
|
+
}
|
|
66
|
+
interface ScopePermission {
|
|
67
|
+
domain: string;
|
|
68
|
+
read: boolean;
|
|
69
|
+
write: boolean;
|
|
70
|
+
approve: boolean;
|
|
71
|
+
}
|
|
72
|
+
interface ViewerInviteData {
|
|
73
|
+
email: string;
|
|
74
|
+
role: 'viewer';
|
|
75
|
+
scopes: string[];
|
|
76
|
+
expiresInDays: number;
|
|
77
|
+
}
|
|
78
|
+
interface ShareBundleData {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
scopes: string[];
|
|
82
|
+
requiresPasscode?: boolean;
|
|
83
|
+
expiresAt?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare function createMockSlotContribution(overrides?: Partial<SlotContribution>): SlotContribution;
|
|
87
|
+
declare function createMockProfile(overrides?: Partial<ProfileMember>): ProfileMember;
|
|
88
|
+
declare function createMockChatMessage(overrides?: Partial<ChatMessage>): ChatMessage;
|
|
89
|
+
|
|
90
|
+
export { type ApprovalRequest as A, type ChatMessage as C, type ExecutionPlanStep as E, type MessageRole as M, type ProfileMember as P, type RiskLevel as R, type ScopePermission as S, type ToolCallTrace as T, type ViewerInviteData as V, type ChatAttachment as a, type ChatSlotHooks as b, type ShareBundleData as c, type MessageStatus as d, type ProfileRole as e, createMockChatMessage as f, createMockProfile as g, createMockSlotContribution as h };
|