@anchrd/intel-ui 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.
@@ -0,0 +1,4 @@
1
+ {
2
+ "defaultLanguage": "en",
3
+ "catalogs": {}
4
+ }
@@ -0,0 +1,124 @@
1
+ {
2
+ "$locale": "en-US",
3
+ "app.name": "Intel",
4
+ "nav.primary": "Primary navigation",
5
+ "nav.knowledge": "Knowledge",
6
+ "nav.flows": "Flows",
7
+ "nav.tools": "Tools",
8
+ "knowledge.title": "Company knowledge",
9
+ "knowledge.description": "Documents, decisions, and context shared by people and AI.",
10
+ "knowledge.empty": "No knowledge has been added yet.",
11
+ "knowledge.new": "New document",
12
+ "knowledge.newFolder": "New folder",
13
+ "knowledge.upload": "Upload file",
14
+ "knowledge.uploading": "Uploading…",
15
+ "knowledge.uploadFailed": "The file could not be uploaded. Check the 15 MB limit and try again.",
16
+ "knowledge.download": "Download file",
17
+ "knowledge.attachmentHelp": "The canonical file is stored privately in Intel. Its AI-readable projection is indexed separately.",
18
+ "knowledge.search": "Search knowledge",
19
+ "knowledge.noResults": "No matching knowledge found.",
20
+ "knowledge.clearSearch": "Clear search",
21
+ "knowledge.tree": "Knowledge tree",
22
+ "knowledge.select": "Select a document or folder to work with it.",
23
+ "knowledge.folderHelp": "Select a child document, or create something inside this folder.",
24
+ "knowledge.contextPolicy": "AI context policy",
25
+ "knowledge.context.pinned": "Pinned in scope",
26
+ "knowledge.context.relevant": "Load when relevant",
27
+ "knowledge.context.explicit": "Only when referenced",
28
+ "knowledge.share": "Share",
29
+ "knowledge.shareAction": "Grant access",
30
+ "knowledge.email": "Email address",
31
+ "knowledge.role": "Access level",
32
+ "knowledge.viewer": "Can view",
33
+ "knowledge.editor": "Can edit",
34
+ "knowledge.manager": "Can manage and share",
35
+ "knowledge.versions": "Version history",
36
+ "knowledge.version": "Version {sequence}",
37
+ "knowledge.archive": "Archive",
38
+ "knowledge.graph": "Knowledge graph",
39
+ "knowledge.graphDescription": "{nodes} authorized nodes and {links} explicit relationships.",
40
+ "knowledge.graphZoomIn": "Zoom in",
41
+ "knowledge.graphZoomOut": "Zoom out",
42
+ "knowledge.graphReset": "Fit graph",
43
+ "knowledge.graphFailed": "The authorized knowledge graph could not be loaded.",
44
+ "knowledge.operationFailed": "The change was not saved. Reload the latest version and try again.",
45
+ "knowledge.downloadFailed": "The attachment could not be downloaded. Check your access and try again.",
46
+ "knowledge.links": "Links and backlinks",
47
+ "knowledge.noLinks": "No explicit relationships yet.",
48
+ "knowledge.linkTarget": "Link to",
49
+ "knowledge.selectLinkTarget": "Select knowledge",
50
+ "knowledge.relation": "Relationship",
51
+ "knowledge.relation.related": "Related to",
52
+ "knowledge.relation.references": "References",
53
+ "knowledge.relation.depends_on": "Depends on",
54
+ "knowledge.relation.implements": "Implements",
55
+ "knowledge.createLink": "Create relationship",
56
+ "knowledge.deleteLink": "Delete relationship",
57
+ "knowledge.saveConflict": "This document changed elsewhere. Reload it before saving again.",
58
+ "knowledge.saveError": "This document could not be saved. Reload and try again.",
59
+ "tools.title": "Company tools",
60
+ "tools.description": "Governed MCP capabilities available to people and AI.",
61
+ "tools.empty": "No MCP source registered",
62
+ "tools.emptyHelp": "Register the aggregated Cloudflare Portal endpoint. Intel discovers its tools while Gate remains the credential and permission boundary.",
63
+ "tools.addSource": "Add MCP source",
64
+ "tools.endpoint": "Streamable HTTP endpoint",
65
+ "tools.connectionHandle": "Gate connection handle",
66
+ "tools.connect": "Connect with Gate",
67
+ "tools.sourceHelp": "Intel registers the handle/connect interface in Gate. Grant it to the right roles and keep the credential in Gate.",
68
+ "tools.discover": "Discover tools",
69
+ "tools.notDiscovered": "No tools cached yet. Connect the source in Gate, then run discovery.",
70
+ "tools.testTitle": "Tool playground",
71
+ "tools.select": "Select a discovered tool to inspect and test it.",
72
+ "tools.arguments": "Arguments (JSON object)",
73
+ "tools.runTest": "Run controlled test",
74
+ "tools.invalidJson": "Arguments must be a valid JSON object.",
75
+ "tools.destructive": "This source marks the tool as potentially destructive. Review the arguments before running it.",
76
+ "tools.connectionRequired": "Your Gate connection is missing, forbidden, or invalid.",
77
+ "tools.testUnsafe": "The playground only runs tools explicitly marked read-only and non-destructive.",
78
+ "tools.operationFailed": "The MCP operation failed. Check the source and try again.",
79
+ "tools.connectFailed": "The MCP source could not be connected with your current access.",
80
+ "tools.status.connected": "Connected",
81
+ "tools.status.missing": "Not connected",
82
+ "tools.status.forbidden": "No access",
83
+ "tools.status.invalid": "Invalid",
84
+ "flows.title": "Company flows",
85
+ "flows.description": "Model-agnostic processes that connect instructions, Knowledge, tools, and people.",
86
+ "flows.new": "New flow",
87
+ "flows.empty": "No flows have been created yet.",
88
+ "flows.select": "Select a flow or create one to open the visual editor.",
89
+ "flows.inspect": "Select a node to edit its configuration.",
90
+ "flows.publish": "Publish",
91
+ "flows.run": "Start run",
92
+ "flows.share": "Share flow",
93
+ "flows.revokeShare": "Revoke flow access",
94
+ "flows.organization": "Everyone in the organization",
95
+ "flows.published": "Published",
96
+ "flows.draft": "Draft",
97
+ "flows.runStarted": "Durable run started",
98
+ "flows.node.trigger": "Trigger",
99
+ "flows.node.instruction": "Instruction",
100
+ "flows.node.knowledge": "Knowledge",
101
+ "flows.node.tool": "Tool",
102
+ "flows.node.condition": "Condition",
103
+ "flows.node.approval": "Approval",
104
+ "flows.node.output": "Output",
105
+ "flows.nodeDescription": "Description",
106
+ "flows.instruction": "Instruction for the AI or person",
107
+ "flows.knowledgeIds": "Knowledge references",
108
+ "flows.knowledgeEmpty": "Create a knowledge item before adding this step.",
109
+ "flows.knowledgeQuery": "Semantic retrieval hint",
110
+ "flows.tool": "MCP tool",
111
+ "flows.selectTool": "Select a discovered tool",
112
+ "flows.operationFailed": "The flow operation failed. Reload the latest version and try again.",
113
+ "flows.shareFailed": "Flow access was not changed. Check your permission and try again.",
114
+ "auth.signOut": "Sign out",
115
+ "auth.signOutFailed": "Signing out failed. Check your connection and try again.",
116
+ "common.title": "Title",
117
+ "common.create": "Create",
118
+ "common.save": "Save",
119
+ "common.saving": "Saving…",
120
+ "common.loading": "Loading…",
121
+ "common.retry": "Try again",
122
+ "common.close": "Close",
123
+ "common.unavailable": "Intel is currently unavailable."
124
+ }
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ import custom from "./custom.json";
3
+ import english from "./en.json";
4
+ import type { Catalog, I18n } from "./i18n.types.ts";
5
+
6
+ const CatalogSchema = z.record(z.string(), z.string());
7
+ const BundleSchema = z.strictObject({
8
+ defaultLanguage: z.string().min(1),
9
+ catalogs: z.record(z.string(), CatalogSchema),
10
+ });
11
+ const fallback = CatalogSchema.parse(english) as Catalog;
12
+ const bundle = BundleSchema.parse(custom);
13
+
14
+ export function createI18n(language = bundle.defaultLanguage): I18n {
15
+ const customCatalog = bundle.catalogs[language];
16
+ const catalog: Catalog = customCatalog ? { ...fallback, ...customCatalog } : fallback;
17
+ return {
18
+ locale: catalog.$locale ?? fallback.$locale ?? "en-US",
19
+ t(key, variables) {
20
+ const template = catalog[key] ?? fallback[key] ?? key;
21
+ if (!variables) return template;
22
+ return template.replace(/\{(\w+)\}/g, (match, name: string) => {
23
+ const value = variables[name];
24
+ return value === undefined ? match : String(value);
25
+ });
26
+ },
27
+ };
28
+ }
@@ -0,0 +1,6 @@
1
+ export type Catalog = Record<string, string>;
2
+
3
+ export interface I18n {
4
+ locale: string;
5
+ t(key: string, variables?: Record<string, string | number>): string;
6
+ }