kennel 0.2.5 → 0.2.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/cli/src/plugins/external.js +2 -2
- package/dist/cli/src/site/server-plugins.d.ts +2 -2
- package/dist/core/api-client.js +576 -10317
- package/dist/core/core-folders.js +2313 -12088
- package/dist/core/runtime.js +7899 -17525
- package/dist/package/preview.js +9838 -19692
- package/dist/plugins/external.js +2 -2
- package/dist/site/server-plugins.d.ts +2 -2
- package/dist/site/server-plugins.js +9 -9
- package/kernel/apps/web/package.json +1 -1
- package/kernel/apps/web/src/external-plugins.ts +1 -1
- package/kernel/apps/web/src/folder-filter-icons.tsx +1 -1
- package/kernel/apps/web/src/folder-plugin-view.tsx +1 -1
- package/kernel/apps/web/src/plugins.ts +1 -1
- package/kernel/apps/web/vite.config.ts +1 -1
- package/kernel/packages/agents/package.json +1 -1
- package/kernel/packages/agents/src/agent-card.tsx +1 -1
- package/kernel/packages/agents/src/client.tsx +1 -1
- package/kernel/packages/agents/src/manifest.ts +1 -1
- package/kernel/packages/agents/src/server.ts +1 -1
- package/kernel/packages/agents/src/viewer.tsx +1 -1
- package/kernel/packages/api/package.json +1 -1
- package/kernel/packages/api/src/server/acp-live-plugin.ts +1 -1
- package/kernel/packages/api/src/server/api/create-agent-file.ts +2 -2
- package/kernel/packages/api/src/server/api/document-edit.ts +2 -2
- package/kernel/packages/api/src/server/api/open-path.ts +2 -2
- package/kernel/packages/api/src/server/folder-metadata-plugin.ts +4 -4
- package/kernel/packages/api/src/server/plugins.ts +3 -3
- package/kernel/packages/api/src/shared/viewer-route.ts +1 -1
- package/kernel/packages/api/test/core.test.ts +1 -1
- package/kernel/packages/notes/package.json +1 -1
- package/kernel/packages/notes/src/client.tsx +1 -1
- package/kernel/packages/notes/src/manifest.ts +1 -1
- package/kernel/packages/notes/src/server.ts +1 -1
- package/kernel/packages/plugins/SKILL.md +39 -0
- package/kernel/packages/{folder-plugin → plugins}/package.json +64 -10
- package/kernel/packages/plugins/src/index.ts +52 -0
- package/kernel/packages/plugins/src/page.ts +17 -0
- package/kernel/packages/{folder-plugin → plugins}/tsconfig.json +5 -1
- package/kernel/packages/plugins/tsup.config.ts +25 -0
- package/kernel/packages/ui/src/components/content-issues.tsx +1 -1
- package/kernel/packages/ui/tsconfig.json +1 -1
- package/package.json +2 -3
- package/kernel/packages/folder-plugin/src/index.ts +0 -15
- /package/kernel/packages/{folder-plugin → plugins}/eslint.config.js +0 -0
- /package/kernel/packages/{folder-plugin → plugins}/src/client.ts +0 -0
- /package/kernel/packages/{folder-plugin → plugins}/src/endpoint.ts +0 -0
- /package/kernel/packages/{folder-plugin → plugins}/src/server.ts +0 -0
- /package/kernel/packages/{folder-plugin → plugins}/src/subpath.ts +0 -0
- /package/kernel/packages/{folder-plugin → plugins}/src/types.ts +0 -0
- /package/kernel/packages/{folder-plugin → plugins}/src/validation.ts +0 -0
- /package/kernel/packages/{folder-plugin → plugins}/test/contract.test.mjs +0 -0
package/dist/plugins/external.js
CHANGED
|
@@ -163,7 +163,7 @@ function internalSourceAliases(root = kernelSourceRoot()) {
|
|
|
163
163
|
const aliases = {};
|
|
164
164
|
for (const [name, path] of Object.entries({
|
|
165
165
|
"@raggle-ai/agents": "packages/agents/src",
|
|
166
|
-
"
|
|
166
|
+
"kennel-plugins": "packages/plugins/src",
|
|
167
167
|
"@raggle-ai/kennel-api": "packages/api/src",
|
|
168
168
|
"@raggle-ai/markdown": "packages/markdown/src",
|
|
169
169
|
"@raggle-ai/notes": "packages/notes/src",
|
|
@@ -448,7 +448,7 @@ export async function prepareExternalPluginModules(temp, target = temp, plugins
|
|
|
448
448
|
const cssImports = plugins.map((plugin) => plugin.entries.css ? `import ${JSON.stringify(plugin.entries.css)};` : "").filter(Boolean).join("\n");
|
|
449
449
|
const clientImports = plugins.map((plugin, index) => `import { ${plugin.entries.manifestSymbol} as manifest${index} } from ${JSON.stringify(plugin.entries.manifest)};`).join("\n");
|
|
450
450
|
const clientItems = plugins.map((plugin, index) => ` { ...manifest${index}, component: lazy(async () => ({ default: (await import(${JSON.stringify(plugin.entries.client)}))[${JSON.stringify(plugin.entries.clientSymbol)}].component })) }`).join(",\n");
|
|
451
|
-
await writeFile(clientModule, `import { lazy } from "react";\nimport type { FolderPluginClient } from "
|
|
451
|
+
await writeFile(clientModule, `import { lazy } from "react";\nimport type { FolderPluginClient } from "kennel-plugins/client";\n${cssImports}\n${clientImports}\nexport const externalFolderPlugins: FolderPluginClient[] = [\n${clientItems}\n];\n`);
|
|
452
452
|
const serverEntries = [];
|
|
453
453
|
const apiEntries = [];
|
|
454
454
|
for (const plugin of plugins) {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* plain-`node` CLI never imports the plugin packages' runtime sources, while
|
|
9
9
|
* staying type-checked against the one source of truth.
|
|
10
10
|
*/
|
|
11
|
-
import type { FolderPluginServer } from "
|
|
12
|
-
export type { FolderPluginContext, FolderPluginData, FolderPluginDetection, FolderPluginServer, } from "
|
|
11
|
+
import type { FolderPluginServer } from "kennel-plugins/server";
|
|
12
|
+
export type { FolderPluginContext, FolderPluginData, FolderPluginDetection, FolderPluginServer, } from "kennel-plugins/server";
|
|
13
13
|
/**
|
|
14
14
|
* Signal a server-side plugin failure (like a mail preview read error) so the
|
|
15
15
|
* host maps it to an HTTP 5xx instead of a not-found. All other thrown errors
|
|
@@ -515,13 +515,13 @@ function createAgentsPlugin(options = {}) {
|
|
|
515
515
|
};
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
-
// packages/
|
|
519
|
-
|
|
518
|
+
// packages/plugins/dist/chunk-AX4A4GYF.js
|
|
519
|
+
var FolderPluginFailure = class extends Error {
|
|
520
520
|
constructor(message) {
|
|
521
521
|
super(message);
|
|
522
522
|
this.name = "FolderPluginFailure";
|
|
523
523
|
}
|
|
524
|
-
}
|
|
524
|
+
};
|
|
525
525
|
|
|
526
526
|
// packages/notes/src/server.ts
|
|
527
527
|
import { readdir, stat as stat2 } from "node:fs/promises";
|
|
@@ -730,11 +730,11 @@ async function scaffoldFolderPlugins(folder, options = {}) {
|
|
|
730
730
|
return { created, skipped, supported };
|
|
731
731
|
}
|
|
732
732
|
export {
|
|
733
|
-
|
|
734
|
-
folderServerRegistryAsync,
|
|
735
|
-
folderServerRegistry,
|
|
736
|
-
externalApiHandlers,
|
|
737
|
-
createFolderServerPlugins,
|
|
733
|
+
FolderPluginFailure,
|
|
738
734
|
configuredFolderServerRegistry,
|
|
739
|
-
|
|
735
|
+
createFolderServerPlugins,
|
|
736
|
+
externalApiHandlers,
|
|
737
|
+
folderServerRegistry,
|
|
738
|
+
folderServerRegistryAsync,
|
|
739
|
+
scaffoldFolderPlugins
|
|
740
740
|
};
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@lexical/react": "0.49.0",
|
|
24
24
|
"@lexical/rich-text": "0.49.0",
|
|
25
25
|
"@raggle-ai/agents": "workspace:*",
|
|
26
|
-
"
|
|
26
|
+
"kennel-plugins": "workspace:*",
|
|
27
27
|
"@raggle-ai/kennel-api": "workspace:*",
|
|
28
28
|
"@raggle-ai/kennel-preview": "workspace:*",
|
|
29
29
|
"@raggle-ai/local": "0.14.0",
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from "react"
|
|
|
2
2
|
import { useQuery } from "@tanstack/react-query"
|
|
3
3
|
import { api } from "~/api-client"
|
|
4
4
|
|
|
5
|
-
import { folderPathId } from "
|
|
5
|
+
import { folderPathId } from "kennel-plugins/client"
|
|
6
6
|
import { FolderFilterIconProvider } from "@raggle-ai/ui/components/folder-filter-bar"
|
|
7
7
|
import { FolderImage } from "@raggle-ai/ui/components/folder-image"
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useParams } from "@tanstack/react-router"
|
|
2
2
|
import { api } from "~/api-client"
|
|
3
3
|
|
|
4
|
-
import type { FolderPluginViewProps } from "
|
|
4
|
+
import type { FolderPluginViewProps } from "kennel-plugins/client"
|
|
5
5
|
|
|
6
6
|
import { FolderFilterMetadataProvider } from "./folder-filter-icons"
|
|
7
7
|
import { getFolderPlugin } from "./plugins"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lazy } from "react"
|
|
2
2
|
import { externalFolderPlugins } from "@/external-plugins"
|
|
3
3
|
|
|
4
|
-
import type { FolderPluginClient } from "
|
|
4
|
+
import type { FolderPluginClient } from "kennel-plugins/client"
|
|
5
5
|
import { agentsManifest } from "@raggle-ai/agents/manifest"
|
|
6
6
|
|
|
7
7
|
// Keep navigation metadata cheap. Import only the selected plugin's UI;
|
|
@@ -74,7 +74,7 @@ const resolveBarkdown = (): string | undefined => {
|
|
|
74
74
|
const barkdown = resolveBarkdown()
|
|
75
75
|
const internalPackages: Array<[RegExp, string]> = [
|
|
76
76
|
[/^@raggle-ai\/agents(\/.*)?$/, "packages/agents/src"],
|
|
77
|
-
[
|
|
77
|
+
[/^kennel-plugins(\/.*)?$/, "packages/plugins/src"],
|
|
78
78
|
[/^@raggle-ai\/kennel-api(\/.*)?$/, "packages/api/src"],
|
|
79
79
|
[/^@raggle-ai\/markdown(\/.*)?$/, "packages/markdown/src"],
|
|
80
80
|
[/^@raggle-ai\/notes(\/.*)?$/, "packages/notes/src"],
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"publish:public:dry-run": "npm --@raggle-ai:registry=https://registry.npmjs.org publish --dry-run --access public --registry=https://registry.npmjs.org"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"
|
|
44
|
+
"kennel-plugins": "workspace:*",
|
|
45
45
|
"@raggle-ai/markdown": "workspace:*",
|
|
46
46
|
"@raggle-ai/ui": "workspace:*",
|
|
47
47
|
"@tanstack/react-query": "catalog:tanstack",
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from "react"
|
|
|
2
2
|
import { useMemo, useState } from "react"
|
|
3
3
|
import { FilePlus2, LoaderCircle, Pencil } from "lucide-react"
|
|
4
4
|
|
|
5
|
-
import type { FolderPluginHostActions } from "
|
|
5
|
+
import type { FolderPluginHostActions } from "kennel-plugins/client"
|
|
6
6
|
import { BarkdownMarkdown, markdownMetadata } from "@raggle-ai/markdown"
|
|
7
7
|
import { FolderContextIcon } from "@raggle-ai/ui/components/folder-filter-bar"
|
|
8
8
|
import {
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
FolderPluginContext,
|
|
3
3
|
FolderPluginData,
|
|
4
4
|
FolderPluginDetection,
|
|
5
|
-
} from "
|
|
5
|
+
} from "kennel-plugins/server"
|
|
6
6
|
|
|
7
7
|
import type { AgentsResolution, ClientFilter } from "./types.ts"
|
|
8
8
|
import { agentsManifest } from "./manifest.ts"
|
|
@@ -2,7 +2,7 @@ import { useMemo, useRef, useState } from "react"
|
|
|
2
2
|
import { useQuery } from "@tanstack/react-query"
|
|
3
3
|
import { ChevronDown, Info, TriangleAlert } from "lucide-react"
|
|
4
4
|
|
|
5
|
-
import type { FolderPluginViewProps } from "
|
|
5
|
+
import type { FolderPluginViewProps } from "kennel-plugins/client"
|
|
6
6
|
import {
|
|
7
7
|
Collapsible,
|
|
8
8
|
CollapsibleContent,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@agentclientprotocol/sdk": "^1.3.0",
|
|
21
21
|
"@raggle-ai/agents": "workspace:*",
|
|
22
|
-
"
|
|
22
|
+
"kennel-plugins": "workspace:*",
|
|
23
23
|
"@raggle-ai/kennel-kinds": "workspace:*",
|
|
24
24
|
"@raggle-ai/local": "0.14.0",
|
|
25
25
|
"@raggle-ai/markdown": "workspace:*",
|
|
@@ -10,7 +10,7 @@ import { Readable, Writable } from "node:stream";
|
|
|
10
10
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
11
11
|
import type { ApiHost } from "./host";
|
|
12
12
|
|
|
13
|
-
import { sameOrigin } from "
|
|
13
|
+
import { sameOrigin } from "kennel-plugins/endpoint";
|
|
14
14
|
import localSessions from "@raggle-ai/local/sessions";
|
|
15
15
|
|
|
16
16
|
import type { AcpTransport } from "./acp/transport";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writeFile } from "node:fs/promises";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
|
|
4
|
-
import type { ApiRouteSpec } from "
|
|
5
|
-
import { apiError, jsonResponse } from "
|
|
4
|
+
import type { ApiRouteSpec } from "kennel-plugins/endpoint";
|
|
5
|
+
import { apiError, jsonResponse } from "kennel-plugins/endpoint";
|
|
6
6
|
|
|
7
7
|
export type CreateAgentFileContext = {
|
|
8
8
|
/**
|
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
sep,
|
|
18
18
|
} from "node:path";
|
|
19
19
|
|
|
20
|
-
import type { ApiRouteSpec } from "
|
|
20
|
+
import type { ApiRouteSpec } from "kennel-plugins/endpoint";
|
|
21
21
|
import { replaceSelection } from "../../shared/selection";
|
|
22
22
|
import {
|
|
23
23
|
apiError,
|
|
24
24
|
jsonResponse,
|
|
25
25
|
parseJsonBody,
|
|
26
|
-
} from "
|
|
26
|
+
} from "kennel-plugins/endpoint";
|
|
27
27
|
|
|
28
28
|
const pending = new Map<string, Promise<unknown>>();
|
|
29
29
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
|
|
3
|
-
import type { ApiRouteSpec } from "
|
|
4
|
-
import { apiError } from "
|
|
3
|
+
import type { ApiRouteSpec } from "kennel-plugins/endpoint";
|
|
4
|
+
import { apiError } from "kennel-plugins/endpoint";
|
|
5
5
|
|
|
6
6
|
export type OpenPathContext = {
|
|
7
7
|
/**
|
|
@@ -17,14 +17,14 @@ import type { ApiHost } from "./host";
|
|
|
17
17
|
import { markdownMetadata } from "@raggle-ai/markdown";
|
|
18
18
|
import { readFolder } from "@raggle-ai/markdown/node";
|
|
19
19
|
import { execFile } from "node:child_process";
|
|
20
|
-
import { sameOrigin } from "
|
|
20
|
+
import { sameOrigin } from "kennel-plugins/endpoint";
|
|
21
21
|
import { parse as parseYaml } from "yaml";
|
|
22
22
|
|
|
23
|
-
import type { FolderPluginServer } from "
|
|
23
|
+
import type { FolderPluginServer } from "kennel-plugins/server";
|
|
24
24
|
import type { LocalMarkdownFileSummary, LocalProject } from "@raggle-ai/local";
|
|
25
25
|
import type { FolderSkill } from "@raggle-ai/ui/lib/folder-activity";
|
|
26
|
-
import { runApiRoute } from "
|
|
27
|
-
import { FolderPluginFailure } from "
|
|
26
|
+
import { runApiRoute } from "kennel-plugins/endpoint";
|
|
27
|
+
import { FolderPluginFailure } from "kennel-plugins/server";
|
|
28
28
|
import { folderWorkspace } from "@raggle-ai/schemas/workspace";
|
|
29
29
|
import { createSchemaCollectionServer } from "@raggle-ai/schemas/server";
|
|
30
30
|
import local from "@raggle-ai/local";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { FolderPluginContext } from "
|
|
2
|
-
import type { FolderPluginServer } from "
|
|
1
|
+
import type { FolderPluginContext } from "kennel-plugins/server";
|
|
2
|
+
import type { FolderPluginServer } from "kennel-plugins/server";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { mkdir, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import { dirname, relative, resolve, sep } from "node:path";
|
|
7
7
|
import { createAgentsPlugin } from "@raggle-ai/agents/server";
|
|
8
|
-
import { FolderPluginFailure } from "
|
|
8
|
+
import { FolderPluginFailure } from "kennel-plugins/server";
|
|
9
9
|
import { createNotesPlugin } from "@raggle-ai/notes/server";
|
|
10
10
|
|
|
11
11
|
export { FolderPluginFailure };
|
|
@@ -33,7 +33,7 @@ const sectionTabs: Record<ViewerSection, FolderTab> = {
|
|
|
33
33
|
skills: "skills",
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
import { folderPathId as encodeBase64Url } from "
|
|
36
|
+
import { folderPathId as encodeBase64Url } from "kennel-plugins/client";
|
|
37
37
|
|
|
38
38
|
function decodeBase64Url(value: string) {
|
|
39
39
|
const padded = `${value}${"=".repeat((4 - (value.length % 4)) % 4)}`;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
configuredFolderServerRegistry,
|
|
10
10
|
scaffoldFolderPlugins,
|
|
11
11
|
} from "../src/server/plugins";
|
|
12
|
-
import type { FolderPluginServer } from "
|
|
12
|
+
import type { FolderPluginServer } from "kennel-plugins/server";
|
|
13
13
|
import { createCoreFolderIndex } from "@raggle-ai/schemas/node";
|
|
14
14
|
|
|
15
15
|
const cleanup: (() => Promise<unknown>)[] = [];
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"publish:public:dry-run": "npm --@raggle-ai:registry=https://registry.npmjs.org publish --dry-run --access public --registry=https://registry.npmjs.org"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"
|
|
42
|
+
"kennel-plugins": "workspace:*",
|
|
43
43
|
"@raggle-ai/ui": "workspace:*",
|
|
44
44
|
"@tanstack/react-query": "catalog:tanstack",
|
|
45
45
|
"lucide-react": "^0.562.0"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kennel-plugins
|
|
3
|
+
description: Install, register, or build a trusted Kennel folder plugin. Use for `knl plugin add`, external plugin kernels, plugin tabs, or deciding where plugin code belongs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kennel Plugin Management
|
|
7
|
+
|
|
8
|
+
## Ownership
|
|
9
|
+
|
|
10
|
+
Keep each concern in its owner:
|
|
11
|
+
|
|
12
|
+
| Concern | Location |
|
|
13
|
+
| ----------------------------------------------------------- | -------------------------------------- |
|
|
14
|
+
| Plugin contract and public client/server types | `packages/plugins` (`kennel-plugins`) |
|
|
15
|
+
| Generic reusable viewer UI | `packages/ui` |
|
|
16
|
+
| Folder metadata API and server registry | `packages/api` |
|
|
17
|
+
| Browser route and static external-plugin registry | `apps/web` |
|
|
18
|
+
| Install, pin, cache, validate, and compose external plugins | `cli/src/plugins/external.ts` |
|
|
19
|
+
| Built-in Agents and Notes feature code | `packages/agents` and `packages/notes` |
|
|
20
|
+
| External plugin feature code | Its own repository |
|
|
21
|
+
|
|
22
|
+
Keep new plugin feature code in its own repository. Add to `packages/plugins` only when every plugin needs a contract change. Add to `packages/ui` only when every viewer can use the UI component.
|
|
23
|
+
|
|
24
|
+
## External plugin install
|
|
25
|
+
|
|
26
|
+
1. Inspect the plugin `package.json`, `src/manifest.ts`, `src/client.tsx`, and `src/server.ts`.
|
|
27
|
+
2. Require `package.json > kennel.plugin` with a unique non-core `id`. The conventional `./manifest`, `./client`, `./server`, and optional `./api` entries must default-export their values. Add `trigger` only when a file can make an otherwise unavailable plugin visible.
|
|
28
|
+
3. Keep the manifest id and package id equal. The client and server must spread or otherwise return that manifest id.
|
|
29
|
+
4. Ensure the repository TypeScript config works outside the Kennel workspace. Do not require unpublished workspace config files during kernel bundling.
|
|
30
|
+
5. Install with `knl plugin add <git-url>`. It pins the resolved commit, validates exports, stores source in `~/.cache/kennel/plugins/sources/`, records the plugin in `~/.config/kennel/config.json`, and composes a static kernel in `~/.cache/kennel/kernels/`.
|
|
31
|
+
6. Use `knl view <folder>` after installation. External plugins require the composed static viewer; a plain Vite hot viewer cannot show their tabs.
|
|
32
|
+
|
|
33
|
+
## Change workflow
|
|
34
|
+
|
|
35
|
+
- Start with the smallest plugin repository change. Do not copy plugin feature code into Kennel.
|
|
36
|
+
- Change `packages/plugins`, `packages/api`, `apps/web`, and `cli` only when the plugin contract or trusted-kernel behavior needs it.
|
|
37
|
+
- Keep plugin ids stable. Do not use core ids: `agents`, `calendar`, `mail`, `notes`, `projects`, or `tasks`.
|
|
38
|
+
- Verify a real install in an isolated `XDG_CONFIG_HOME` and `XDG_CACHE_HOME` first. Then verify the tab and its selected route in the composed viewer.
|
|
39
|
+
- A CLI behavior change requires a new `cli/package.json` version. The publish workflow releases it after merge to `main`.
|
|
@@ -1,21 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"name": "
|
|
3
|
+
"name": "kennel-plugins",
|
|
4
4
|
"version": "0.1.0",
|
|
5
5
|
"description": "Small shared contract for trusted folder view plugins in the Kennel web viewer.",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/raggle-ai/kennel.git",
|
|
11
|
+
"directory": "packages/plugins"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"registry": "https://registry.npmjs.org",
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": false,
|
|
8
21
|
"prettier": "@raggle-ai/prettier-config",
|
|
9
22
|
"exports": {
|
|
10
|
-
".":
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"./
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./client": {
|
|
28
|
+
"types": "./dist/client.d.ts",
|
|
29
|
+
"import": "./dist/client.js"
|
|
30
|
+
},
|
|
31
|
+
"./endpoint": {
|
|
32
|
+
"types": "./dist/endpoint.d.ts",
|
|
33
|
+
"import": "./dist/endpoint.js"
|
|
34
|
+
},
|
|
35
|
+
"./page": {
|
|
36
|
+
"types": "./dist/page.d.ts",
|
|
37
|
+
"import": "./dist/page.js"
|
|
38
|
+
},
|
|
39
|
+
"./server": {
|
|
40
|
+
"types": "./dist/server.d.ts",
|
|
41
|
+
"import": "./dist/server.js"
|
|
42
|
+
},
|
|
43
|
+
"./subpath": {
|
|
44
|
+
"types": "./dist/subpath.d.ts",
|
|
45
|
+
"import": "./dist/subpath.js"
|
|
46
|
+
},
|
|
47
|
+
"./types": {
|
|
48
|
+
"types": "./dist/types.d.ts",
|
|
49
|
+
"import": "./dist/types.js"
|
|
50
|
+
},
|
|
51
|
+
"./validation": {
|
|
52
|
+
"types": "./dist/validation.d.ts",
|
|
53
|
+
"import": "./dist/validation.js"
|
|
54
|
+
}
|
|
17
55
|
},
|
|
18
56
|
"scripts": {
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"prepack": "bun run build",
|
|
19
59
|
"test": "bun test test/*.test.mjs",
|
|
20
60
|
"typecheck": "tsc --noEmit",
|
|
21
61
|
"format": "prettier . --check --cache --cache-location .cache/.prettiercache --ignore-path ../../.prettierignore",
|
|
@@ -24,8 +64,19 @@
|
|
|
24
64
|
"lint:fix": "eslint . --fix --cache --cache-location .cache/.eslintcache",
|
|
25
65
|
"clean": "git clean -xdf dist node_modules .cache .turbo/cache"
|
|
26
66
|
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"class-variance-authority": "^0.7.1",
|
|
69
|
+
"clsx": "^2.1.1",
|
|
70
|
+
"cmdk": "^1.1.1",
|
|
71
|
+
"lucide-react": "^0.562.0",
|
|
72
|
+
"next-themes": "^0.4.6",
|
|
73
|
+
"radix-ui": "^1.6.7",
|
|
74
|
+
"sonner": "^2.0.7",
|
|
75
|
+
"tailwind-merge": "^3.4.0"
|
|
76
|
+
},
|
|
27
77
|
"peerDependencies": {
|
|
28
|
-
"react": ">=18.3.0"
|
|
78
|
+
"react": ">=18.3.0",
|
|
79
|
+
"react-dom": ">=18.3.0"
|
|
29
80
|
},
|
|
30
81
|
"devDependencies": {
|
|
31
82
|
"@eslint/compat": "catalog:eslint",
|
|
@@ -35,6 +86,8 @@
|
|
|
35
86
|
"@raggle-ai/eslint-config": "workspace:*",
|
|
36
87
|
"@raggle-ai/prettier-config": "workspace:*",
|
|
37
88
|
"@raggle-ai/tsconfig": "workspace:*",
|
|
89
|
+
"@raggle-ai/ui": "workspace:*",
|
|
90
|
+
"kennel-client": "workspace:*",
|
|
38
91
|
"@types/node": "catalog:",
|
|
39
92
|
"@types/react": "catalog:react19",
|
|
40
93
|
"eslint": "catalog:eslint",
|
|
@@ -44,6 +97,7 @@
|
|
|
44
97
|
"prettier-plugin-merge": "catalog:prettier",
|
|
45
98
|
"prettier-plugin-tailwindcss": "catalog:prettier",
|
|
46
99
|
"react": "catalog:react19",
|
|
100
|
+
"tsup": "8.5.1",
|
|
47
101
|
"typescript": "catalog:",
|
|
48
102
|
"typescript-eslint": "catalog:eslint"
|
|
49
103
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// The complete public surface for external folder plugins. Plugins should
|
|
2
|
+
// import this module only; it deliberately exposes selected shared UI, not
|
|
3
|
+
// the underlying @raggle-ai/ui package.
|
|
4
|
+
export {
|
|
5
|
+
CopyContextButton,
|
|
6
|
+
FilePreview,
|
|
7
|
+
FilePreviewList,
|
|
8
|
+
FolderFilterBar,
|
|
9
|
+
PluginPage,
|
|
10
|
+
PluginPageError,
|
|
11
|
+
PluginPageStatus,
|
|
12
|
+
useFolderFilter,
|
|
13
|
+
} from "./page.ts"
|
|
14
|
+
export { folderPathId } from "./client.ts"
|
|
15
|
+
export {
|
|
16
|
+
apiError,
|
|
17
|
+
ApiError,
|
|
18
|
+
jsonError,
|
|
19
|
+
jsonResponse,
|
|
20
|
+
parseJsonBody,
|
|
21
|
+
readBoundedBody,
|
|
22
|
+
runApiRoute,
|
|
23
|
+
sameOrigin,
|
|
24
|
+
} from "./endpoint.ts"
|
|
25
|
+
export { FolderPluginFailure } from "./server.ts"
|
|
26
|
+
export { isPluginPayloadError } from "./types.ts"
|
|
27
|
+
export type {
|
|
28
|
+
FolderPluginDataset,
|
|
29
|
+
FolderPluginDetection,
|
|
30
|
+
FolderPluginId,
|
|
31
|
+
FolderPluginManifest,
|
|
32
|
+
FolderPluginPayload,
|
|
33
|
+
FolderPluginPayloadError,
|
|
34
|
+
} from "./types.ts"
|
|
35
|
+
export type {
|
|
36
|
+
FolderPluginClient,
|
|
37
|
+
FolderPluginHostActions,
|
|
38
|
+
FolderPluginViewProps,
|
|
39
|
+
} from "./client.ts"
|
|
40
|
+
export type { ApiErrorCode, ApiRouteHandle, ApiRouteSpec } from "./endpoint.ts"
|
|
41
|
+
export type {
|
|
42
|
+
FolderPluginContext,
|
|
43
|
+
FolderPluginData,
|
|
44
|
+
FolderPluginInitFile,
|
|
45
|
+
FolderPluginInitResult,
|
|
46
|
+
FolderPluginServer,
|
|
47
|
+
} from "./server.ts"
|
|
48
|
+
export type {
|
|
49
|
+
FolderFilterChoice,
|
|
50
|
+
FolderFilterMode,
|
|
51
|
+
FolderSelection,
|
|
52
|
+
} from "./page.ts"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export {
|
|
2
|
+
EntityError as PluginPageError,
|
|
3
|
+
EntityPage as PluginPage,
|
|
4
|
+
EntityStatus as PluginPageStatus,
|
|
5
|
+
} from "@raggle-ai/ui/pages/entity-page"
|
|
6
|
+
export { CopyContextButton } from "@raggle-ai/ui/components/copy-context"
|
|
7
|
+
export {
|
|
8
|
+
FilePreview,
|
|
9
|
+
FilePreviewList,
|
|
10
|
+
} from "@raggle-ai/ui/components/file-preview"
|
|
11
|
+
export { FolderFilterBar } from "@raggle-ai/ui/components/folder-filter-bar"
|
|
12
|
+
export { useFolderFilter } from "@raggle-ai/ui/hooks/use-folder-filter"
|
|
13
|
+
export type {
|
|
14
|
+
FolderFilterChoice,
|
|
15
|
+
FolderFilterMode,
|
|
16
|
+
FolderSelection,
|
|
17
|
+
} from "@raggle-ai/ui/lib/folder-filter"
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
"allowImportingTsExtensions": true,
|
|
10
10
|
// local copy: bun doesn't read paths inherited via `extends`
|
|
11
11
|
"paths": {
|
|
12
|
-
"~/*": ["${configDir}/../../packages/*/src"]
|
|
12
|
+
"~/*": ["${configDir}/../../packages/*/src"],
|
|
13
|
+
"kennel-plugins": ["./src/index.ts"],
|
|
14
|
+
"kennel-plugins/*": ["./src/*"],
|
|
15
|
+
"@raggle-ai/ui/*": ["../ui/src/*"],
|
|
16
|
+
"kennel-client": ["../api-client/src/index.ts"]
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
"include": ["src"],
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineConfig } from "tsup"
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: [
|
|
5
|
+
"src/index.ts",
|
|
6
|
+
"src/client.ts",
|
|
7
|
+
"src/endpoint.ts",
|
|
8
|
+
"src/page.ts",
|
|
9
|
+
"src/server.ts",
|
|
10
|
+
"src/subpath.ts",
|
|
11
|
+
"src/types.ts",
|
|
12
|
+
"src/validation.ts",
|
|
13
|
+
],
|
|
14
|
+
format: ["esm"],
|
|
15
|
+
target: "es2022",
|
|
16
|
+
platform: "neutral",
|
|
17
|
+
clean: true,
|
|
18
|
+
esbuildOptions(options) {
|
|
19
|
+
options.jsx = "automatic"
|
|
20
|
+
},
|
|
21
|
+
splitting: true,
|
|
22
|
+
dts: { resolve: [/^@raggle-ai\/ui(?:\/|$)/, /^kennel-client(?:\/|$)/] },
|
|
23
|
+
noExternal: [/^@raggle-ai\/ui(?:\/|$)/, /^kennel-client(?:\/|$)/],
|
|
24
|
+
external: ["react", "react-dom", "react/jsx-runtime"],
|
|
25
|
+
})
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from "react"
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* One precise content problem, structurally identical to
|
|
5
|
-
* `ContentIssue` from
|
|
5
|
+
* `ContentIssue` from `kennel-plugins` (kept local so the ui
|
|
6
6
|
* package does not depend on the plugin contract's runtime).
|
|
7
7
|
*/
|
|
8
8
|
export type ContentIssue = {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
7
7
|
"jsx": "preserve",
|
|
8
8
|
"baseUrl": ".",
|
|
9
|
-
// Packages whose sources ui compile reach
|
|
9
|
+
// Packages whose sources ui compile reach kennel-plugins entries that
|
|
10
10
|
// import sibling files with .ts extensions (Bundler resolution, noEmit).
|
|
11
11
|
"allowImportingTsExtensions": true
|
|
12
12
|
},
|