@agent-native/core 0.15.4 → 0.15.6
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/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +3 -2
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +12 -10
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/components/CodeRequiredDialog.js +1 -1
- package/dist/client/components/CodeRequiredDialog.js.map +1 -1
- package/dist/client/settings/BackgroundAgentSection.d.ts.map +1 -1
- package/dist/client/settings/BackgroundAgentSection.js +2 -1
- package/dist/client/settings/BackgroundAgentSection.js.map +1 -1
- package/dist/client/settings/BrowserSection.d.ts.map +1 -1
- package/dist/client/settings/BrowserSection.js +3 -2
- package/dist/client/settings/BrowserSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.js +1 -1
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.js +1 -0
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +1 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +53 -12
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.spec.js +43 -7
- package/dist/client/settings/useBuilderStatus.spec.js.map +1 -1
- package/dist/client/transcription/BuilderTranscriptionCta.d.ts.map +1 -1
- package/dist/client/transcription/BuilderTranscriptionCta.js +7 -2
- package/dist/client/transcription/BuilderTranscriptionCta.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +3 -1
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +19 -2
- package/dist/server/auth.js.map +1 -1
- package/dist/server/builder-browser.d.ts +15 -0
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +80 -1
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +58 -18
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/dev-mode.d.ts +0 -14
- package/dist/client/dev-mode.d.ts.map +0 -1
- package/dist/client/dev-mode.js +0 -14
- package/dist/client/dev-mode.js.map +0 -1
- package/dist/client/extensions/EmbeddedTool.d.ts +0 -20
- package/dist/client/extensions/EmbeddedTool.d.ts.map +0 -1
- package/dist/client/extensions/EmbeddedTool.js +0 -199
- package/dist/client/extensions/EmbeddedTool.js.map +0 -1
- package/dist/client/extensions/ToolEditor.d.ts +0 -5
- package/dist/client/extensions/ToolEditor.d.ts.map +0 -1
- package/dist/client/extensions/ToolEditor.js +0 -129
- package/dist/client/extensions/ToolEditor.js.map +0 -1
- package/dist/client/extensions/ToolViewer.d.ts +0 -5
- package/dist/client/extensions/ToolViewer.d.ts.map +0 -1
- package/dist/client/extensions/ToolViewer.js +0 -400
- package/dist/client/extensions/ToolViewer.js.map +0 -1
- package/dist/client/extensions/ToolViewerPage.d.ts +0 -2
- package/dist/client/extensions/ToolViewerPage.d.ts.map +0 -1
- package/dist/client/extensions/ToolViewerPage.js +0 -24
- package/dist/client/extensions/ToolViewerPage.js.map +0 -1
- package/dist/client/extensions/ToolsListPage.d.ts +0 -2
- package/dist/client/extensions/ToolsListPage.d.ts.map +0 -1
- package/dist/client/extensions/ToolsListPage.js +0 -67
- package/dist/client/extensions/ToolsListPage.js.map +0 -1
- package/dist/client/extensions/ToolsSidebarSection.d.ts +0 -2
- package/dist/client/extensions/ToolsSidebarSection.d.ts.map +0 -1
- package/dist/client/extensions/ToolsSidebarSection.js +0 -236
- package/dist/client/extensions/ToolsSidebarSection.js.map +0 -1
- package/dist/client/extensions/tool-order.d.ts +0 -7
- package/dist/client/extensions/tool-order.d.ts.map +0 -1
- package/dist/client/extensions/tool-order.js +0 -47
- package/dist/client/extensions/tool-order.js.map +0 -1
- package/dist/client/tools/EmbeddedTool.d.ts +0 -20
- package/dist/client/tools/EmbeddedTool.d.ts.map +0 -1
- package/dist/client/tools/EmbeddedTool.js +0 -199
- package/dist/client/tools/EmbeddedTool.js.map +0 -1
- package/dist/client/tools/ExtensionSlot.d.ts +0 -27
- package/dist/client/tools/ExtensionSlot.d.ts.map +0 -1
- package/dist/client/tools/ExtensionSlot.js +0 -96
- package/dist/client/tools/ExtensionSlot.js.map +0 -1
- package/dist/client/tools/ToolEditor.d.ts +0 -5
- package/dist/client/tools/ToolEditor.d.ts.map +0 -1
- package/dist/client/tools/ToolEditor.js +0 -129
- package/dist/client/tools/ToolEditor.js.map +0 -1
- package/dist/client/tools/ToolViewer.d.ts +0 -5
- package/dist/client/tools/ToolViewer.d.ts.map +0 -1
- package/dist/client/tools/ToolViewer.js +0 -400
- package/dist/client/tools/ToolViewer.js.map +0 -1
- package/dist/client/tools/ToolViewerPage.d.ts +0 -2
- package/dist/client/tools/ToolViewerPage.d.ts.map +0 -1
- package/dist/client/tools/ToolViewerPage.js +0 -24
- package/dist/client/tools/ToolViewerPage.js.map +0 -1
- package/dist/client/tools/ToolsListPage.d.ts +0 -2
- package/dist/client/tools/ToolsListPage.d.ts.map +0 -1
- package/dist/client/tools/ToolsListPage.js +0 -67
- package/dist/client/tools/ToolsListPage.js.map +0 -1
- package/dist/client/tools/ToolsSidebarSection.d.ts +0 -2
- package/dist/client/tools/ToolsSidebarSection.d.ts.map +0 -1
- package/dist/client/tools/ToolsSidebarSection.js +0 -236
- package/dist/client/tools/ToolsSidebarSection.js.map +0 -1
- package/dist/client/tools/iframe-bridge.d.ts +0 -38
- package/dist/client/tools/iframe-bridge.d.ts.map +0 -1
- package/dist/client/tools/iframe-bridge.js +0 -207
- package/dist/client/tools/iframe-bridge.js.map +0 -1
- package/dist/client/tools/index.d.ts +0 -8
- package/dist/client/tools/index.d.ts.map +0 -1
- package/dist/client/tools/index.js +0 -8
- package/dist/client/tools/index.js.map +0 -1
- package/dist/client/tools/tool-order.d.ts +0 -7
- package/dist/client/tools/tool-order.d.ts.map +0 -1
- package/dist/client/tools/tool-order.js +0 -47
- package/dist/client/tools/tool-order.js.map +0 -1
- package/dist/server/local-migration.d.ts +0 -41
- package/dist/server/local-migration.d.ts.map +0 -1
- package/dist/server/local-migration.js +0 -235
- package/dist/server/local-migration.js.map +0 -1
- package/dist/tools/actions.d.ts +0 -3
- package/dist/tools/actions.d.ts.map +0 -1
- package/dist/tools/actions.js +0 -272
- package/dist/tools/actions.js.map +0 -1
- package/dist/tools/fetch-tool.d.ts +0 -23
- package/dist/tools/fetch-tool.d.ts.map +0 -1
- package/dist/tools/fetch-tool.js +0 -178
- package/dist/tools/fetch-tool.js.map +0 -1
- package/dist/tools/html-shell.d.ts +0 -45
- package/dist/tools/html-shell.d.ts.map +0 -1
- package/dist/tools/html-shell.js +0 -514
- package/dist/tools/html-shell.js.map +0 -1
- package/dist/tools/proxy-security.d.ts +0 -12
- package/dist/tools/proxy-security.d.ts.map +0 -1
- package/dist/tools/proxy-security.js +0 -158
- package/dist/tools/proxy-security.js.map +0 -1
- package/dist/tools/routes.d.ts +0 -2
- package/dist/tools/routes.d.ts.map +0 -1
- package/dist/tools/routes.js +0 -627
- package/dist/tools/routes.js.map +0 -1
- package/dist/tools/schema.d.ts +0 -664
- package/dist/tools/schema.d.ts.map +0 -1
- package/dist/tools/schema.js +0 -146
- package/dist/tools/schema.js.map +0 -1
- package/dist/tools/slots/routes.d.ts +0 -15
- package/dist/tools/slots/routes.d.ts.map +0 -1
- package/dist/tools/slots/routes.js +0 -94
- package/dist/tools/slots/routes.js.map +0 -1
- package/dist/tools/slots/schema.d.ts +0 -303
- package/dist/tools/slots/schema.d.ts.map +0 -1
- package/dist/tools/slots/schema.js +0 -76
- package/dist/tools/slots/schema.js.map +0 -1
- package/dist/tools/slots/store.d.ts +0 -66
- package/dist/tools/slots/store.d.ts.map +0 -1
- package/dist/tools/slots/store.js +0 -227
- package/dist/tools/slots/store.js.map +0 -1
- package/dist/tools/store.d.ts +0 -40
- package/dist/tools/store.d.ts.map +0 -1
- package/dist/tools/store.js +0 -193
- package/dist/tools/store.js.map +0 -1
- package/dist/tools/theme.d.ts +0 -2
- package/dist/tools/theme.d.ts.map +0 -1
- package/dist/tools/theme.js +0 -67
- package/dist/tools/theme.js.map +0 -1
- package/dist/tools/url-safety.d.ts +0 -24
- package/dist/tools/url-safety.d.ts.map +0 -1
- package/dist/tools/url-safety.js +0 -224
- package/dist/tools/url-safety.js.map +0 -1
package/dist/tools/schema.js
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Drizzle schema for the framework tools system.
|
|
3
|
-
*
|
|
4
|
-
* Tools are mini Alpine.js apps that run inside sandboxed iframes. They can
|
|
5
|
-
* call external APIs via a server-side proxy that resolves `${keys.NAME}`
|
|
6
|
-
* secret references. Tools use the standard sharing model (private by default,
|
|
7
|
-
* shareable with org/others).
|
|
8
|
-
*
|
|
9
|
-
* The tables are auto-created at server boot via `ensureTable()` in store.ts,
|
|
10
|
-
* following the same pattern as `app_secrets`.
|
|
11
|
-
*/
|
|
12
|
-
import { table, text, now } from "../db/schema.js";
|
|
13
|
-
import { ownableColumns, createSharesTable } from "../sharing/schema.js";
|
|
14
|
-
export const tools = table("tools", {
|
|
15
|
-
id: text("id").primaryKey(),
|
|
16
|
-
name: text("name").notNull(),
|
|
17
|
-
description: text("description").notNull().default(""),
|
|
18
|
-
content: text("content").notNull().default(""),
|
|
19
|
-
icon: text("icon"),
|
|
20
|
-
createdAt: text("created_at").notNull().default(now()),
|
|
21
|
-
updatedAt: text("updated_at").notNull().default(now()),
|
|
22
|
-
...ownableColumns(),
|
|
23
|
-
});
|
|
24
|
-
export const toolShares = createSharesTable("tool_shares");
|
|
25
|
-
export const TOOLS_CREATE_SQL = `CREATE TABLE IF NOT EXISTS tools (
|
|
26
|
-
id TEXT PRIMARY KEY,
|
|
27
|
-
name TEXT NOT NULL,
|
|
28
|
-
description TEXT NOT NULL DEFAULT '',
|
|
29
|
-
content TEXT NOT NULL DEFAULT '',
|
|
30
|
-
icon TEXT,
|
|
31
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
32
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
33
|
-
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
34
|
-
org_id TEXT,
|
|
35
|
-
visibility TEXT NOT NULL DEFAULT 'private'
|
|
36
|
-
)`;
|
|
37
|
-
export const TOOLS_CREATE_SQL_PG = `CREATE TABLE IF NOT EXISTS tools (
|
|
38
|
-
id TEXT PRIMARY KEY,
|
|
39
|
-
name TEXT NOT NULL,
|
|
40
|
-
description TEXT NOT NULL DEFAULT '',
|
|
41
|
-
content TEXT NOT NULL DEFAULT '',
|
|
42
|
-
icon TEXT,
|
|
43
|
-
created_at TEXT NOT NULL DEFAULT now(),
|
|
44
|
-
updated_at TEXT NOT NULL DEFAULT now(),
|
|
45
|
-
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
46
|
-
org_id TEXT,
|
|
47
|
-
visibility TEXT NOT NULL DEFAULT 'private'
|
|
48
|
-
)`;
|
|
49
|
-
export const TOOL_SHARES_CREATE_SQL = `CREATE TABLE IF NOT EXISTS tool_shares (
|
|
50
|
-
id TEXT PRIMARY KEY,
|
|
51
|
-
resource_id TEXT NOT NULL,
|
|
52
|
-
principal_type TEXT NOT NULL,
|
|
53
|
-
principal_id TEXT NOT NULL,
|
|
54
|
-
role TEXT NOT NULL DEFAULT 'viewer',
|
|
55
|
-
created_by TEXT NOT NULL,
|
|
56
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
57
|
-
)`;
|
|
58
|
-
export const TOOL_SHARES_CREATE_SQL_PG = `CREATE TABLE IF NOT EXISTS tool_shares (
|
|
59
|
-
id TEXT PRIMARY KEY,
|
|
60
|
-
resource_id TEXT NOT NULL,
|
|
61
|
-
principal_type TEXT NOT NULL,
|
|
62
|
-
principal_id TEXT NOT NULL,
|
|
63
|
-
role TEXT NOT NULL DEFAULT 'viewer',
|
|
64
|
-
created_by TEXT NOT NULL,
|
|
65
|
-
created_at TEXT NOT NULL DEFAULT now()
|
|
66
|
-
)`;
|
|
67
|
-
export const toolData = table("tool_data", {
|
|
68
|
-
id: text("id").primaryKey(),
|
|
69
|
-
toolId: text("tool_id").notNull(),
|
|
70
|
-
collection: text("collection").notNull(),
|
|
71
|
-
itemId: text("item_id"),
|
|
72
|
-
data: text("data").notNull(),
|
|
73
|
-
ownerEmail: text("owner_email").notNull().default("local@localhost"),
|
|
74
|
-
scope: text("scope").notNull().default("user"),
|
|
75
|
-
orgId: text("org_id"),
|
|
76
|
-
scopeKey: text("scope_key").notNull().default("local@localhost"),
|
|
77
|
-
createdAt: text("created_at").notNull().default(now()),
|
|
78
|
-
updatedAt: text("updated_at").notNull().default(now()),
|
|
79
|
-
});
|
|
80
|
-
export const TOOL_DATA_CREATE_SQL = `CREATE TABLE IF NOT EXISTS tool_data (
|
|
81
|
-
id TEXT PRIMARY KEY,
|
|
82
|
-
tool_id TEXT NOT NULL,
|
|
83
|
-
collection TEXT NOT NULL,
|
|
84
|
-
item_id TEXT,
|
|
85
|
-
data TEXT NOT NULL,
|
|
86
|
-
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
87
|
-
scope TEXT NOT NULL DEFAULT 'user',
|
|
88
|
-
org_id TEXT,
|
|
89
|
-
scope_key TEXT NOT NULL DEFAULT 'local@localhost',
|
|
90
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
91
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
92
|
-
)`;
|
|
93
|
-
export const TOOL_DATA_CREATE_SQL_PG = `CREATE TABLE IF NOT EXISTS tool_data (
|
|
94
|
-
id TEXT PRIMARY KEY,
|
|
95
|
-
tool_id TEXT NOT NULL,
|
|
96
|
-
collection TEXT NOT NULL,
|
|
97
|
-
item_id TEXT,
|
|
98
|
-
data TEXT NOT NULL,
|
|
99
|
-
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
100
|
-
scope TEXT NOT NULL DEFAULT 'user',
|
|
101
|
-
org_id TEXT,
|
|
102
|
-
scope_key TEXT NOT NULL DEFAULT 'local@localhost',
|
|
103
|
-
created_at TEXT NOT NULL DEFAULT now(),
|
|
104
|
-
updated_at TEXT NOT NULL DEFAULT now()
|
|
105
|
-
)`;
|
|
106
|
-
export const TOOL_DATA_ITEM_INDEX_SQL = `CREATE UNIQUE INDEX IF NOT EXISTS tool_data_scoped_item_idx
|
|
107
|
-
ON tool_data (tool_id, collection, scope_key, item_id)`;
|
|
108
|
-
export const TOOL_DATA_ITEM_INDEX_SQL_PG = `CREATE UNIQUE INDEX IF NOT EXISTS tool_data_scoped_item_idx
|
|
109
|
-
ON tool_data (tool_id, collection, scope_key, item_id)`;
|
|
110
|
-
export const TOOL_DATA_DROP_OLD_INDEX_SQL = `DROP INDEX IF EXISTS tool_data_scope_item_idx`;
|
|
111
|
-
export const TOOL_DATA_DROP_OLD_INDEX_SQL_PG = `DROP INDEX IF EXISTS tool_data_scope_item_idx`;
|
|
112
|
-
export const TOOLS_OWNER_INDEX_SQL = `CREATE INDEX IF NOT EXISTS tools_owner_idx ON tools (owner_email)`;
|
|
113
|
-
export const TOOLS_ORG_INDEX_SQL = `CREATE INDEX IF NOT EXISTS tools_org_idx ON tools (org_id)`;
|
|
114
|
-
export const TOOL_SHARES_RESOURCE_INDEX_SQL = `CREATE INDEX IF NOT EXISTS tool_shares_resource_idx ON tool_shares (resource_id)`;
|
|
115
|
-
// ---------------------------------------------------------------------------
|
|
116
|
-
// tool_consents — vestigial, kept for additive-schema compliance
|
|
117
|
-
// ---------------------------------------------------------------------------
|
|
118
|
-
//
|
|
119
|
-
// Originally added for an audit-C1 per-(viewer, tool, content_hash) consent
|
|
120
|
-
// gate that prompted viewers to "Run anyway" before non-author tools could
|
|
121
|
-
// execute. We removed the runtime gate after settling on intra-org trust
|
|
122
|
-
// (tools are shared between trusted teammates; the org-level access controls
|
|
123
|
-
// are sufficient). The table is kept here so deploys that already ran the
|
|
124
|
-
// migration stay healthy — additive-only schema policy means we never drop.
|
|
125
|
-
export const toolConsents = table("tool_consents", {
|
|
126
|
-
viewerEmail: text("viewer_email").notNull(),
|
|
127
|
-
toolId: text("tool_id").notNull(),
|
|
128
|
-
contentHash: text("content_hash").notNull(),
|
|
129
|
-
grantedAt: text("granted_at").notNull().default(now()),
|
|
130
|
-
});
|
|
131
|
-
export const TOOL_CONSENTS_CREATE_SQL = `CREATE TABLE IF NOT EXISTS tool_consents (
|
|
132
|
-
viewer_email TEXT NOT NULL,
|
|
133
|
-
tool_id TEXT NOT NULL,
|
|
134
|
-
content_hash TEXT NOT NULL,
|
|
135
|
-
granted_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
136
|
-
PRIMARY KEY (viewer_email, tool_id, content_hash)
|
|
137
|
-
)`;
|
|
138
|
-
export const TOOL_CONSENTS_CREATE_SQL_PG = `CREATE TABLE IF NOT EXISTS tool_consents (
|
|
139
|
-
viewer_email TEXT NOT NULL,
|
|
140
|
-
tool_id TEXT NOT NULL,
|
|
141
|
-
content_hash TEXT NOT NULL,
|
|
142
|
-
granted_at TEXT NOT NULL DEFAULT now(),
|
|
143
|
-
PRIMARY KEY (viewer_email, tool_id, content_hash)
|
|
144
|
-
)`;
|
|
145
|
-
export const TOOL_CONSENTS_VIEWER_INDEX_SQL = `CREATE INDEX IF NOT EXISTS tool_consents_viewer_idx ON tool_consents (viewer_email, tool_id)`;
|
|
146
|
-
//# sourceMappingURL=schema.js.map
|
package/dist/tools/schema.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/tools/schema.ts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;AAChG,MAAM,CAAC,MAAM,8BAA8B,GAAG,kFAAkF,CAAC;AAEjI,8EAA8E;AAC9E,iEAAiE;AACjE,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAE5E,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,EAAE;IACjD,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;IAC3C,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;IACjC,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;IAC3C,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;CACvD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;EAMtC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;EAMzC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,8FAA8F,CAAC","sourcesContent":["/**\n * Drizzle schema for the framework tools system.\n *\n * Tools are mini Alpine.js apps that run inside sandboxed iframes. They can\n * call external APIs via a server-side proxy that resolves `${keys.NAME}`\n * secret references. Tools use the standard sharing model (private by default,\n * shareable with org/others).\n *\n * The tables are auto-created at server boot via `ensureTable()` in store.ts,\n * following the same pattern as `app_secrets`.\n */\n\nimport { table, text, now } from \"../db/schema.js\";\nimport { ownableColumns, createSharesTable } from \"../sharing/schema.js\";\n\nexport const tools = table(\"tools\", {\n id: text(\"id\").primaryKey(),\n name: text(\"name\").notNull(),\n description: text(\"description\").notNull().default(\"\"),\n content: text(\"content\").notNull().default(\"\"),\n icon: text(\"icon\"),\n createdAt: text(\"created_at\").notNull().default(now()),\n updatedAt: text(\"updated_at\").notNull().default(now()),\n ...ownableColumns(),\n});\n\nexport const toolShares = createSharesTable(\"tool_shares\");\n\nexport const TOOLS_CREATE_SQL = `CREATE TABLE IF NOT EXISTS tools (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n description TEXT NOT NULL DEFAULT '',\n content TEXT NOT NULL DEFAULT '',\n icon TEXT,\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n updated_at TEXT NOT NULL DEFAULT (datetime('now')),\n owner_email TEXT NOT NULL DEFAULT 'local@localhost',\n org_id TEXT,\n visibility TEXT NOT NULL DEFAULT 'private'\n)`;\n\nexport const TOOLS_CREATE_SQL_PG = `CREATE TABLE IF NOT EXISTS tools (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n description TEXT NOT NULL DEFAULT '',\n content TEXT NOT NULL DEFAULT '',\n icon TEXT,\n created_at TEXT NOT NULL DEFAULT now(),\n updated_at TEXT NOT NULL DEFAULT now(),\n owner_email TEXT NOT NULL DEFAULT 'local@localhost',\n org_id TEXT,\n visibility TEXT NOT NULL DEFAULT 'private'\n)`;\n\nexport const TOOL_SHARES_CREATE_SQL = `CREATE TABLE IF NOT EXISTS tool_shares (\n id TEXT PRIMARY KEY,\n resource_id TEXT NOT NULL,\n principal_type TEXT NOT NULL,\n principal_id TEXT NOT NULL,\n role TEXT NOT NULL DEFAULT 'viewer',\n created_by TEXT NOT NULL,\n created_at TEXT NOT NULL DEFAULT (datetime('now'))\n)`;\n\nexport const TOOL_SHARES_CREATE_SQL_PG = `CREATE TABLE IF NOT EXISTS tool_shares (\n id TEXT PRIMARY KEY,\n resource_id TEXT NOT NULL,\n principal_type TEXT NOT NULL,\n principal_id TEXT NOT NULL,\n role TEXT NOT NULL DEFAULT 'viewer',\n created_by TEXT NOT NULL,\n created_at TEXT NOT NULL DEFAULT now()\n)`;\n\nexport const toolData = table(\"tool_data\", {\n id: text(\"id\").primaryKey(),\n toolId: text(\"tool_id\").notNull(),\n collection: text(\"collection\").notNull(),\n itemId: text(\"item_id\"),\n data: text(\"data\").notNull(),\n ownerEmail: text(\"owner_email\").notNull().default(\"local@localhost\"),\n scope: text(\"scope\").notNull().default(\"user\"),\n orgId: text(\"org_id\"),\n scopeKey: text(\"scope_key\").notNull().default(\"local@localhost\"),\n createdAt: text(\"created_at\").notNull().default(now()),\n updatedAt: text(\"updated_at\").notNull().default(now()),\n});\n\nexport const TOOL_DATA_CREATE_SQL = `CREATE TABLE IF NOT EXISTS tool_data (\n id TEXT PRIMARY KEY,\n tool_id TEXT NOT NULL,\n collection TEXT NOT NULL,\n item_id TEXT,\n data TEXT NOT NULL,\n owner_email TEXT NOT NULL DEFAULT 'local@localhost',\n scope TEXT NOT NULL DEFAULT 'user',\n org_id TEXT,\n scope_key TEXT NOT NULL DEFAULT 'local@localhost',\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n updated_at TEXT NOT NULL DEFAULT (datetime('now'))\n)`;\n\nexport const TOOL_DATA_CREATE_SQL_PG = `CREATE TABLE IF NOT EXISTS tool_data (\n id TEXT PRIMARY KEY,\n tool_id TEXT NOT NULL,\n collection TEXT NOT NULL,\n item_id TEXT,\n data TEXT NOT NULL,\n owner_email TEXT NOT NULL DEFAULT 'local@localhost',\n scope TEXT NOT NULL DEFAULT 'user',\n org_id TEXT,\n scope_key TEXT NOT NULL DEFAULT 'local@localhost',\n created_at TEXT NOT NULL DEFAULT now(),\n updated_at TEXT NOT NULL DEFAULT now()\n)`;\n\nexport const TOOL_DATA_ITEM_INDEX_SQL = `CREATE UNIQUE INDEX IF NOT EXISTS tool_data_scoped_item_idx\n ON tool_data (tool_id, collection, scope_key, item_id)`;\n\nexport const TOOL_DATA_ITEM_INDEX_SQL_PG = `CREATE UNIQUE INDEX IF NOT EXISTS tool_data_scoped_item_idx\n ON tool_data (tool_id, collection, scope_key, item_id)`;\n\nexport const TOOL_DATA_DROP_OLD_INDEX_SQL = `DROP INDEX IF EXISTS tool_data_scope_item_idx`;\nexport const TOOL_DATA_DROP_OLD_INDEX_SQL_PG = `DROP INDEX IF EXISTS tool_data_scope_item_idx`;\n\nexport const TOOLS_OWNER_INDEX_SQL = `CREATE INDEX IF NOT EXISTS tools_owner_idx ON tools (owner_email)`;\nexport const TOOLS_ORG_INDEX_SQL = `CREATE INDEX IF NOT EXISTS tools_org_idx ON tools (org_id)`;\nexport const TOOL_SHARES_RESOURCE_INDEX_SQL = `CREATE INDEX IF NOT EXISTS tool_shares_resource_idx ON tool_shares (resource_id)`;\n\n// ---------------------------------------------------------------------------\n// tool_consents — vestigial, kept for additive-schema compliance\n// ---------------------------------------------------------------------------\n//\n// Originally added for an audit-C1 per-(viewer, tool, content_hash) consent\n// gate that prompted viewers to \"Run anyway\" before non-author tools could\n// execute. We removed the runtime gate after settling on intra-org trust\n// (tools are shared between trusted teammates; the org-level access controls\n// are sufficient). The table is kept here so deploys that already ran the\n// migration stay healthy — additive-only schema policy means we never drop.\n\nexport const toolConsents = table(\"tool_consents\", {\n viewerEmail: text(\"viewer_email\").notNull(),\n toolId: text(\"tool_id\").notNull(),\n contentHash: text(\"content_hash\").notNull(),\n grantedAt: text(\"granted_at\").notNull().default(now()),\n});\n\nexport const TOOL_CONSENTS_CREATE_SQL = `CREATE TABLE IF NOT EXISTS tool_consents (\n viewer_email TEXT NOT NULL,\n tool_id TEXT NOT NULL,\n content_hash TEXT NOT NULL,\n granted_at TEXT NOT NULL DEFAULT (datetime('now')),\n PRIMARY KEY (viewer_email, tool_id, content_hash)\n)`;\n\nexport const TOOL_CONSENTS_CREATE_SQL_PG = `CREATE TABLE IF NOT EXISTS tool_consents (\n viewer_email TEXT NOT NULL,\n tool_id TEXT NOT NULL,\n content_hash TEXT NOT NULL,\n granted_at TEXT NOT NULL DEFAULT now(),\n PRIMARY KEY (viewer_email, tool_id, content_hash)\n)`;\n\nexport const TOOL_CONSENTS_VIEWER_INDEX_SQL = `CREATE INDEX IF NOT EXISTS tool_consents_viewer_idx ON tool_consents (viewer_email, tool_id)`;\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP handler for tool extension-point slots.
|
|
3
|
-
*
|
|
4
|
-
* Mounted at `/_agent-native/slots`. Routes:
|
|
5
|
-
*
|
|
6
|
-
* GET /:slotId/installs — current user's installed widgets for a slot
|
|
7
|
-
* GET /:slotId/available — tools that declare this slot, scoped to user access
|
|
8
|
-
* POST /:slotId/install — install a tool into a slot (body: { toolId, position?, config? })
|
|
9
|
-
* DELETE /:slotId/install/:toolId — uninstall
|
|
10
|
-
* GET /tool/:toolId — list slot declarations for a specific tool
|
|
11
|
-
* POST /tool/:toolId — declare a slot target (body: { slotId, config? })
|
|
12
|
-
* DELETE /tool/:toolId/:slotId — remove a slot declaration
|
|
13
|
-
*/
|
|
14
|
-
export declare function createSlotsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<unknown>>;
|
|
15
|
-
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/tools/slots/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAuBH,wBAAgB,kBAAkB,2FAsBjC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP handler for tool extension-point slots.
|
|
3
|
-
*
|
|
4
|
-
* Mounted at `/_agent-native/slots`. Routes:
|
|
5
|
-
*
|
|
6
|
-
* GET /:slotId/installs — current user's installed widgets for a slot
|
|
7
|
-
* GET /:slotId/available — tools that declare this slot, scoped to user access
|
|
8
|
-
* POST /:slotId/install — install a tool into a slot (body: { toolId, position?, config? })
|
|
9
|
-
* DELETE /:slotId/install/:toolId — uninstall
|
|
10
|
-
* GET /tool/:toolId — list slot declarations for a specific tool
|
|
11
|
-
* POST /tool/:toolId — declare a slot target (body: { slotId, config? })
|
|
12
|
-
* DELETE /tool/:toolId/:slotId — remove a slot declaration
|
|
13
|
-
*/
|
|
14
|
-
import { defineEventHandler, getMethod, setResponseStatus, } from "h3";
|
|
15
|
-
import { readBody } from "../../server/h3-helpers.js";
|
|
16
|
-
import { getSession } from "../../server/auth.js";
|
|
17
|
-
import { recordChange } from "../../server/poll.js";
|
|
18
|
-
import { runWithRequestContext } from "../../server/request-context.js";
|
|
19
|
-
import { getOrgContext } from "../../org/context.js";
|
|
20
|
-
import { addToolSlotTarget, removeToolSlotTarget, listSlotsForTool, listToolsForSlot, installToolSlot, uninstallToolSlot, listSlotInstallsForUser, } from "./store.js";
|
|
21
|
-
export function createSlotsHandler() {
|
|
22
|
-
return defineEventHandler(async (event) => {
|
|
23
|
-
const method = getMethod(event);
|
|
24
|
-
const pathname = (event.url?.pathname || "")
|
|
25
|
-
.replace(/^\/+/, "")
|
|
26
|
-
.replace(/\/+$/, "");
|
|
27
|
-
const parts = pathname ? pathname.split("/") : [];
|
|
28
|
-
const session = await getSession(event).catch(() => null);
|
|
29
|
-
if (!session?.email) {
|
|
30
|
-
setResponseStatus(event, 401);
|
|
31
|
-
return { error: "Authentication required" };
|
|
32
|
-
}
|
|
33
|
-
const orgCtx = await getOrgContext(event).catch(() => null);
|
|
34
|
-
const userEmail = session.email;
|
|
35
|
-
const orgId = orgCtx?.orgId ?? undefined;
|
|
36
|
-
return runWithRequestContext({ userEmail, orgId }, () => dispatch(event, method, parts));
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async function dispatch(event, method, parts) {
|
|
40
|
-
// GET /tool/:toolId — list a tool's slot declarations
|
|
41
|
-
if (method === "GET" && parts.length === 2 && parts[0] === "tool") {
|
|
42
|
-
return listSlotsForTool(parts[1]);
|
|
43
|
-
}
|
|
44
|
-
// POST /tool/:toolId — declare a slot target { slotId, config? }
|
|
45
|
-
if (method === "POST" && parts.length === 2 && parts[0] === "tool") {
|
|
46
|
-
const body = await readBody(event);
|
|
47
|
-
const slotId = String(body?.slotId ?? "").trim();
|
|
48
|
-
if (!slotId) {
|
|
49
|
-
setResponseStatus(event, 400);
|
|
50
|
-
return { error: "slotId is required" };
|
|
51
|
-
}
|
|
52
|
-
const row = await addToolSlotTarget(parts[1], slotId, body?.config);
|
|
53
|
-
recordChange({ source: "action", type: "change" });
|
|
54
|
-
return row;
|
|
55
|
-
}
|
|
56
|
-
// DELETE /tool/:toolId/:slotId — remove a slot declaration
|
|
57
|
-
if (method === "DELETE" && parts.length === 3 && parts[0] === "tool") {
|
|
58
|
-
await removeToolSlotTarget(parts[1], parts[2]);
|
|
59
|
-
recordChange({ source: "action", type: "change" });
|
|
60
|
-
return { ok: true };
|
|
61
|
-
}
|
|
62
|
-
// GET /:slotId/installs — current user's installs in slot
|
|
63
|
-
if (method === "GET" && parts.length === 2 && parts[1] === "installs") {
|
|
64
|
-
return listSlotInstallsForUser(parts[0]);
|
|
65
|
-
}
|
|
66
|
-
// GET /:slotId/available — tools that declare this slot the user can install
|
|
67
|
-
if (method === "GET" && parts.length === 2 && parts[1] === "available") {
|
|
68
|
-
return listToolsForSlot(parts[0]);
|
|
69
|
-
}
|
|
70
|
-
// POST /:slotId/install — install { toolId, position?, config? }
|
|
71
|
-
if (method === "POST" && parts.length === 2 && parts[1] === "install") {
|
|
72
|
-
const body = await readBody(event);
|
|
73
|
-
const toolId = String(body?.toolId ?? "").trim();
|
|
74
|
-
if (!toolId) {
|
|
75
|
-
setResponseStatus(event, 400);
|
|
76
|
-
return { error: "toolId is required" };
|
|
77
|
-
}
|
|
78
|
-
const row = await installToolSlot(toolId, parts[0], {
|
|
79
|
-
position: body?.position,
|
|
80
|
-
config: body?.config,
|
|
81
|
-
});
|
|
82
|
-
recordChange({ source: "action", type: "change" });
|
|
83
|
-
return row;
|
|
84
|
-
}
|
|
85
|
-
// DELETE /:slotId/install/:toolId — uninstall
|
|
86
|
-
if (method === "DELETE" && parts.length === 3 && parts[1] === "install") {
|
|
87
|
-
await uninstallToolSlot(parts[2], parts[0]);
|
|
88
|
-
recordChange({ source: "action", type: "change" });
|
|
89
|
-
return { ok: true };
|
|
90
|
-
}
|
|
91
|
-
setResponseStatus(event, 404);
|
|
92
|
-
return { error: "Not found" };
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=routes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/tools/slots/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,iBAAiB,GAElB,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,kBAAkB;IAChC,OAAO,kBAAkB,CAAC,KAAK,EAAE,KAAc,EAAE,EAAE;QACjD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,IAAI,EAAE,CAAC;aACzC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;aACnB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAElD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,CAA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AAK,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC9B,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;QACzC,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;YAClD,QAAQ,EAAE,IAAI,EAAE,QAAQ;YACxB,MAAM,EAAE,IAAI,EAAE,MAAM;SACrB,CAAC,CAAC;QACH,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,8CAA8C;IAC9C,IAAI,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QACxE,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IACtB,CAAC;IAED,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC","sourcesContent":["/**\n * HTTP handler for tool extension-point slots.\n *\n * Mounted at `/_agent-native/slots`. Routes:\n *\n * GET /:slotId/installs — current user's installed widgets for a slot\n * GET /:slotId/available — tools that declare this slot, scoped to user access\n * POST /:slotId/install — install a tool into a slot (body: { toolId, position?, config? })\n * DELETE /:slotId/install/:toolId — uninstall\n * GET /tool/:toolId — list slot declarations for a specific tool\n * POST /tool/:toolId — declare a slot target (body: { slotId, config? })\n * DELETE /tool/:toolId/:slotId — remove a slot declaration\n */\n\nimport {\n defineEventHandler,\n getMethod,\n setResponseStatus,\n type H3Event,\n} from \"h3\";\nimport { readBody } from \"../../server/h3-helpers.js\";\nimport { getSession } from \"../../server/auth.js\";\nimport { recordChange } from \"../../server/poll.js\";\nimport { runWithRequestContext } from \"../../server/request-context.js\";\nimport { getOrgContext } from \"../../org/context.js\";\nimport {\n addToolSlotTarget,\n removeToolSlotTarget,\n listSlotsForTool,\n listToolsForSlot,\n installToolSlot,\n uninstallToolSlot,\n listSlotInstallsForUser,\n} from \"./store.js\";\n\nexport function createSlotsHandler() {\n return defineEventHandler(async (event: H3Event) => {\n const method = getMethod(event);\n const pathname = (event.url?.pathname || \"\")\n .replace(/^\\/+/, \"\")\n .replace(/\\/+$/, \"\");\n const parts = pathname ? pathname.split(\"/\") : [];\n\n const session = await getSession(event).catch(() => null);\n if (!session?.email) {\n setResponseStatus(event, 401);\n return { error: \"Authentication required\" };\n }\n\n const orgCtx = await getOrgContext(event).catch(() => null);\n const userEmail = session.email;\n const orgId = orgCtx?.orgId ?? undefined;\n\n return runWithRequestContext({ userEmail, orgId }, () =>\n dispatch(event, method, parts),\n );\n });\n}\n\nasync function dispatch(\n event: H3Event,\n method: string,\n parts: string[],\n): Promise<unknown> {\n // GET /tool/:toolId — list a tool's slot declarations\n if (method === \"GET\" && parts.length === 2 && parts[0] === \"tool\") {\n return listSlotsForTool(parts[1]);\n }\n\n // POST /tool/:toolId — declare a slot target { slotId, config? }\n if (method === \"POST\" && parts.length === 2 && parts[0] === \"tool\") {\n const body = await readBody(event);\n const slotId = String(body?.slotId ?? \"\").trim();\n if (!slotId) {\n setResponseStatus(event, 400);\n return { error: \"slotId is required\" };\n }\n const row = await addToolSlotTarget(parts[1], slotId, body?.config);\n recordChange({ source: \"action\", type: \"change\" });\n return row;\n }\n\n // DELETE /tool/:toolId/:slotId — remove a slot declaration\n if (method === \"DELETE\" && parts.length === 3 && parts[0] === \"tool\") {\n await removeToolSlotTarget(parts[1], parts[2]);\n recordChange({ source: \"action\", type: \"change\" });\n return { ok: true };\n }\n\n // GET /:slotId/installs — current user's installs in slot\n if (method === \"GET\" && parts.length === 2 && parts[1] === \"installs\") {\n return listSlotInstallsForUser(parts[0]);\n }\n\n // GET /:slotId/available — tools that declare this slot the user can install\n if (method === \"GET\" && parts.length === 2 && parts[1] === \"available\") {\n return listToolsForSlot(parts[0]);\n }\n\n // POST /:slotId/install — install { toolId, position?, config? }\n if (method === \"POST\" && parts.length === 2 && parts[1] === \"install\") {\n const body = await readBody(event);\n const toolId = String(body?.toolId ?? \"\").trim();\n if (!toolId) {\n setResponseStatus(event, 400);\n return { error: \"toolId is required\" };\n }\n const row = await installToolSlot(toolId, parts[0], {\n position: body?.position,\n config: body?.config,\n });\n recordChange({ source: \"action\", type: \"change\" });\n return row;\n }\n\n // DELETE /:slotId/install/:toolId — uninstall\n if (method === \"DELETE\" && parts.length === 3 && parts[1] === \"install\") {\n await uninstallToolSlot(parts[2], parts[0]);\n recordChange({ source: \"action\", type: \"change\" });\n return { ok: true };\n }\n\n setResponseStatus(event, 404);\n return { error: \"Not found\" };\n}\n"]}
|
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Drizzle schema for the tool extension-points system.
|
|
3
|
-
*
|
|
4
|
-
* Two tables:
|
|
5
|
-
*
|
|
6
|
-
* - `tool_slots` — declarations: "tool X can render in slot Y". Authored
|
|
7
|
-
* once per tool, regardless of installer.
|
|
8
|
-
* - `tool_slot_installs` — per-user installs: "user U wants tool X in slot Y at
|
|
9
|
-
* position N". Always scoped by owner_email.
|
|
10
|
-
*
|
|
11
|
-
* Neither table spreads `ownableColumns()` — they're not first-class shareable
|
|
12
|
-
* resources. Access to the underlying tool flows through the existing `tools`
|
|
13
|
-
* table sharing model; install rows are personal preferences scoped to the
|
|
14
|
-
* installing user.
|
|
15
|
-
*/
|
|
16
|
-
export declare const toolSlots: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
17
|
-
name: "tool_slots";
|
|
18
|
-
schema: undefined;
|
|
19
|
-
columns: {
|
|
20
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
21
|
-
name: "id";
|
|
22
|
-
tableName: "tool_slots";
|
|
23
|
-
dataType: "string";
|
|
24
|
-
columnType: "SQLiteText";
|
|
25
|
-
data: string;
|
|
26
|
-
driverParam: string;
|
|
27
|
-
notNull: true;
|
|
28
|
-
hasDefault: false;
|
|
29
|
-
isPrimaryKey: true;
|
|
30
|
-
isAutoincrement: false;
|
|
31
|
-
hasRuntimeDefault: false;
|
|
32
|
-
enumValues: [string, ...string[]];
|
|
33
|
-
baseColumn: never;
|
|
34
|
-
identity: undefined;
|
|
35
|
-
generated: undefined;
|
|
36
|
-
}, {}, {
|
|
37
|
-
length: number;
|
|
38
|
-
}>;
|
|
39
|
-
toolId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
40
|
-
name: "tool_id";
|
|
41
|
-
tableName: "tool_slots";
|
|
42
|
-
dataType: "string";
|
|
43
|
-
columnType: "SQLiteText";
|
|
44
|
-
data: string;
|
|
45
|
-
driverParam: string;
|
|
46
|
-
notNull: true;
|
|
47
|
-
hasDefault: false;
|
|
48
|
-
isPrimaryKey: false;
|
|
49
|
-
isAutoincrement: false;
|
|
50
|
-
hasRuntimeDefault: false;
|
|
51
|
-
enumValues: [string, ...string[]];
|
|
52
|
-
baseColumn: never;
|
|
53
|
-
identity: undefined;
|
|
54
|
-
generated: undefined;
|
|
55
|
-
}, {}, {
|
|
56
|
-
length: number;
|
|
57
|
-
}>;
|
|
58
|
-
slotId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
59
|
-
name: "slot_id";
|
|
60
|
-
tableName: "tool_slots";
|
|
61
|
-
dataType: "string";
|
|
62
|
-
columnType: "SQLiteText";
|
|
63
|
-
data: string;
|
|
64
|
-
driverParam: string;
|
|
65
|
-
notNull: true;
|
|
66
|
-
hasDefault: false;
|
|
67
|
-
isPrimaryKey: false;
|
|
68
|
-
isAutoincrement: false;
|
|
69
|
-
hasRuntimeDefault: false;
|
|
70
|
-
enumValues: [string, ...string[]];
|
|
71
|
-
baseColumn: never;
|
|
72
|
-
identity: undefined;
|
|
73
|
-
generated: undefined;
|
|
74
|
-
}, {}, {
|
|
75
|
-
length: number;
|
|
76
|
-
}>;
|
|
77
|
-
config: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
78
|
-
name: "config";
|
|
79
|
-
tableName: "tool_slots";
|
|
80
|
-
dataType: "string";
|
|
81
|
-
columnType: "SQLiteText";
|
|
82
|
-
data: string;
|
|
83
|
-
driverParam: string;
|
|
84
|
-
notNull: false;
|
|
85
|
-
hasDefault: false;
|
|
86
|
-
isPrimaryKey: false;
|
|
87
|
-
isAutoincrement: false;
|
|
88
|
-
hasRuntimeDefault: false;
|
|
89
|
-
enumValues: [string, ...string[]];
|
|
90
|
-
baseColumn: never;
|
|
91
|
-
identity: undefined;
|
|
92
|
-
generated: undefined;
|
|
93
|
-
}, {}, {
|
|
94
|
-
length: number;
|
|
95
|
-
}>;
|
|
96
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
97
|
-
name: "created_at";
|
|
98
|
-
tableName: "tool_slots";
|
|
99
|
-
dataType: "string";
|
|
100
|
-
columnType: "SQLiteText";
|
|
101
|
-
data: string;
|
|
102
|
-
driverParam: string;
|
|
103
|
-
notNull: true;
|
|
104
|
-
hasDefault: true;
|
|
105
|
-
isPrimaryKey: false;
|
|
106
|
-
isAutoincrement: false;
|
|
107
|
-
hasRuntimeDefault: false;
|
|
108
|
-
enumValues: [string, ...string[]];
|
|
109
|
-
baseColumn: never;
|
|
110
|
-
identity: undefined;
|
|
111
|
-
generated: undefined;
|
|
112
|
-
}, {}, {
|
|
113
|
-
length: number;
|
|
114
|
-
}>;
|
|
115
|
-
};
|
|
116
|
-
dialect: "sqlite";
|
|
117
|
-
}>;
|
|
118
|
-
export declare const toolSlotInstalls: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
119
|
-
name: "tool_slot_installs";
|
|
120
|
-
schema: undefined;
|
|
121
|
-
columns: {
|
|
122
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
123
|
-
name: "id";
|
|
124
|
-
tableName: "tool_slot_installs";
|
|
125
|
-
dataType: "string";
|
|
126
|
-
columnType: "SQLiteText";
|
|
127
|
-
data: string;
|
|
128
|
-
driverParam: string;
|
|
129
|
-
notNull: true;
|
|
130
|
-
hasDefault: false;
|
|
131
|
-
isPrimaryKey: true;
|
|
132
|
-
isAutoincrement: false;
|
|
133
|
-
hasRuntimeDefault: false;
|
|
134
|
-
enumValues: [string, ...string[]];
|
|
135
|
-
baseColumn: never;
|
|
136
|
-
identity: undefined;
|
|
137
|
-
generated: undefined;
|
|
138
|
-
}, {}, {
|
|
139
|
-
length: number;
|
|
140
|
-
}>;
|
|
141
|
-
toolId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
142
|
-
name: "tool_id";
|
|
143
|
-
tableName: "tool_slot_installs";
|
|
144
|
-
dataType: "string";
|
|
145
|
-
columnType: "SQLiteText";
|
|
146
|
-
data: string;
|
|
147
|
-
driverParam: string;
|
|
148
|
-
notNull: true;
|
|
149
|
-
hasDefault: false;
|
|
150
|
-
isPrimaryKey: false;
|
|
151
|
-
isAutoincrement: false;
|
|
152
|
-
hasRuntimeDefault: false;
|
|
153
|
-
enumValues: [string, ...string[]];
|
|
154
|
-
baseColumn: never;
|
|
155
|
-
identity: undefined;
|
|
156
|
-
generated: undefined;
|
|
157
|
-
}, {}, {
|
|
158
|
-
length: number;
|
|
159
|
-
}>;
|
|
160
|
-
slotId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
161
|
-
name: "slot_id";
|
|
162
|
-
tableName: "tool_slot_installs";
|
|
163
|
-
dataType: "string";
|
|
164
|
-
columnType: "SQLiteText";
|
|
165
|
-
data: string;
|
|
166
|
-
driverParam: string;
|
|
167
|
-
notNull: true;
|
|
168
|
-
hasDefault: false;
|
|
169
|
-
isPrimaryKey: false;
|
|
170
|
-
isAutoincrement: false;
|
|
171
|
-
hasRuntimeDefault: false;
|
|
172
|
-
enumValues: [string, ...string[]];
|
|
173
|
-
baseColumn: never;
|
|
174
|
-
identity: undefined;
|
|
175
|
-
generated: undefined;
|
|
176
|
-
}, {}, {
|
|
177
|
-
length: number;
|
|
178
|
-
}>;
|
|
179
|
-
ownerEmail: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
180
|
-
name: "owner_email";
|
|
181
|
-
tableName: "tool_slot_installs";
|
|
182
|
-
dataType: "string";
|
|
183
|
-
columnType: "SQLiteText";
|
|
184
|
-
data: string;
|
|
185
|
-
driverParam: string;
|
|
186
|
-
notNull: true;
|
|
187
|
-
hasDefault: false;
|
|
188
|
-
isPrimaryKey: false;
|
|
189
|
-
isAutoincrement: false;
|
|
190
|
-
hasRuntimeDefault: false;
|
|
191
|
-
enumValues: [string, ...string[]];
|
|
192
|
-
baseColumn: never;
|
|
193
|
-
identity: undefined;
|
|
194
|
-
generated: undefined;
|
|
195
|
-
}, {}, {
|
|
196
|
-
length: number;
|
|
197
|
-
}>;
|
|
198
|
-
orgId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
199
|
-
name: "org_id";
|
|
200
|
-
tableName: "tool_slot_installs";
|
|
201
|
-
dataType: "string";
|
|
202
|
-
columnType: "SQLiteText";
|
|
203
|
-
data: string;
|
|
204
|
-
driverParam: string;
|
|
205
|
-
notNull: false;
|
|
206
|
-
hasDefault: false;
|
|
207
|
-
isPrimaryKey: false;
|
|
208
|
-
isAutoincrement: false;
|
|
209
|
-
hasRuntimeDefault: false;
|
|
210
|
-
enumValues: [string, ...string[]];
|
|
211
|
-
baseColumn: never;
|
|
212
|
-
identity: undefined;
|
|
213
|
-
generated: undefined;
|
|
214
|
-
}, {}, {
|
|
215
|
-
length: number;
|
|
216
|
-
}>;
|
|
217
|
-
position: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
218
|
-
name: "position";
|
|
219
|
-
tableName: "tool_slot_installs";
|
|
220
|
-
dataType: "number";
|
|
221
|
-
columnType: "SQLiteInteger";
|
|
222
|
-
data: number;
|
|
223
|
-
driverParam: number;
|
|
224
|
-
notNull: true;
|
|
225
|
-
hasDefault: true;
|
|
226
|
-
isPrimaryKey: false;
|
|
227
|
-
isAutoincrement: false;
|
|
228
|
-
hasRuntimeDefault: false;
|
|
229
|
-
enumValues: undefined;
|
|
230
|
-
baseColumn: never;
|
|
231
|
-
identity: undefined;
|
|
232
|
-
generated: undefined;
|
|
233
|
-
}, {}, {}>;
|
|
234
|
-
config: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
235
|
-
name: "config";
|
|
236
|
-
tableName: "tool_slot_installs";
|
|
237
|
-
dataType: "string";
|
|
238
|
-
columnType: "SQLiteText";
|
|
239
|
-
data: string;
|
|
240
|
-
driverParam: string;
|
|
241
|
-
notNull: false;
|
|
242
|
-
hasDefault: false;
|
|
243
|
-
isPrimaryKey: false;
|
|
244
|
-
isAutoincrement: false;
|
|
245
|
-
hasRuntimeDefault: false;
|
|
246
|
-
enumValues: [string, ...string[]];
|
|
247
|
-
baseColumn: never;
|
|
248
|
-
identity: undefined;
|
|
249
|
-
generated: undefined;
|
|
250
|
-
}, {}, {
|
|
251
|
-
length: number;
|
|
252
|
-
}>;
|
|
253
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
254
|
-
name: "created_at";
|
|
255
|
-
tableName: "tool_slot_installs";
|
|
256
|
-
dataType: "string";
|
|
257
|
-
columnType: "SQLiteText";
|
|
258
|
-
data: string;
|
|
259
|
-
driverParam: string;
|
|
260
|
-
notNull: true;
|
|
261
|
-
hasDefault: true;
|
|
262
|
-
isPrimaryKey: false;
|
|
263
|
-
isAutoincrement: false;
|
|
264
|
-
hasRuntimeDefault: false;
|
|
265
|
-
enumValues: [string, ...string[]];
|
|
266
|
-
baseColumn: never;
|
|
267
|
-
identity: undefined;
|
|
268
|
-
generated: undefined;
|
|
269
|
-
}, {}, {
|
|
270
|
-
length: number;
|
|
271
|
-
}>;
|
|
272
|
-
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
273
|
-
name: "updated_at";
|
|
274
|
-
tableName: "tool_slot_installs";
|
|
275
|
-
dataType: "string";
|
|
276
|
-
columnType: "SQLiteText";
|
|
277
|
-
data: string;
|
|
278
|
-
driverParam: string;
|
|
279
|
-
notNull: true;
|
|
280
|
-
hasDefault: true;
|
|
281
|
-
isPrimaryKey: false;
|
|
282
|
-
isAutoincrement: false;
|
|
283
|
-
hasRuntimeDefault: false;
|
|
284
|
-
enumValues: [string, ...string[]];
|
|
285
|
-
baseColumn: never;
|
|
286
|
-
identity: undefined;
|
|
287
|
-
generated: undefined;
|
|
288
|
-
}, {}, {
|
|
289
|
-
length: number;
|
|
290
|
-
}>;
|
|
291
|
-
};
|
|
292
|
-
dialect: "sqlite";
|
|
293
|
-
}>;
|
|
294
|
-
export declare const TOOL_SLOTS_CREATE_SQL = "CREATE TABLE IF NOT EXISTS tool_slots (\n id TEXT PRIMARY KEY,\n tool_id TEXT NOT NULL,\n slot_id TEXT NOT NULL,\n config TEXT,\n created_at TEXT NOT NULL DEFAULT (datetime('now'))\n)";
|
|
295
|
-
export declare const TOOL_SLOTS_CREATE_SQL_PG = "CREATE TABLE IF NOT EXISTS tool_slots (\n id TEXT PRIMARY KEY,\n tool_id TEXT NOT NULL,\n slot_id TEXT NOT NULL,\n config TEXT,\n created_at TEXT NOT NULL DEFAULT now()\n)";
|
|
296
|
-
export declare const TOOL_SLOTS_BY_SLOT_INDEX_SQL = "CREATE INDEX IF NOT EXISTS tool_slots_by_slot_idx ON tool_slots (slot_id)";
|
|
297
|
-
export declare const TOOL_SLOTS_BY_TOOL_INDEX_SQL = "CREATE INDEX IF NOT EXISTS tool_slots_by_tool_idx ON tool_slots (tool_id)";
|
|
298
|
-
export declare const TOOL_SLOTS_UNIQUE_INDEX_SQL = "CREATE UNIQUE INDEX IF NOT EXISTS tool_slots_unique_idx ON tool_slots (tool_id, slot_id)";
|
|
299
|
-
export declare const TOOL_SLOT_INSTALLS_CREATE_SQL = "CREATE TABLE IF NOT EXISTS tool_slot_installs (\n id TEXT PRIMARY KEY,\n tool_id TEXT NOT NULL,\n slot_id TEXT NOT NULL,\n owner_email TEXT NOT NULL,\n org_id TEXT,\n position INTEGER NOT NULL DEFAULT 0,\n config TEXT,\n created_at TEXT NOT NULL DEFAULT (datetime('now')),\n updated_at TEXT NOT NULL DEFAULT (datetime('now'))\n)";
|
|
300
|
-
export declare const TOOL_SLOT_INSTALLS_CREATE_SQL_PG = "CREATE TABLE IF NOT EXISTS tool_slot_installs (\n id TEXT PRIMARY KEY,\n tool_id TEXT NOT NULL,\n slot_id TEXT NOT NULL,\n owner_email TEXT NOT NULL,\n org_id TEXT,\n position INTEGER NOT NULL DEFAULT 0,\n config TEXT,\n created_at TEXT NOT NULL DEFAULT now(),\n updated_at TEXT NOT NULL DEFAULT now()\n)";
|
|
301
|
-
export declare const TOOL_SLOT_INSTALLS_BY_USER_SLOT_INDEX_SQL = "CREATE INDEX IF NOT EXISTS tool_slot_installs_by_user_slot_idx ON tool_slot_installs (owner_email, slot_id)";
|
|
302
|
-
export declare const TOOL_SLOT_INSTALLS_UNIQUE_INDEX_SQL = "CREATE UNIQUE INDEX IF NOT EXISTS tool_slot_installs_unique_idx ON tool_slot_installs (owner_email, tool_id, slot_id)";
|
|
303
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/tools/slots/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMpB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AAEH,eAAO,MAAM,qBAAqB,iMAMhC,CAAC;AAEH,eAAO,MAAM,wBAAwB,qLAMnC,CAAC;AAEH,eAAO,MAAM,4BAA4B,8EAA8E,CAAC;AACxH,eAAO,MAAM,4BAA4B,8EAA8E,CAAC;AACxH,eAAO,MAAM,2BAA2B,6FAA6F,CAAC;AAEtI,eAAO,MAAM,6BAA6B,sVAUxC,CAAC;AAEH,eAAO,MAAM,gCAAgC,8TAU3C,CAAC;AAEH,eAAO,MAAM,yCAAyC,gHAAgH,CAAC;AACvK,eAAO,MAAM,mCAAmC,0HAA0H,CAAC"}
|