@agent-native/core 0.7.23 → 0.7.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +2 -2
  2. package/dist/a2a/client.d.ts +10 -4
  3. package/dist/a2a/client.d.ts.map +1 -1
  4. package/dist/a2a/client.js +16 -1
  5. package/dist/a2a/client.js.map +1 -1
  6. package/dist/a2a/handlers.d.ts.map +1 -1
  7. package/dist/a2a/handlers.js +20 -17
  8. package/dist/a2a/handlers.js.map +1 -1
  9. package/dist/cli/create.d.ts +2 -1
  10. package/dist/cli/create.d.ts.map +1 -1
  11. package/dist/cli/create.js +13 -19
  12. package/dist/cli/create.js.map +1 -1
  13. package/dist/cli/index.js +23 -0
  14. package/dist/cli/index.js.map +1 -1
  15. package/dist/cli/workspace-dev.d.ts +3 -0
  16. package/dist/cli/workspace-dev.d.ts.map +1 -0
  17. package/dist/cli/workspace-dev.js +323 -0
  18. package/dist/cli/workspace-dev.js.map +1 -0
  19. package/dist/cli/workspacify.d.ts +3 -3
  20. package/dist/cli/workspacify.js +4 -4
  21. package/dist/cli/workspacify.js.map +1 -1
  22. package/dist/client/AgentPanel.d.ts.map +1 -1
  23. package/dist/client/AgentPanel.js +10 -9
  24. package/dist/client/AgentPanel.js.map +1 -1
  25. package/dist/client/AssistantChat.d.ts.map +1 -1
  26. package/dist/client/AssistantChat.js +2 -1
  27. package/dist/client/AssistantChat.js.map +1 -1
  28. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  29. package/dist/client/MultiTabAssistantChat.js +2 -1
  30. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  31. package/dist/client/components/ui/tooltip.d.ts +8 -0
  32. package/dist/client/components/ui/tooltip.d.ts.map +1 -0
  33. package/dist/client/components/ui/tooltip.js +11 -0
  34. package/dist/client/components/ui/tooltip.js.map +1 -0
  35. package/dist/client/resources/ResourceTree.d.ts.map +1 -1
  36. package/dist/client/resources/ResourceTree.js +21 -17
  37. package/dist/client/resources/ResourceTree.js.map +1 -1
  38. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  39. package/dist/client/resources/ResourcesPanel.js +13 -11
  40. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  41. package/dist/deploy/workspace-core.d.ts +1 -1
  42. package/dist/deploy/workspace-core.d.ts.map +1 -1
  43. package/dist/deploy/workspace-core.js +14 -11
  44. package/dist/deploy/workspace-core.js.map +1 -1
  45. package/dist/integrations/a2a-continuation-processor.d.ts +10 -0
  46. package/dist/integrations/a2a-continuation-processor.d.ts.map +1 -0
  47. package/dist/integrations/a2a-continuation-processor.js +150 -0
  48. package/dist/integrations/a2a-continuation-processor.js.map +1 -0
  49. package/dist/integrations/a2a-continuations-store.d.ts +41 -0
  50. package/dist/integrations/a2a-continuations-store.d.ts.map +1 -0
  51. package/dist/integrations/a2a-continuations-store.js +214 -0
  52. package/dist/integrations/a2a-continuations-store.js.map +1 -0
  53. package/dist/integrations/plugin.d.ts.map +1 -1
  54. package/dist/integrations/plugin.js +52 -0
  55. package/dist/integrations/plugin.js.map +1 -1
  56. package/dist/integrations/types.d.ts +5 -0
  57. package/dist/integrations/types.d.ts.map +1 -1
  58. package/dist/integrations/types.js.map +1 -1
  59. package/dist/integrations/webhook-handler.d.ts +6 -0
  60. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  61. package/dist/integrations/webhook-handler.js +69 -15
  62. package/dist/integrations/webhook-handler.js.map +1 -1
  63. package/dist/org/handlers.d.ts.map +1 -1
  64. package/dist/org/handlers.js +22 -16
  65. package/dist/org/handlers.js.map +1 -1
  66. package/dist/scripts/call-agent.d.ts.map +1 -1
  67. package/dist/scripts/call-agent.js +91 -30
  68. package/dist/scripts/call-agent.js.map +1 -1
  69. package/dist/server/agent-discovery.d.ts.map +1 -1
  70. package/dist/server/agent-discovery.js +20 -105
  71. package/dist/server/agent-discovery.js.map +1 -1
  72. package/dist/server/agents-bundle.js +1 -1
  73. package/dist/server/agents-bundle.js.map +1 -1
  74. package/dist/server/auth.d.ts.map +1 -1
  75. package/dist/server/auth.js +29 -120
  76. package/dist/server/auth.js.map +1 -1
  77. package/dist/server/better-auth-instance.d.ts +1 -0
  78. package/dist/server/better-auth-instance.d.ts.map +1 -1
  79. package/dist/server/better-auth-instance.js.map +1 -1
  80. package/dist/server/builder-browser.d.ts.map +1 -1
  81. package/dist/server/builder-browser.js +7 -5
  82. package/dist/server/builder-browser.js.map +1 -1
  83. package/dist/server/framework-request-handler.js +1 -1
  84. package/dist/server/framework-request-handler.js.map +1 -1
  85. package/dist/server/onboarding-html.d.ts +1 -8
  86. package/dist/server/onboarding-html.d.ts.map +1 -1
  87. package/dist/server/onboarding-html.js +321 -152
  88. package/dist/server/onboarding-html.js.map +1 -1
  89. package/dist/server/request-context.d.ts +14 -3
  90. package/dist/server/request-context.d.ts.map +1 -1
  91. package/dist/server/request-context.js +3 -0
  92. package/dist/server/request-context.js.map +1 -1
  93. package/dist/templates/default/_gitignore +2 -0
  94. package/dist/templates/workspace-core/AGENTS.md +18 -71
  95. package/dist/templates/workspace-core/package.json +2 -20
  96. package/dist/templates/workspace-core/src/client/index.ts +2 -26
  97. package/dist/templates/workspace-core/src/index.ts +1 -21
  98. package/dist/templates/workspace-core/src/server/index.ts +3 -22
  99. package/dist/templates/workspace-root/README.md +17 -20
  100. package/dist/templates/workspace-root/_gitignore +3 -0
  101. package/dist/templates/workspace-root/package.json +6 -13
  102. package/dist/templates/workspace-root/pnpm-workspace.yaml +4 -2
  103. package/dist/vite/agents-bundle-plugin.js +2 -2
  104. package/dist/vite/agents-bundle-plugin.js.map +1 -1
  105. package/docs/content/authentication.md +3 -5
  106. package/docs/content/multi-app-workspace.md +38 -50
  107. package/package.json +1 -1
  108. package/src/templates/default/_gitignore +2 -0
  109. package/src/templates/workspace-core/AGENTS.md +18 -71
  110. package/src/templates/workspace-core/package.json +2 -20
  111. package/src/templates/workspace-core/src/client/index.ts +2 -26
  112. package/src/templates/workspace-core/src/index.ts +1 -21
  113. package/src/templates/workspace-core/src/server/index.ts +3 -22
  114. package/src/templates/workspace-root/README.md +17 -20
  115. package/src/templates/workspace-root/_gitignore +3 -0
  116. package/src/templates/workspace-root/package.json +6 -13
  117. package/src/templates/workspace-root/pnpm-workspace.yaml +4 -2
  118. package/dist/templates/default/.claude/settings.json +0 -100
  119. package/dist/templates/workspace-core/.agents/skills/company-policies/SKILL.md +0 -42
  120. package/dist/templates/workspace-core/actions/company-directory.ts +0 -38
  121. package/dist/templates/workspace-core/src/client/AuthenticatedLayout.tsx +0 -37
  122. package/dist/templates/workspace-core/src/credentials.ts +0 -67
  123. package/dist/templates/workspace-core/src/server/agent-chat-plugin.ts +0 -30
  124. package/dist/templates/workspace-core/src/server/auth-plugin.ts +0 -35
  125. package/dist/templates/workspace-core/styles/tokens.css +0 -22
  126. package/dist/templates/workspace-root/.github/workflows/ci.yml +0 -32
  127. package/dist/templates/workspace-root/scripts/workspace-dev.ts +0 -377
  128. package/src/templates/default/.claude/settings.json +0 -100
  129. package/src/templates/workspace-core/.agents/skills/company-policies/SKILL.md +0 -42
  130. package/src/templates/workspace-core/actions/company-directory.ts +0 -38
  131. package/src/templates/workspace-core/src/client/AuthenticatedLayout.tsx +0 -37
  132. package/src/templates/workspace-core/src/credentials.ts +0 -67
  133. package/src/templates/workspace-core/src/server/agent-chat-plugin.ts +0 -30
  134. package/src/templates/workspace-core/src/server/auth-plugin.ts +0 -35
  135. package/src/templates/workspace-core/styles/tokens.css +0 -22
  136. package/src/templates/workspace-root/.github/workflows/ci.yml +0 -32
  137. package/src/templates/workspace-root/scripts/workspace-dev.ts +0 -377
@@ -1,21 +1 @@
1
- /**
2
- * @{{APP_NAME}}/core-module — enterprise-wide workspace core.
3
- *
4
- * Every agent-native app in this workspace inherits from this package:
5
- * - Server plugins (auth, org, agent-chat) — see src/server
6
- * - Shared React components and hooks — see src/client
7
- * - Shared agent actions — see actions/
8
- * - Shared agent skills — see skills/
9
- * - Enterprise-wide agent instructions — see AGENTS.md
10
- * - Shared Tailwind v4 design tokens — see styles/tokens.css
11
- *
12
- * Apps don't import from this root entry directly — they import from
13
- * the specific sub-path they need:
14
- *
15
- * import { authPlugin } from "@{{APP_NAME}}/core-module/server";
16
- * import { AuthenticatedLayout } from "@{{APP_NAME}}/core-module/client";
17
- * import { resolveCompanyCredential } from "@{{APP_NAME}}/core-module/credentials";
18
- *
19
- * This root file is for package metadata only.
20
- */
21
- export const WORKSPACE_CORE_NAME = "@{{APP_NAME}}/core-module";
1
+ export const WORKSPACE_SHARED_NAME = "@{{APP_NAME}}/shared";
@@ -1,22 +1,3 @@
1
- /**
2
- * Server-side entry for @{{APP_NAME}}/core-module.
3
- *
4
- * Exports plugin overrides for any framework slot you want to customize
5
- * across every app in this workspace. The agent-native framework looks for
6
- * these exports by name when deciding what to auto-mount — see the "three
7
- * layer inheritance" section in the root README.
8
- *
9
- * Supported export names (any subset):
10
- * - authPlugin → overrides @agent-native/core's auth
11
- * - orgPlugin → overrides @agent-native/core's org
12
- * - agentChatPlugin → overrides @agent-native/core's agent-chat
13
- * - coreRoutesPlugin → overrides @agent-native/core's core-routes
14
- * - integrationsPlugin → overrides @agent-native/core's integrations
15
- * - resourcesPlugin → overrides @agent-native/core's resources
16
- * - terminalPlugin → overrides @agent-native/core's terminal
17
- *
18
- * Anything you don't export falls through to the framework default.
19
- */
20
-
21
- export { authPlugin } from "./auth-plugin.js";
22
- export { agentChatPlugin } from "./agent-chat-plugin.js";
1
+ // Export workspace-wide server plugin overrides here when you need them.
2
+ // Anything not exported falls through to @agent-native/core defaults.
3
+ export {};
@@ -1,23 +1,21 @@
1
1
  # {{APP_TITLE}} — Agent-Native Workspace
2
2
 
3
3
  A monorepo hosting multiple agent-native apps that all inherit from a single
4
- private **workspace core** package. The core module provides shared auth,
5
- agent instructions, skills, components, and plugins; each app just ships its
6
- own screens and template-specific actions.
4
+ private **shared** package. The framework provides the defaults; this package
5
+ is only for code, instructions, and policies that are genuinely shared by more
6
+ than one app.
7
7
 
8
8
  ## Layout
9
9
 
10
10
  ```
11
11
  {{APP_NAME}}/
12
12
  ├── packages/
13
- │ └── core-module/ # @{{APP_NAME}}/core-modulethe shared mid-layer
14
- │ ├── src/server/ # Auth / org / agent-chat plugin overrides
15
- │ ├── src/client/ # Shared React components (org switcher, layouts…)
16
- ├── actions/ # Shared agent-callable actions
17
- │ ├── skills/ # Shared .agents skills baked into every app
18
- │ └── AGENTS.md # Enterprise-wide agent instructions
13
+ │ └── shared/ # @{{APP_NAME}}/sharedoptional shared code
14
+ │ ├── src/server/ # Add plugin overrides only when needed
15
+ │ ├── src/client/ # Add shared React code only when needed
16
+ └── AGENTS.md # Workspace-wide agent instructions
19
17
  └── apps/
20
- └── example/ # Sample app demonstrating inheritance
18
+ └── example/ # App-specific routes, actions, and state
21
19
  ```
22
20
 
23
21
  ## Three-layer inheritance
@@ -26,14 +24,14 @@ Every app in this workspace inherits cross-cutting behavior automatically:
26
24
 
27
25
  1. **App local** (highest priority) — anything under `apps/<name>/server/plugins/`,
28
26
  `apps/<name>/actions/`, `apps/<name>/.agents/skills/`, `apps/<name>/AGENTS.md`.
29
- 2. **Workspace core** (middle) — `packages/core-module/src/server/`,
30
- `packages/core-module/actions/`, `packages/core-module/skills/`,
31
- `packages/core-module/AGENTS.md`.
27
+ 2. **Workspace shared** (middle) — `packages/shared/src/server/`,
28
+ `packages/shared/src/client/`, `packages/shared/actions/`,
29
+ `packages/shared/.agents/skills/`, `packages/shared/AGENTS.md`.
32
30
  3. **Framework** (lowest) — `@agent-native/core` defaults.
33
31
 
34
32
  Apps don't need any configuration to opt in. Discovery happens via the
35
33
  `agent-native.workspaceCore` field in this root `package.json`, which names
36
- the workspace core package (`@{{APP_NAME}}/core-module`).
34
+ the shared package (`@{{APP_NAME}}/shared`).
37
35
 
38
36
  ## Getting started
39
37
 
@@ -54,12 +52,11 @@ pnpm exec agent-native create crm --template=starter
54
52
  ```
55
53
 
56
54
  The CLI detects the workspace root and scaffolds a minimal app that already
57
- depends on `@{{APP_NAME}}/core-module`. Edit only the routes you care about;
58
- auth, org switching, skills, and instructions come from the core module.
55
+ depends on `@{{APP_NAME}}/shared`. Edit only the routes you care about;
56
+ auth, org switching, skills, and instructions come from the shared package.
59
57
 
60
58
  ## Editing shared behavior
61
59
 
62
- Everything cross-cutting lives in `packages/core-module/`. A change to
63
- `packages/core-module/src/server/auth-plugin.ts`, for example, is picked up
64
- by every app in the workspace on the next dev reload — no need to touch any
65
- individual app.
60
+ Put cross-cutting code in `packages/shared/` when more than one app needs it.
61
+ For example, exporting an `authPlugin` from `packages/shared/src/server/index.ts`
62
+ lets every app use the same auth customization on the next dev reload.
@@ -6,6 +6,9 @@ apps/*/build/
6
6
  apps/*/.output/
7
7
  apps/*/.netlify/
8
8
  apps/*/.vercel/
9
+ packages/*/node_modules/
10
+ packages/*/dist/
11
+ packages/*/build/
9
12
  .deploy-tmp/
10
13
 
11
14
  # Env files — never commit secrets
@@ -3,29 +3,22 @@
3
3
  "private": true,
4
4
  "version": "0.0.0",
5
5
  "scripts": {
6
- "dev": "tsx scripts/workspace-dev.ts",
6
+ "dev": "agent-native dev",
7
7
  "build": "pnpm -r build",
8
8
  "typecheck": "pnpm -r typecheck",
9
9
  "fmt:check": "prettier --check .",
10
10
  "lint": "pnpm fmt:check"
11
11
  },
12
12
  "agent-native": {
13
- "workspaceCore": "@{{APP_NAME}}/core-module"
13
+ "workspaceCore": "@{{APP_NAME}}/shared"
14
+ },
15
+ "dependencies": {
16
+ "@agent-native/core": "latest"
14
17
  },
15
18
  "devDependencies": {
16
19
  "@types/node": "^24.2.1",
17
20
  "prettier": "^3.6.2",
18
- "tsx": "catalog:",
19
21
  "typescript": "^6.0.3"
20
22
  },
21
- "packageManager": "pnpm@10.14.0",
22
- "pnpm": {
23
- "onlyBuiltDependencies": [
24
- "better-sqlite3",
25
- "esbuild",
26
- "lightningcss",
27
- "node-pty",
28
- "@swc/core"
29
- ]
30
- }
23
+ "packageManager": "pnpm@10.14.0"
31
24
  }
@@ -3,8 +3,10 @@ packages:
3
3
  - "apps/*"
4
4
 
5
5
  onlyBuiltDependencies:
6
- - esbuild
6
+ - "@swc/core"
7
7
  - better-sqlite3
8
+ - canvas
9
+ - electron
10
+ - esbuild
8
11
  - lightningcss
9
12
  - node-pty
10
- - "@swc/core"
@@ -1,100 +0,0 @@
1
- {
2
- "hooks": {
3
- "UserPromptSubmit": [
4
- {
5
- "hooks": [
6
- {
7
- "type": "command",
8
- "command": "pnpm action view-screen 2>/dev/null || echo '{\"view\": \"unknown\"}'",
9
- "timeout": 10
10
- }
11
- ]
12
- }
13
- ]
14
- },
15
- "permissions": {
16
- "allow": [
17
- "Read",
18
- "Edit",
19
- "Write",
20
- "Glob",
21
- "Grep",
22
- "NotebookEdit",
23
- "WebFetch",
24
- "WebSearch",
25
- "Bash(ls *)",
26
- "Bash(pwd)",
27
- "Bash(echo *)",
28
- "Bash(cat *)",
29
- "Bash(head *)",
30
- "Bash(tail *)",
31
- "Bash(find *)",
32
- "Bash(wc *)",
33
- "Bash(sort *)",
34
- "Bash(uniq *)",
35
- "Bash(diff *)",
36
- "Bash(which *)",
37
- "Bash(env)",
38
- "Bash(mkdir *)",
39
- "Bash(cp *)",
40
- "Bash(mv *)",
41
- "Bash(touch *)",
42
- "Bash(chmod *)",
43
- "Bash(cd *)",
44
- "Bash(node *)",
45
- "Bash(npx *)",
46
- "Bash(npm *)",
47
- "Bash(pnpm *)",
48
- "Bash(yarn *)",
49
- "Bash(tsx *)",
50
- "Bash(tsc *)",
51
- "Bash(vitest *)",
52
- "Bash(jest *)",
53
- "Bash(eslint *)",
54
- "Bash(prettier *)",
55
- "Bash(git status*)",
56
- "Bash(git log *)",
57
- "Bash(git diff *)",
58
- "Bash(git show *)",
59
- "Bash(git branch*)",
60
- "Bash(git add *)",
61
- "Bash(git commit *)",
62
- "Bash(git checkout *)",
63
- "Bash(git switch *)",
64
- "Bash(git stash *)",
65
- "Bash(git merge *)",
66
- "Bash(git rebase *)",
67
- "Bash(git pull *)",
68
- "Bash(git blame *)",
69
- "Bash(git rev-parse *)",
70
- "Bash(git worktree *)",
71
- "Bash(git remote -v)",
72
- "Bash(gh *)",
73
- "Bash(curl *)",
74
- "Bash(grep *)",
75
- "Bash(rg *)",
76
- "Bash(sed *)",
77
- "Bash(awk *)",
78
- "Bash(jq *)",
79
- "Bash(rm *)"
80
- ],
81
- "deny": [
82
- "Bash(rm -rf /)",
83
- "Bash(rm -rf /*)",
84
- "Bash(rm -rf ~)",
85
- "Bash(rm -rf ~/*)",
86
- "Bash(sudo *)",
87
- "Bash(git push --force *)",
88
- "Bash(git push -f *)",
89
- "Bash(git reset --hard *)",
90
- "Bash(git clean -f *)",
91
- "Bash(dd *)",
92
- "Bash(mkfs *)",
93
- "Bash(kill -9 *)",
94
- "Bash(killall *)",
95
- "Bash(pkill *)",
96
- "Bash(shutdown *)",
97
- "Bash(reboot *)"
98
- ]
99
- }
100
- }
@@ -1,42 +0,0 @@
1
- ---
2
- name: company-policies
3
- description: {{APP_TITLE}}-wide policies the agent must enforce for every app — data handling, PII, approval flows, compliance rules.
4
- ---
5
-
6
- # {{APP_TITLE}} Company Policies
7
-
8
- Every app in the workspace shares these policies. Read this skill before
9
- taking any action that touches customer data, external services, or
10
- deployed state.
11
-
12
- ## Data handling
13
-
14
- - **PII minimization.** Only load the fields you actually need. Never
15
- `SELECT *` on a table that contains customer records.
16
- - **No raw customer email in logs.** Hash or redact before logging.
17
- - **Retention.** Deleted records are soft-deleted first and purged by a
18
- scheduled job. Do not write actions that hard-delete customer data.
19
-
20
- ## Third-party calls
21
-
22
- - **Allowlist only.** Only call domains on the approved allowlist
23
- (documented in the root `README.md`). If an integration needs a new
24
- domain, surface a warning and wait for human approval before making
25
- the call.
26
- - **Secrets come from `resolveCompanyCredential`.** Never hardcode.
27
- Never check secrets into git. Rotating a key in the central store
28
- updates every app on the next request.
29
-
30
- ## Approval flows
31
-
32
- - **Destructive operations need a confirmation preview.** Any action
33
- that modifies production data must first return a preview of the
34
- change (what will be created / updated / deleted) and wait for
35
- explicit user confirmation before executing.
36
-
37
- ## Apply across apps
38
-
39
- This skill is loaded automatically in every workspace app. If an
40
- individual app needs different behavior, it can add a same-named skill
41
- under its own `.agents/skills/company-policies/SKILL.md` and that copy
42
- will win for that app only.
@@ -1,38 +0,0 @@
1
- /**
2
- * Shared action: look up an employee in the company directory.
3
- *
4
- * Every app in the workspace inherits this action automatically — no
5
- * wiring required. From the agent's perspective it behaves exactly like
6
- * a template action: the tool shows up in every app's agent, and calling
7
- * it from the UI via `useActionQuery("company-directory", { ... })` Just
8
- * Works.
9
- *
10
- * Replace the stub implementation with a real call to your company
11
- * directory (SCIM, Okta Users API, internal /people endpoint, etc.).
12
- */
13
- import { z } from "zod";
14
- import { defineAction } from "@agent-native/core";
15
-
16
- export default defineAction({
17
- description:
18
- "Look up a person in the {{APP_TITLE}} company directory by name or email. Returns role, team, and manager.",
19
- schema: z.object({
20
- query: z.string().describe("Name, email, or partial match to search for"),
21
- }),
22
- run: async (args) => {
23
- // TODO: replace with a real lookup. This stub just echoes the query
24
- // so the agent has a reasonable no-op while you wire up the real
25
- // directory integration.
26
- return {
27
- results: [
28
- {
29
- query: args.query,
30
- name: "(stub) " + args.query,
31
- role: "Unknown",
32
- team: "Unknown",
33
- manager: null,
34
- },
35
- ],
36
- };
37
- },
38
- });
@@ -1,37 +0,0 @@
1
- /**
2
- * Shared authenticated layout for every app in the @{{APP_NAME}} workspace.
3
- *
4
- * Provides the common chrome (brand header, user menu, agent chat sidebar)
5
- * so individual apps only have to render their own content. Replace this
6
- * with a real component that pulls in your design system. Every app
7
- * imports it the same way:
8
- *
9
- * import { AuthenticatedLayout } from "@{{APP_NAME}}/core-module/client";
10
- *
11
- * export default function Home() {
12
- * return (
13
- * <AuthenticatedLayout>
14
- * <h1>My app's screen</h1>
15
- * </AuthenticatedLayout>
16
- * );
17
- * }
18
- */
19
- import type { ReactNode } from "react";
20
-
21
- export interface AuthenticatedLayoutProps {
22
- children: ReactNode;
23
- }
24
-
25
- // Workspace title — replaced at scaffold time by the create-workspace CLI.
26
- const WORKSPACE_TITLE = "{{APP_TITLE}}";
27
-
28
- export function AuthenticatedLayout({ children }: AuthenticatedLayoutProps) {
29
- return (
30
- <div className="min-h-screen flex flex-col">
31
- <header className="border-b px-6 py-3">
32
- <strong>{WORKSPACE_TITLE}</strong>
33
- </header>
34
- <main className="flex-1 p-6">{children}</main>
35
- </div>
36
- );
37
- }
@@ -1,67 +0,0 @@
1
- /**
2
- * Centralized credential helpers for the @{{APP_NAME}} workspace.
3
- *
4
- * Every enterprise has a few API keys that multiple apps need to share:
5
- * a Slack bot token, a Sentry DSN, an OpenAI key, internal service
6
- * credentials. Instead of each app reading them separately, we namespace
7
- * them here so there's a single place to update when a key rotates.
8
- *
9
- * Under the hood this is a thin wrapper over @agent-native/core's
10
- * `resolveCredential()`, which reads per-user / per-org rows in the
11
- * shared SQL settings table. Apps inside the workspace share the same
12
- * DATABASE_URL by default, so storing a credential once makes it
13
- * available everywhere.
14
- *
15
- * A request/action context is required so credentials stay scoped to the
16
- * correct user and organization. This helper can read that context
17
- * automatically inside agent-native actions; otherwise pass it explicitly.
18
- */
19
- import { resolveCredential } from "@agent-native/core/credentials";
20
- import {
21
- getRequestOrgId,
22
- getRequestUserEmail,
23
- } from "@agent-native/core/server";
24
-
25
- /**
26
- * Optional context for scoping a credential lookup to a specific user or org.
27
- */
28
- export interface CompanyCredentialContext {
29
- userEmail?: string;
30
- orgId?: string | null;
31
- }
32
-
33
- type ResolveCredentialFn = (
34
- key: string,
35
- ctx: CompanyCredentialContext,
36
- ) => Promise<string | undefined>;
37
-
38
- /**
39
- * Resolve a company-wide credential. Prefer this over `resolveCredential()`
40
- * directly — it keeps your keys organized under a workspace namespace and
41
- * makes "where does this secret come from" greppable.
42
- *
43
- * Inside an agent-native action:
44
- * const slackToken = await resolveCompanyCredential("SLACK_BOT_TOKEN");
45
- *
46
- * Outside request context:
47
- * const slackToken = await resolveCompanyCredential("SLACK_BOT_TOKEN", {
48
- * userEmail: session.email,
49
- * orgId: session.orgId ?? null,
50
- * });
51
- */
52
- export async function resolveCompanyCredential(
53
- key: string,
54
- ctx?: CompanyCredentialContext,
55
- ): Promise<string | undefined> {
56
- const effectiveCtx: CompanyCredentialContext = ctx?.userEmail
57
- ? ctx
58
- : {
59
- userEmail: getRequestUserEmail() ?? undefined,
60
- orgId: getRequestOrgId(),
61
- };
62
- if (!effectiveCtx.userEmail) return undefined;
63
- return await (resolveCredential as ResolveCredentialFn)(key, {
64
- userEmail: effectiveCtx.userEmail,
65
- orgId: effectiveCtx.orgId ?? null,
66
- });
67
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * Workspace-wide agent-chat plugin for @{{APP_NAME}}/core-module.
3
- *
4
- * This mounts the framework's default agent-chat plugin so every app in
5
- * the workspace gets the same chat endpoint, mention providers, and
6
- * built-in tools. The ENTERPRISE-WIDE system prompt additions — things
7
- * the agent should know across every app — live in the workspace's
8
- * AGENTS.md file, which is loaded automatically into the prompt as a
9
- * `<resource scope="workspace">` block.
10
- *
11
- * Customize this wrapper when you need agent behavior that can't be
12
- * expressed in AGENTS.md — e.g. injecting enterprise-specific mention
13
- * providers, pre-loading a custom set of MCP servers, or rewriting
14
- * model choice based on your company's allowlist.
15
- */
16
- import { defaultAgentChatPlugin } from "@agent-native/core/server";
17
-
18
- export const agentChatPlugin = async (nitroApp: any): Promise<void> => {
19
- await defaultAgentChatPlugin(nitroApp);
20
-
21
- // Hook for enterprise customization:
22
- //
23
- // const chat = createAgentChatPlugin({
24
- // systemPrompt: (base) => `${base}\n\nCompany policy: …`,
25
- // mentionProviders: {
26
- // people: async (query) => searchCompanyDirectory(query),
27
- // },
28
- // });
29
- // await chat(nitroApp);
30
- };
@@ -1,35 +0,0 @@
1
- /**
2
- * Workspace-wide auth plugin for @{{APP_NAME}}/core-module.
3
- *
4
- * Today this just re-uses the framework default, which already does the
5
- * right thing for most enterprises (Better Auth with Google SSO when
6
- * GOOGLE_CLIENT_ID/SECRET are set, email/password otherwise, local dev
7
- * bypass via AUTH_MODE=local). Customize it here when your enterprise
8
- * needs specific behavior — e.g.:
9
- *
10
- * - Wrap the default to force a specific SSO provider
11
- * - Add a callback that provisions users into your directory
12
- * - Pre-register organizations / role mappings from Okta groups
13
- * - Fail closed on unauthenticated requests outside dev
14
- *
15
- * Every app in the workspace inherits this automatically (as long as the
16
- * root package.json has `"agent-native": { "workspaceCore": "@{{APP_NAME}}/core-module" }`).
17
- */
18
- import { defaultAuthPlugin } from "@agent-native/core/server";
19
-
20
- export const authPlugin = async (nitroApp: any): Promise<void> => {
21
- // Run the framework default first so Better Auth, org tables, and session
22
- // middleware are all set up.
23
- await defaultAuthPlugin(nitroApp);
24
-
25
- // Add enterprise-specific post-auth behavior here. Examples:
26
- //
27
- // const h3 = getH3App(nitroApp);
28
- // h3.use(defineEventHandler(async (event) => {
29
- // const session = await getSession(event);
30
- // if (session?.email && !session.email.endsWith("@{{APP_NAME}}.com")) {
31
- // setResponseStatus(event, 403);
32
- // return { error: "Only @{{APP_NAME}}.com accounts allowed" };
33
- // }
34
- // }));
35
- };
@@ -1,22 +0,0 @@
1
- /**
2
- * Workspace-wide Tailwind v4 design tokens for @{{APP_NAME}}/core-module.
3
- *
4
- * Every app in the workspace should import this from its own
5
- * `app/global.css` so brand updates in one place propagate to all apps:
6
- *
7
- * @import "tailwindcss";
8
- * @import "@{{APP_NAME}}/core-module/styles/tokens.css";
9
- *
10
- * Replace the values below with your real brand palette.
11
- */
12
-
13
- /* Re-export the framework's standard token mappings (color-background,
14
- color-foreground, color-border, …) so apps don't need a second import. */
15
- @import "@agent-native/core/styles/agent-native.css";
16
-
17
- @theme {
18
- /* Add enterprise brand colors here. They become utility classes:
19
- `bg-brand`, `text-brand-foreground`, etc. */
20
- --color-brand: #4f46e5;
21
- --color-brand-foreground: #ffffff;
22
- }
@@ -1,32 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- pull_request:
5
- push:
6
- branches: [main]
7
-
8
- permissions:
9
- contents: read
10
-
11
- jobs:
12
- checks:
13
- name: Lint, typecheck, build
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - uses: pnpm/action-setup@v4
20
-
21
- - uses: actions/setup-node@v4
22
- with:
23
- node-version: "22"
24
- cache: "pnpm"
25
-
26
- - run: pnpm install --no-frozen-lockfile
27
-
28
- - run: pnpm lint
29
-
30
- - run: pnpm typecheck
31
-
32
- - run: pnpm build