@memberjunction/cli 6.1.4 → 6.2.0-edge.1

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 (235) hide show
  1. package/README.md +18 -7
  2. package/dist/baseline/cli-helpers.d.ts +4 -0
  3. package/dist/baseline/cli-helpers.d.ts.map +1 -1
  4. package/dist/baseline/cli-helpers.js +18 -10
  5. package/dist/baseline/cli-helpers.js.map +1 -1
  6. package/dist/baseline/comparator.d.ts +5 -3
  7. package/dist/baseline/comparator.d.ts.map +1 -1
  8. package/dist/baseline/comparator.js +142 -138
  9. package/dist/baseline/comparator.js.map +1 -1
  10. package/dist/baseline/connection.d.ts +8 -6
  11. package/dist/baseline/connection.d.ts.map +1 -1
  12. package/dist/baseline/connection.js +16 -12
  13. package/dist/baseline/connection.js.map +1 -1
  14. package/dist/baseline/data-dumper.d.ts +7 -3
  15. package/dist/baseline/data-dumper.d.ts.map +1 -1
  16. package/dist/baseline/data-dumper.js +33 -25
  17. package/dist/baseline/data-dumper.js.map +1 -1
  18. package/dist/baseline/emitter.d.ts +5 -3
  19. package/dist/baseline/emitter.d.ts.map +1 -1
  20. package/dist/baseline/emitter.js +114 -110
  21. package/dist/baseline/emitter.js.map +1 -1
  22. package/dist/baseline/index.d.ts +7 -7
  23. package/dist/baseline/index.d.ts.map +1 -1
  24. package/dist/baseline/index.js +7 -7
  25. package/dist/baseline/index.js.map +1 -1
  26. package/dist/baseline/introspector-mssql.d.ts +2 -0
  27. package/dist/baseline/introspector-mssql.d.ts.map +1 -1
  28. package/dist/baseline/introspector-mssql.js +68 -64
  29. package/dist/baseline/introspector-mssql.js.map +1 -1
  30. package/dist/baseline/introspector-postgres.d.ts +2 -0
  31. package/dist/baseline/introspector-postgres.d.ts.map +1 -1
  32. package/dist/baseline/introspector-postgres.js +34 -30
  33. package/dist/baseline/introspector-postgres.js.map +1 -1
  34. package/dist/baseline/report.d.ts +4 -0
  35. package/dist/baseline/report.d.ts.map +1 -1
  36. package/dist/baseline/report.js +25 -17
  37. package/dist/baseline/report.js.map +1 -1
  38. package/dist/baseline/types.d.ts +71 -71
  39. package/dist/baseline/util.d.ts +54 -6
  40. package/dist/baseline/util.d.ts.map +1 -1
  41. package/dist/baseline/util.js +112 -36
  42. package/dist/baseline/util.js.map +1 -1
  43. package/dist/commands/agent/init.d.ts +23 -0
  44. package/dist/commands/agent/init.d.ts.map +1 -0
  45. package/dist/commands/agent/init.js +222 -0
  46. package/dist/commands/agent/init.js.map +1 -0
  47. package/dist/commands/ai/actions/list.js +7 -7
  48. package/dist/commands/ai/actions/run.js +7 -7
  49. package/dist/commands/ai/agents/list.js +7 -7
  50. package/dist/commands/ai/agents/run.js +9 -9
  51. package/dist/commands/ai/audit/agent-run.js +7 -7
  52. package/dist/commands/ai/prompts/run.js +7 -7
  53. package/dist/commands/app/check-updates.js +5 -5
  54. package/dist/commands/app/disable.js +2 -2
  55. package/dist/commands/app/enable.js +2 -2
  56. package/dist/commands/app/info.js +2 -2
  57. package/dist/commands/app/install.js +2 -2
  58. package/dist/commands/app/list.js +2 -2
  59. package/dist/commands/app/remove.js +4 -4
  60. package/dist/commands/app/upgrade.js +2 -2
  61. package/dist/commands/artifacts/reclassify.js +2 -2
  62. package/dist/commands/baseline/build.js +31 -31
  63. package/dist/commands/baseline/build.js.map +1 -1
  64. package/dist/commands/baseline/compare.js +36 -36
  65. package/dist/commands/baseline/roundtrip.js +56 -54
  66. package/dist/commands/baseline/roundtrip.js.map +1 -1
  67. package/dist/commands/bundle/index.js +4 -4
  68. package/dist/commands/clean/index.js +3 -3
  69. package/dist/commands/codegen/manifest.d.ts +2 -0
  70. package/dist/commands/codegen/manifest.d.ts.map +1 -1
  71. package/dist/commands/codegen/manifest.js +8 -4
  72. package/dist/commands/codegen/manifest.js.map +1 -1
  73. package/dist/commands/dev/workspace/index.d.ts +2 -0
  74. package/dist/commands/dev/workspace/index.d.ts.map +1 -1
  75. package/dist/commands/dev/workspace/index.js +8 -4
  76. package/dist/commands/dev/workspace/index.js.map +1 -1
  77. package/dist/commands/doctor/index.d.ts +6 -4
  78. package/dist/commands/doctor/index.d.ts.map +1 -1
  79. package/dist/commands/doctor/index.js +43 -18
  80. package/dist/commands/doctor/index.js.map +1 -1
  81. package/dist/commands/install/claude.d.ts +2 -0
  82. package/dist/commands/install/claude.d.ts.map +1 -1
  83. package/dist/commands/install/claude.js +11 -7
  84. package/dist/commands/install/claude.js.map +1 -1
  85. package/dist/commands/install/index.js +3 -3
  86. package/dist/commands/migrate/convert.d.ts +21 -0
  87. package/dist/commands/migrate/convert.d.ts.map +1 -1
  88. package/dist/commands/migrate/convert.js +22 -6
  89. package/dist/commands/migrate/convert.js.map +1 -1
  90. package/dist/commands/migrate/create.js +2 -2
  91. package/dist/commands/migrate/index.js +16 -16
  92. package/dist/commands/sync/file-reset.js +2 -2
  93. package/dist/commands/sync/init.js +3 -3
  94. package/dist/commands/test/compare.js +6 -6
  95. package/dist/commands/test/history.js +6 -6
  96. package/dist/commands/test/list.js +6 -6
  97. package/dist/commands/test/regression/build.js +5 -5
  98. package/dist/commands/test/regression/compare.js +3 -3
  99. package/dist/commands/test/regression/down.js +4 -4
  100. package/dist/commands/test/regression/export.js +4 -4
  101. package/dist/commands/test/regression/gen-forms.js +3 -3
  102. package/dist/commands/test/regression/remote.js +10 -10
  103. package/dist/commands/test/regression/up.js +6 -6
  104. package/dist/commands/test/run.js +6 -6
  105. package/dist/commands/test/scripts.d.ts +13 -0
  106. package/dist/commands/test/scripts.d.ts.map +1 -0
  107. package/dist/commands/test/scripts.js +50 -0
  108. package/dist/commands/test/scripts.js.map +1 -0
  109. package/dist/commands/test/suite.js +6 -6
  110. package/dist/commands/test/validate.js +6 -6
  111. package/dist/commands/translate-sql/index.js +25 -25
  112. package/dist/commands/update/claude.js +7 -7
  113. package/dist/commands/usage.js +4 -4
  114. package/dist/config.d.ts +175 -1
  115. package/dist/config.d.ts.map +1 -1
  116. package/dist/config.js +23 -9
  117. package/dist/config.js.map +1 -1
  118. package/dist/hooks/postrun.js +2 -2
  119. package/dist/hooks/prerun.js +2 -2
  120. package/dist/hooks/prerun.js.map +1 -1
  121. package/dist/init-templates/citizen-builder/.agents/skills/new-agent/SKILL.md +66 -0
  122. package/dist/init-templates/citizen-builder/.agents/skills/package-agent/SKILL.md +69 -0
  123. package/dist/init-templates/citizen-builder/.agents/skills/test-agent/SKILL.md +61 -0
  124. package/dist/init-templates/citizen-builder/.claude/skills/new-agent/SKILL.md +66 -0
  125. package/dist/init-templates/citizen-builder/.claude/skills/package-agent/SKILL.md +69 -0
  126. package/dist/init-templates/citizen-builder/.claude/skills/test-agent/SKILL.md +61 -0
  127. package/dist/init-templates/citizen-builder/.env.example +30 -0
  128. package/dist/init-templates/citizen-builder/AGENTS.md +331 -0
  129. package/dist/init-templates/citizen-builder/README.md +259 -0
  130. package/dist/init-templates/citizen-builder/docker/Dockerfile +16 -0
  131. package/dist/init-templates/citizen-builder/docker-compose.yml +59 -0
  132. package/dist/init-templates/citizen-builder/docs/ENTERPRISE_ORG_SETUP.md +73 -0
  133. package/dist/init-templates/citizen-builder/docs/PROMOTION_GUIDE.md +70 -0
  134. package/dist/init-templates/citizen-builder/metadata/.mj-sync.json +7 -0
  135. package/dist/init-templates/citizen-builder/metadata/agents/.customer-insight-agent.json +55 -0
  136. package/dist/init-templates/citizen-builder/metadata/agents/.mj-sync.json +45 -0
  137. package/dist/init-templates/citizen-builder/metadata/prompts/.customer-insight-prompt.json +15 -0
  138. package/dist/init-templates/citizen-builder/metadata/prompts/.mj-sync.json +45 -0
  139. package/dist/init-templates/citizen-builder/metadata/prompts/templates/customer-insight.template.md +18 -0
  140. package/dist/init-templates/citizen-builder/scripts/bootstrap.sh +47 -0
  141. package/dist/init-templates/citizen-builder/scripts/docker-entrypoint.sh +184 -0
  142. package/dist/init-templates/citizen-builder/scripts/generate-capabilities.sh +74 -0
  143. package/dist/init-templates/citizen-builder/scripts/query-run-history.sh +34 -0
  144. package/dist/init-templates/citizen-builder/scripts/sync-metadata.sh +14 -0
  145. package/dist/init-templates/remote-mj/README.md +4 -4
  146. package/dist/lib/claude-pack/ManagedBlockEditor.d.ts +6 -0
  147. package/dist/lib/claude-pack/ManagedBlockEditor.d.ts.map +1 -1
  148. package/dist/lib/claude-pack/ManagedBlockEditor.js +18 -6
  149. package/dist/lib/claude-pack/ManagedBlockEditor.js.map +1 -1
  150. package/dist/lib/claude-pack/PackFetcher.d.ts +8 -3
  151. package/dist/lib/claude-pack/PackFetcher.d.ts.map +1 -1
  152. package/dist/lib/claude-pack/PackFetcher.js +26 -18
  153. package/dist/lib/claude-pack/PackFetcher.js.map +1 -1
  154. package/dist/lib/claude-pack/PackInstaller.d.ts +6 -2
  155. package/dist/lib/claude-pack/PackInstaller.d.ts.map +1 -1
  156. package/dist/lib/claude-pack/PackInstaller.js +19 -13
  157. package/dist/lib/claude-pack/PackInstaller.js.map +1 -1
  158. package/dist/lib/claude-pack/PackMerger.d.ts +8 -0
  159. package/dist/lib/claude-pack/PackMerger.d.ts.map +1 -1
  160. package/dist/lib/claude-pack/PackMerger.js +63 -57
  161. package/dist/lib/claude-pack/PackMerger.js.map +1 -1
  162. package/dist/lib/claude-pack/PackOutputFormatter.d.ts +4 -0
  163. package/dist/lib/claude-pack/PackOutputFormatter.d.ts.map +1 -1
  164. package/dist/lib/claude-pack/PackOutputFormatter.js +10 -2
  165. package/dist/lib/claude-pack/PackOutputFormatter.js.map +1 -1
  166. package/dist/lib/claude-pack/PackPaths.d.ts +12 -0
  167. package/dist/lib/claude-pack/PackPaths.d.ts.map +1 -1
  168. package/dist/lib/claude-pack/PackPaths.js +31 -7
  169. package/dist/lib/claude-pack/PackPaths.js.map +1 -1
  170. package/dist/lib/claude-pack/PackTypes.d.ts +18 -14
  171. package/dist/lib/claude-pack/PackTypes.d.ts.map +1 -1
  172. package/dist/lib/claude-pack/PackTypes.js +11 -3
  173. package/dist/lib/claude-pack/PackTypes.js.map +1 -1
  174. package/dist/lib/claude-pack/SettingsMerger.d.ts +10 -0
  175. package/dist/lib/claude-pack/SettingsMerger.d.ts.map +1 -1
  176. package/dist/lib/claude-pack/SettingsMerger.js +36 -16
  177. package/dist/lib/claude-pack/SettingsMerger.js.map +1 -1
  178. package/dist/lib/cli-plugins.d.ts +2 -0
  179. package/dist/lib/cli-plugins.d.ts.map +1 -1
  180. package/dist/lib/cli-plugins.js +8 -4
  181. package/dist/lib/cli-plugins.js.map +1 -1
  182. package/dist/lib/db-preflight.d.ts +2 -0
  183. package/dist/lib/db-preflight.d.ts.map +1 -1
  184. package/dist/lib/db-preflight.js +12 -8
  185. package/dist/lib/db-preflight.js.map +1 -1
  186. package/dist/lib/db-version.d.ts +2 -0
  187. package/dist/lib/db-version.d.ts.map +1 -1
  188. package/dist/lib/db-version.js +5 -1
  189. package/dist/lib/db-version.js.map +1 -1
  190. package/dist/lib/derived-usage.d.ts +14 -8
  191. package/dist/lib/derived-usage.d.ts.map +1 -1
  192. package/dist/lib/derived-usage.js +30 -18
  193. package/dist/lib/derived-usage.js.map +1 -1
  194. package/dist/lib/domain-profiles.d.ts +4 -2
  195. package/dist/lib/domain-profiles.d.ts.map +1 -1
  196. package/dist/lib/domain-profiles.js +53 -49
  197. package/dist/lib/domain-profiles.js.map +1 -1
  198. package/dist/lib/domain-usage-command.js +4 -4
  199. package/dist/lib/dynamic-packages.d.ts +4 -2
  200. package/dist/lib/dynamic-packages.d.ts.map +1 -1
  201. package/dist/lib/dynamic-packages.js +9 -5
  202. package/dist/lib/dynamic-packages.js.map +1 -1
  203. package/dist/lib/format-compat.d.ts +9 -7
  204. package/dist/lib/format-compat.d.ts.map +1 -1
  205. package/dist/lib/format-compat.js +12 -8
  206. package/dist/lib/format-compat.js.map +1 -1
  207. package/dist/lib/interactive-guard.d.ts +16 -0
  208. package/dist/lib/interactive-guard.d.ts.map +1 -1
  209. package/dist/lib/interactive-guard.js +18 -6
  210. package/dist/lib/interactive-guard.js.map +1 -1
  211. package/dist/lib/migration-fetch.d.ts +16 -4
  212. package/dist/lib/migration-fetch.d.ts.map +1 -1
  213. package/dist/lib/migration-fetch.js +30 -18
  214. package/dist/lib/migration-fetch.js.map +1 -1
  215. package/dist/lib/regression/docker-helpers.d.ts +24 -0
  216. package/dist/lib/regression/docker-helpers.d.ts.map +1 -1
  217. package/dist/lib/regression/docker-helpers.js +46 -10
  218. package/dist/lib/regression/docker-helpers.js.map +1 -1
  219. package/dist/lib/usage-render.d.ts +6 -0
  220. package/dist/lib/usage-render.d.ts.map +1 -1
  221. package/dist/lib/usage-render.js +15 -3
  222. package/dist/lib/usage-render.js.map +1 -1
  223. package/dist/translate-sql/groundTruth.d.ts +3 -3
  224. package/dist/translate-sql/groundTruth.js +40 -40
  225. package/dist/translate-sql/reportGenerator.d.ts +7 -7
  226. package/dist/translate-sql/reportGenerator.js +18 -18
  227. package/dist/translate-sql/ruleTranslator.d.ts +3 -3
  228. package/dist/translate-sql/ruleTranslator.js +8 -8
  229. package/dist/translate-sql/ruleTranslator.js.map +1 -1
  230. package/dist/utils/open-app-context.d.ts +21 -0
  231. package/dist/utils/open-app-context.d.ts.map +1 -1
  232. package/dist/utils/open-app-context.js +26 -10
  233. package/dist/utils/open-app-context.js.map +1 -1
  234. package/oclif.manifest.json +1216 -1058
  235. package/package.json +22 -22
@@ -0,0 +1,259 @@
1
+ # MemberJunction Citizen Agent Builder
2
+
3
+ > **Instructions for AI Coding Agents (Claude Code, Antigravity, Cursor, Codex, Windsurf):**
4
+ > If you are an AI coding agent reading this file, you have been tasked with setting up, authoring, testing, and packaging MemberJunction AI Agents for your user end-to-end.
5
+ > Follow the numbered steps below. You have the tools to run the bash commands, inspect database traces, author declarative metadata, and package the final agent bundle without requiring your user to write code or manage database migrations.
6
+
7
+ ---
8
+
9
+ ## ⚡ Getting Started (Choose Your Path)
10
+
11
+ ### Option A: The Agent-Driven Path (Recommended — Zero Manual Setup)
12
+ You don't need to manually run CLI commands, configure Docker files, or edit JSON files by hand. Simply create a new empty directory, open your favorite AI coding agent (**Claude Code**, **Antigravity**, **Cursor**, **Codex**, or **Windsurf**), and paste this prompt:
13
+
14
+ ```markdown
15
+ Please review the MemberJunction Citizen Agent Builder guide at:
16
+ https://github.com/MemberJunction/MJ/tree/next/citizen-builder
17
+
18
+ Follow the instructions in that guide:
19
+ 1. Initialize a new MemberJunction agent builder workspace here using `npx @memberjunction/cli agent init .`
20
+ 2. Start the local Docker environment and verify services are running.
21
+ 3. Review available entities and actions in CAPABILITIES.md.
22
+ 4. Build me an AI agent that:
23
+ [Describe your business goal here — e.g. "analyzes customer order frequency and overdue invoices, flags accounts at risk of churning, and drafts personalized retention outreach emails."]
24
+ 5. Push the metadata, run test executions, verify the run traces in the database, and package the final distributable bundle for promotion.
25
+ ```
26
+
27
+ Your coding agent will read the guide, scaffold the workspace, start the local database and API, author the declarative agent metadata, test it against local data, and hand you a packaged distribution `.zip` file with an `AGENT_MANIFEST.md` report.
28
+
29
+ ---
30
+
31
+ ### Option B: The Manual / Step-by-Step Path
32
+ If you prefer to initialize the workspace and start the Docker environment yourself before handing off to an agent:
33
+
34
+ 1. **Scaffold the workspace**:
35
+ ```bash
36
+ npx @memberjunction/cli agent init ./my-agents
37
+ cd ./my-agents
38
+ ```
39
+ 2. **Add your LLM API Key**:
40
+ Open `.env` and add your OpenAI, Anthropic, Gemini, or Groq API key:
41
+ ```bash
42
+ OPENAI_API_KEY=sk-...
43
+ ```
44
+ 3. **Start the local Docker stack**:
45
+ ```bash
46
+ docker compose up -d
47
+ ```
48
+ 4. **Launch your coding agent**:
49
+ Open your coding agent in `./my-agents` and tell it what you want to build:
50
+ ```
51
+ "Build me an agent that monitors accounts receivable aging and drafts payment follow-ups."
52
+ ```
53
+ The coding agent will detect `AGENTS.md`, adhere to the 3-tier safety boundaries, and build the agent for you.
54
+
55
+ ---
56
+
57
+ ## 1. Overview & Architecture
58
+
59
+ > **Product Principle:** *Make the human surface simple; keep the agent surface complete.*
60
+ > The business-user experience is a straightforward chat. The agent experience is comprehensive — giving coding agents full machine-readable access to live entity metadata, actions, progressive CLI discovery, diagnostic probes, execution traces, and packaging.
61
+
62
+ The **Citizen Agent Builder** provides an isolated, local MemberJunction environment that runs entirely inside Docker:
63
+ * **`sqlserver` (Port 1433)**: Microsoft SQL Server 2022.
64
+ * **`mj` (Ports 4000 & 4202)**: A Node 24 container that executes `mj install` on first boot, provisions the database schema, installs business context (More Cheese default, or enterprise apps like Blue Cypress), and serves:
65
+ * **MJAPI** at `http://localhost:4000` (GraphQL API and agent execution engine).
66
+ * **MJExplorer** at `http://localhost:4202` (Web UI for testing agents and viewing records; port 4202 is an authorized redirect URI for Auth0/MSAL).
67
+ * **Metadata Directory (`./metadata`)**: Local JSON and Markdown files mapped into the container. Pushing metadata to the database is done with a single command (`./scripts/sync-metadata.sh`).
68
+
69
+ ### Available Agent Tools & CLI Commands
70
+
71
+ Every tool and command in this workspace supports machine-readable output (`--format json`) for autonomous coding agents:
72
+
73
+ | Tool / Command | What It Does |
74
+ |---|---|
75
+ | `./scripts/sync-metadata.sh` | Pushes declarative metadata files in `./metadata/` to the database, resolving `@lookup` and `@file` references. |
76
+ | `./scripts/query-run-history.sh ["<Agent>"\|<ID>]` | Queries agent run history, step execution traces, and action logs via native CLI. |
77
+ | `./scripts/generate-capabilities.sh` | Re-scans the live database and regenerates `CAPABILITIES.md` with current entities and actions. |
78
+ | `docker compose exec -T mj mj doctor --format json` | Runs system diagnostics returning structured checks, failures, and auto-remediations. |
79
+ | `docker compose exec -T mj mj doctor --format json --scope [ai\|runtime\|install]` | Filters diagnostics by specific subsystem (e.g. AI provider credentials or encryption keys). |
80
+ | `docker compose exec -T mj mj ai actions list --format json` | Lists all available system and business actions with parameter schemas. |
81
+ | `docker compose exec -T mj mj ai agents list --format json` | Lists all existing agents, agent types, and categories in the instance. |
82
+ | `docker compose exec -T mj mj ai agents run -a "<Name>" -p "<Input>" --format json` | Executes an agent headlessly and emits structured execution results. |
83
+ | `docker compose exec -T mj mj ai audit agent-run <ID> --format json` | Audits an agent run: step-by-step prompts, LLM completions, token counts, and tool calls. |
84
+
85
+ ---
86
+
87
+ ## 2. Documentation & Architecture References
88
+
89
+ When authoring agents or researching MemberJunction APIs, consult these authoritative resources:
90
+
91
+ ### A. Official Documentation Portal (`docs.memberjunction.org`)
92
+ Use your web search or fetch tools to research topics across the documentation portal:
93
+ * **Documentation Portal**: [https://docs.memberjunction.org/](https://docs.memberjunction.org/)
94
+ * **AI Agents Architecture**: [https://docs.memberjunction.org/ai/](https://docs.memberjunction.org/ai/) — Details on Agent Types (`Flow` deterministic step graphs vs `Loop` iterative tool-calling), Prompt bindings, model selection, execution lifecycles, and sub-agents.
95
+ * **Actions Framework**: [https://docs.memberjunction.org/actions/](https://docs.memberjunction.org/actions/) — Available actions, parameter definitions, and result codes.
96
+ * **Metadata Sync System**: [https://docs.memberjunction.org/developer-guide/metadata-sync/](https://docs.memberjunction.org/developer-guide/metadata-sync/) — Complete specification for declarative metadata files, reference resolution, and upsert mechanics.
97
+ * **Entity Data Platform**: [https://docs.memberjunction.org/concepts/entities/](https://docs.memberjunction.org/concepts/entities/) — Core entities, schema relationships, permissions, and query patterns.
98
+
99
+ ### B. MemberJunction Repository Specifications
100
+ If you have access to the repository (or view them on GitHub at `https://github.com/MemberJunction/MJ/blob/next/`):
101
+ * [`metadata/CLAUDE.md`](https://github.com/MemberJunction/MJ/blob/next/metadata/CLAUDE.md): **The Definitive Metadata Specification**. Rules on `@lookup`, `@file`, `@parent`, native nested JSON objects, and `mj sync push` mechanics.
102
+ * [`packages/Actions/CLAUDE.md`](https://github.com/MemberJunction/MJ/blob/next/packages/Actions/CLAUDE.md): Action authoring conventions and parameter schemas.
103
+ * [`packages/AI/README.md`](https://github.com/MemberJunction/MJ/blob/next/packages/AI/README.md): AI Agent execution engine, state machines, and task graph dispatcher.
104
+
105
+ ---
106
+
107
+ ## 3. Step-by-Step Execution Guide for Coding Agents
108
+
109
+ ### Step 1: Initialize & Start the Environment
110
+
111
+ 1. **Verify Docker Status**:
112
+ Run `docker info` in the terminal.
113
+ * If running: proceed.
114
+ * If on macOS and Docker Desktop is stopped, run `open -a Docker` and wait 15–20 seconds for the daemon to start.
115
+ * If Docker is not installed, provide your user with the installation link: `https://www.docker.com/products/docker-desktop` (or `brew install --cask docker`).
116
+
117
+ 2. **Configure Environment Variables**:
118
+ If `.env` does not exist, copy `.env.example` to `.env`:
119
+ ```bash
120
+ cp .env.example .env
121
+ ```
122
+ Ask the user to supply their LLM API key (e.g. `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GEMINI_API_KEY`) and set it in `.env`.
123
+
124
+ 3. **Start the Stack**:
125
+ Run:
126
+ ```bash
127
+ docker compose up -d
128
+ ```
129
+ *On first start, the container runs `mj install`, applies core migrations, installs the business context app (More Cheese), and launches both MJAPI and MJExplorer.*
130
+ Monitor startup until ready:
131
+ ```bash
132
+ docker compose logs -f mj
133
+ ```
134
+ Once the banner appears:
135
+ * **MJAPI is live at**: `http://localhost:4000`
136
+ * **MJExplorer is live at**: `http://localhost:4202`
137
+
138
+ ---
139
+
140
+ ### Step 2: Understand the 3-Tier Boundary & Guardrails
141
+
142
+ Always enforce these constraints when authoring agents:
143
+
144
+ | Tier | Classification | What You May Author | Human Approval Needed? |
145
+ |---|---|---|---|
146
+ | **Tier 1** | **Declarative Only** | Flows, Loops, prompts, step mappings, action bindings, and sub-agent composition. | No — auto-promotable |
147
+ | **Tier 2** | **Runtime Code** | Sandboxed JavaScript **Runtime Actions** with explicit permission scopes. | Yes — admin code review |
148
+ | **Tier 3** | **Schema Changes** | New database tables, columns, migrations, or entity CodeGen. | **Strictly Off-Limits** |
149
+
150
+ #### Mandatory Defaults:
151
+ 1. **`ModelSelectionMode: "Agent Type"`**: Never hardcode specific provider models (`gpt-4o`, `claude-3-5-sonnet`). The destination environment maps models to Agent Types.
152
+ 2. **`ExposeAsAction: false`**: Do not set `true` unless the user explicitly wants other agents to call this agent as an action.
153
+ 3. **Dynamic Record Resolution**: Never hardcode record IDs or personal names. Use queries, parameters, or lookup actions.
154
+ 4. **Prefer `Flow` Agents**: Use `Flow` agents for predictable step-by-step tasks. Use `Loop` only for dynamic problem-solving with open-ended tool calling.
155
+
156
+ ---
157
+
158
+ ### Step 3: The Authoring Loop
159
+
160
+ 1. **Check Available Tools & Entities**:
161
+ Review `CAPABILITIES.md` (or run `./scripts/generate-capabilities.sh` to update it). This file contains the exact entity names, fields, and available actions in the running instance.
162
+
163
+ 2. **Metadata Formatting Rules (CRITICAL)**:
164
+ * **Native JSON Objects**: Fields storing JSON (such as `Configuration` or `Settings`) **MUST** be written as clean, native nested JSON objects. **NEVER** write escaped JSON strings (`"Configuration": "{\"Steps\":...}"`), as this breaks `@lookup` reference resolution!
165
+ * **No `sync` Blocks**: Do not author `sync` blocks (`lastModified`, `checksum`). `mj sync push` manages these automatically.
166
+ * **Assign Deterministic UUIDs**: Assign a fresh uppercase UUID for `primaryKey` (e.g. via CLI `uuidgen | tr '[:lower:]' '[:upper:]'`).
167
+ * **Use Dynamic References**:
168
+ - `@lookup:<EntityName>.<FieldName>=<Value>` for foreign keys (e.g. `@lookup:MJ: AI Agent Types.Name=Flow`).
169
+ - `@file:<relativePath>` for external template files (e.g. `@file:templates/<slug>.template.md`). Note that `@file:` paths are resolved at push time; running `./scripts/sync-metadata.sh` updates the database.
170
+ - `@parent:ID` for linking child records to parent records in nested structures.
171
+
172
+ 3. **Author Files**:
173
+ * Prompt Markdown template: `metadata/prompts/templates/<slug>.template.md`
174
+ * Prompt metadata JSON: `metadata/prompts/.<slug>-prompt.json`
175
+ * Agent metadata JSON: `metadata/agents/.<slug>-agent.json`
176
+ *(See `metadata/agents/.customer-insight-agent.json` for a reference Flow agent).*
177
+
178
+ 4. **Push to Local Database**:
179
+ ```bash
180
+ ./scripts/sync-metadata.sh
181
+ ```
182
+
183
+ ---
184
+
185
+ ### Step 4: Testing & Autonomous Diagnostics (The Dual Loop)
186
+
187
+ 1. **Interactive Testing (Explorer UI)**:
188
+ Invite the user to test in their browser at `http://localhost:4202`.
189
+
190
+ 2. **Headless Execution**:
191
+ You can trigger test runs directly via CLI with structured output:
192
+ ```bash
193
+ docker compose exec -T mj mj ai agents run -a "<Agent Name>" -p "<Test Input>" --format json
194
+ ```
195
+
196
+ 3. **Diagnosing Errors & Auditing Execution Traces**:
197
+ When an agent runs, **do not ask the user for console logs**. Audit execution traces directly via native CLI:
198
+ ```bash
199
+ # List recent runs for this agent
200
+ ./scripts/query-run-history.sh "<Agent Name>"
201
+
202
+ # View full machine-readable JSON trace for a specific run ID
203
+ ./scripts/query-run-history.sh <RunID> --format json
204
+
205
+ # Or drill down into specific steps or errors
206
+ ./scripts/query-run-history.sh <RunID> --step 1 --detail full
207
+ ./scripts/query-run-history.sh <RunID> --errors
208
+ ```
209
+
210
+ **Trace Verification Assertions**:
211
+ * Verify that `actionsUsed` matches expected actions and tools.
212
+ * Verify that `actionsNotUsed` contains sensitive or dangerous actions.
213
+ * Check step prompts, outputs, and token counts to spot prompt drift or infinite loops.
214
+
215
+ Analyze the trace, refine your prompt template or mapping, run `./scripts/sync-metadata.sh`, and re-test.
216
+
217
+ ---
218
+
219
+ ### Step 5: Packaging for Promotion
220
+
221
+ When the user is satisfied, package the agent for promotion to staging or production:
222
+
223
+ 1. Validate that all Tier 1 guardrails are met (no secrets, no hardcoded IDs, `ModelSelectionMode: "Agent Type"`).
224
+ 2. Query the last successful run metrics using `./scripts/query-run-history.sh "<Agent Name>"`.
225
+ 3. Generate `AGENT_MANIFEST.md` detailing:
226
+ * Agent Name, Purpose, and Author.
227
+ * Tier Classification (Tier 1 vs Tier 2).
228
+ * Data Footprint (Entities Read vs Entities Written).
229
+ * Bound Tools and Actions.
230
+ * Sample Execution Trace Receipt.
231
+ 4. Create the distribution archive:
232
+ ```bash
233
+ mkdir -p dist
234
+ zip -r "dist/<agent-slug>-package.zip" \
235
+ AGENT_MANIFEST.md \
236
+ metadata/agents/.*"<agent-slug>"*.json \
237
+ metadata/prompts/.*"<agent-slug>"*.json \
238
+ metadata/prompts/templates/"<agent-slug>"*.md
239
+ ```
240
+ 5. Give the user the path to `dist/<agent-slug>-package.zip` and explain how their platform admin can review and deploy it (see `docs/PROMOTION_GUIDE.md`).
241
+
242
+ ---
243
+
244
+ ## 4. Enterprise Organization Setup (e.g. Blue Cypress)
245
+
246
+ By default, the builder runs against **More Cheese** (a rich synthetic dataset covering 9 business apps).
247
+
248
+ To build agents against your organization's **real schemas and synthetic records** (e.g. **Blue Cypress / BC**):
249
+ 1. In `.env`, set:
250
+ ```bash
251
+ OPEN_APP_INSTALL_URL=https://github.com/BlueCypress/bc-sampledata
252
+ GITHUB_TOKEN=ghp_yourReadOnlyTokenHere
253
+ ```
254
+ 2. Restart the container:
255
+ ```bash
256
+ docker compose down -v && docker compose up -d
257
+ ```
258
+ 3. Run `./scripts/generate-capabilities.sh` to refresh `CAPABILITIES.md` with your organization's custom entities and actions.
259
+ 👉 For complete enterprise details, see [docs/ENTERPRISE_ORG_SETUP.md](docs/ENTERPRISE_ORG_SETUP.md).
@@ -0,0 +1,16 @@
1
+ FROM node:24-bullseye
2
+
3
+ # Install essential native build dependencies and git
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ git \
6
+ curl \
7
+ build-essential \
8
+ procps \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Install MemberJunction CLI and process manager globally
12
+ RUN npm install -g @memberjunction/cli pm2 pnpm
13
+
14
+ WORKDIR /workspace
15
+
16
+ EXPOSE 4000 4200
@@ -0,0 +1,59 @@
1
+ name: mj-citizen-builder
2
+
3
+ services:
4
+ sqlserver:
5
+ image: mcr.microsoft.com/mssql/server:2022-latest
6
+ platform: linux/amd64
7
+ restart: unless-stopped
8
+ environment:
9
+ ACCEPT_EULA: "Y"
10
+ MSSQL_SA_PASSWORD: "${DB_PASSWORD:-TestPassword123!}"
11
+ ports:
12
+ - "${DB_PORT:-1433}:1433"
13
+ healthcheck:
14
+ test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$$MSSQL_SA_PASSWORD" -Q "SELECT 1" -C -No
15
+ interval: 10s
16
+ timeout: 5s
17
+ retries: 15
18
+ start_period: 20s
19
+ volumes:
20
+ - sqlserver-data:/var/opt/mssql
21
+
22
+ mj:
23
+ build:
24
+ context: .
25
+ dockerfile: docker/Dockerfile
26
+ platform: linux/amd64
27
+ restart: unless-stopped
28
+ depends_on:
29
+ sqlserver:
30
+ condition: service_healthy
31
+ ports:
32
+ - "${API_PORT:-4000}:4000"
33
+ - "${EXPLORER_PORT:-4202}:4200"
34
+ environment:
35
+ DB_HOST: "sqlserver"
36
+ DB_PORT: "1433"
37
+ DB_USERNAME: "sa"
38
+ DB_PASSWORD: "${DB_PASSWORD:-TestPassword123!}"
39
+ DB_DATABASE: "${DB_DATABASE:-MemberJunction}"
40
+ MJ_BASE_ENCRYPTION_KEY: "${MJ_BASE_ENCRYPTION_KEY:-0123456789abcdef0123456789abcdef}"
41
+ # LLM Provider API Keys
42
+ AI_VENDOR_API_KEY__OpenAILLM: "${OPENAI_API_KEY:-}"
43
+ AI_VENDOR_API_KEY__AnthropicLLM: "${ANTHROPIC_API_KEY:-}"
44
+ AI_VENDOR_API_KEY__GeminiLLM: "${GEMINI_API_KEY:-}"
45
+ AI_VENDOR_API_KEY__GroqLLM: "${GROQ_API_KEY:-}"
46
+ AI_VENDOR_API_KEY__MistralLLM: "${MISTRAL_API_KEY:-}"
47
+ # Business Context Open App (More Cheese default or custom enterprise app)
48
+ OPEN_APP_INSTALL_URL: "${OPEN_APP_INSTALL_URL:-https://github.com/MemberJunction/more-cheese}"
49
+ GITHUB_TOKEN: "${GITHUB_TOKEN:-}"
50
+ volumes:
51
+ - mj-workspace:/workspace
52
+ - ./metadata:/work/metadata
53
+ - ./scripts:/work/scripts
54
+ - ./dist:/work/dist
55
+ entrypoint: ["/bin/bash", "/work/scripts/docker-entrypoint.sh"]
56
+
57
+ volumes:
58
+ sqlserver-data:
59
+ mj-workspace:
@@ -0,0 +1,73 @@
1
+ # Enterprise Organization Setup: Real Schemas & Business Context
2
+
3
+ This document explains how enterprise organizations—such as **Blue Cypress (BC)**—configure the MemberJunction Citizen Agent Builder so business users build agents against their **real entity schemas and business relationships** instead of generic defaults.
4
+
5
+ ---
6
+
7
+ ## 1. The Two-App Architecture
8
+
9
+ To provide an accurate, realistic authoring environment without exposing production customer data to personal machines, organizations publish two Open Apps:
10
+
11
+ | Application | Description | Carries |
12
+ |---|---|---|
13
+ | **`<org>-platform`** (e.g. `bc-platform`) | Core schema & business logic | Custom entities, fields, relationships, standard actions, and queries. |
14
+ | **`<org>-sampledata`** (e.g. `bc-sampledata`) | Realistic synthetic data | Loom-generated synthetic records mirroring production shapes and relational integrity. Depends on `<org>-platform`. |
15
+
16
+ When a citizen builder boots their environment and installs `<org>-sampledata`, MemberJunction's Open App dependency engine automatically resolves and installs `<org>-platform` leaf-first.
17
+
18
+ ### Why This Model Works:
19
+ 1. **Identical Entity Shapes:** Entity and field names match production exactly. An agent written against `bc-sampledata` works on production without renaming a single field or query.
20
+ 2. **Zero PII Risk:** The data is 100% synthetic by construction. Compliance and security reviews pass automatically.
21
+ 3. **Seamless Promotion:** Promotion is simply deploying the agent's metadata to the production instance; no code rewrites or schema remapping are needed.
22
+
23
+ ---
24
+
25
+ ## 2. Configuration for Citizen Builders
26
+
27
+ ### Option A: Private GitHub Repository Access (Recommended)
28
+ If your organization hosts `<org>-sampledata` in a private GitHub organization (e.g. `github.com/BlueCypress/`):
29
+
30
+ 1. Provide the user with a fine-grained, read-only GitHub Personal Access Token (PAT) with `Contents: Read` permission on the sample data and platform repositories.
31
+ 2. In the user's `.env`:
32
+ ```bash
33
+ # Enterprise Open App Target
34
+ OPEN_APP_INSTALL_URL=https://github.com/BlueCypress/bc-sampledata
35
+
36
+ # Read-only GitHub PAT for private repo authentication
37
+ GITHUB_TOKEN=ghp_exampleTokenWithReadOnlyAccess
38
+ ```
39
+ 3. Run the bootstrap script:
40
+ ```bash
41
+ docker compose exec api /work/scripts/bootstrap.sh
42
+ ```
43
+
44
+ ### Option B: Local Directory Mount (Zero Token)
45
+ If the user or team already has a local checkout of the platform app on their machine:
46
+ 1. Create a `docker-compose.override.yml`:
47
+ ```yaml
48
+ services:
49
+ api:
50
+ volumes:
51
+ - /path/to/local/bc-platform:/work/apps/bc-platform:ro
52
+ ```
53
+ 2. Run `mj app install /work/apps/bc-platform` inside the container.
54
+
55
+ ---
56
+
57
+ ## 3. Automated Capabilities Cataloging
58
+
59
+ Once your organization's Open App is installed, run:
60
+ ```bash
61
+ ./scripts/generate-capabilities.sh
62
+ ```
63
+ This queries your local database's entity and action catalogs to update `CAPABILITIES.md`. Your coding agent immediately learns every custom entity, field, and action specific to your company (e.g. `BC: Association Members`, `BC: Committee Terms`, `BC: Invoices`).
64
+
65
+ ---
66
+
67
+ ## 4. Packaging and Upstream Release of Sample Data
68
+
69
+ When updating your organization's synthetic dataset:
70
+ 1. Generate synthetic records using Loom.
71
+ 2. Push them to a staging database using `mj sync push`.
72
+ 3. Capture the differential SQL emitted by `packages/MetadataSync/src/lib/sql-logger.ts` as the next `V<timestamp>__v<version>_Metadata_Sync.sql` migration in `<org>-sampledata`.
73
+ 4. Publish a release of `<org>-sampledata`. All citizen builders will receive the updated synthetic records on their next bootstrap.
@@ -0,0 +1,70 @@
1
+ # Promotion & Governance Guide: Reviewing Packaged Agents
2
+
3
+ This guide is for MemberJunction platform administrators, team leads, and review boards responsible for evaluating and deploying agents authored via the Citizen Agent Builder.
4
+
5
+ ---
6
+
7
+ ## 1. What Arrives at Promotion
8
+
9
+ A citizen builder submits an export archive (e.g. `dist/InvoiceAuditAgent-package.zip`), which contains:
10
+
11
+ 1. **`AGENT_MANIFEST.md`**: An executive summary describing:
12
+ - What the agent does and who built it.
13
+ - Classification: **Tier 1 (Declarative)** vs **Tier 2 (Runtime Action)**.
14
+ - Data Footprint: Explicit list of entities read and entities modified.
15
+ - Sample Execution Receipt: Verification trace from a test run.
16
+ 2. **Metadata Files**:
17
+ - `metadata/agents/.*<name>*.json`
18
+ - `metadata/prompts/.*<name>*.json`
19
+ - `metadata/prompts/templates/<name>*.md`
20
+ - (If Tier 2) `metadata/actions/.*<name>*.json`
21
+
22
+ ---
23
+
24
+ ## 2. The Review Process
25
+
26
+ ### Tier 1 (Declarative Agents) — Fast Track (5-Minute Review)
27
+ Tier 1 agents contain **zero executable code** and **zero schema changes**. Reviewing them is straightforward:
28
+
29
+ 1. **Check Defaults in Manifest**:
30
+ - `ModelSelectionMode` is `"Agent Type"` (no hardcoded models).
31
+ - `ExposeAsAction` is `false` (unless a valid business rationale is documented).
32
+ 2. **Scan Prompts**:
33
+ - Verify no credentials, tokens, or raw SQL queries are embedded in prompt templates.
34
+ - Verify no hardcoded record IDs or personal names are used.
35
+ 3. **Approve**:
36
+ - Tier 1 submissions that satisfy these checks can be approved and imported immediately.
37
+
38
+ ### Tier 2 (Runtime Actions) — Code Review Gate
39
+ Tier 2 agents include custom JavaScript actions running in the MemberJunction sandboxed runtime:
40
+
41
+ 1. **Review JavaScript Logic**:
42
+ - Inspect the code inside the action's metadata definition.
43
+ - Ensure the logic is deterministic, handles errors, and contains no obfuscated operations or network calls.
44
+ 2. **Review & Narrow Permissions**:
45
+ - Verify that `allowedEntities` is an explicit, minimal list of required entities.
46
+ - **Reject any submission with `allowAnyEntity: true` or wildcard entity grants.**
47
+ 3. **Decide Graduation**:
48
+ - **Keep as Runtime Action**: Approve the action metadata for deployment as sandboxed JS.
49
+ - **Promote to Package**: If the action is mission-critical or widely reused, have an engineer reimplement it as a strongly-typed TypeScript action in an `@mj-biz-apps/*` package.
50
+
51
+ ---
52
+
53
+ ## 3. Deploying the Agent
54
+
55
+ ### Option 1: Commit to the Organization's Platform Repo (Recommended)
56
+ 1. Extract the metadata files into your organization's repository (e.g. `bc-platform/metadata/`).
57
+ 2. Commit and push the changes:
58
+ ```bash
59
+ git add metadata/
60
+ git commit -m "feat(agents): add InvoiceAuditAgent from citizen builder"
61
+ git push
62
+ ```
63
+ 3. Your CI/CD deployment pipeline will push the metadata to staging and production.
64
+
65
+ ### Option 2: Direct Sync Push to Target Instance
66
+ If deploying directly to a staging or production instance via CLI:
67
+ ```bash
68
+ mj sync push --dir /path/to/extracted/metadata
69
+ ```
70
+ The agent is now active and ready for end users.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": "1.0",
3
+ "directories": [
4
+ "agents",
5
+ "prompts"
6
+ ]
7
+ }
@@ -0,0 +1,55 @@
1
+ [
2
+ {
3
+ "fields": {
4
+ "Name": "Customer Insight Specialist",
5
+ "CategoryID": "@lookup:MJ: AI Agent Categories.Name=Assistant",
6
+ "Description": "Deterministic flow agent that summarizes customer activity, evaluates account standing, and suggests next actions.",
7
+ "TypeID": "@lookup:MJ: AI Agent Types.Name=Flow",
8
+ "Status": "Active",
9
+ "ExecutionOrder": 0,
10
+ "ExposeAsAction": false,
11
+ "IconClass": "mj-icon-user-check",
12
+ "ArtifactCreationMode": "None",
13
+ "PayloadDownstreamPaths": "*",
14
+ "PayloadUpstreamPaths": "*",
15
+ "EnableContextCompression": false,
16
+ "ModelSelectionMode": "Agent Type"
17
+ },
18
+ "relatedEntities": {
19
+ "MJ: AI Agent Prompts": [
20
+ {
21
+ "fields": {
22
+ "AgentID": "@parent:ID",
23
+ "PromptID": "@lookup:MJ: AI Prompts.Name=Customer Insight Specialist Prompt",
24
+ "Status": "Active",
25
+ "ExecutionOrder": 1
26
+ },
27
+ "primaryKey": {
28
+ "ID": "E9A0C381-645F-4D2A-883F-E19C69D3B511"
29
+ }
30
+ }
31
+ ],
32
+ "MJ: AI Agent Steps": [
33
+ {
34
+ "fields": {
35
+ "AgentID": "@parent:ID",
36
+ "Name": "Generate Customer Insights",
37
+ "Description": "Evaluates account data using the Customer Insight Specialist Prompt",
38
+ "StepType": "Prompt",
39
+ "StartingStep": true,
40
+ "PromptID": "@lookup:MJ: AI Prompts.Name=Customer Insight Specialist Prompt",
41
+ "Status": "Active",
42
+ "PositionX": 100,
43
+ "PositionY": 100
44
+ },
45
+ "primaryKey": {
46
+ "ID": "D2E49B18-091A-4832-B81E-A38C91307D55"
47
+ }
48
+ }
49
+ ]
50
+ },
51
+ "primaryKey": {
52
+ "ID": "A7F01234-8899-4A1B-89E2-7722BCDEF001"
53
+ }
54
+ }
55
+ ]
@@ -0,0 +1,45 @@
1
+ {
2
+ "entity": "MJ: AI Agents",
3
+ "filePattern": "**/.*.json",
4
+ "defaults": {
5
+ "TypeID": "@lookup:MJ: AI Agent Types.Name=Flow",
6
+ "ModelSelectionMode": "Agent Type",
7
+ "ExposeAsAction": false,
8
+ "Status": "Active"
9
+ },
10
+ "pull": {
11
+ "createNewFileIfNotFound": true,
12
+ "newFileName": ".agents.json",
13
+ "appendRecordsToExistingFile": true,
14
+ "updateExistingRecords": true,
15
+ "preserveFields": [],
16
+ "excludeFields": [],
17
+ "mergeStrategy": "merge",
18
+ "backupBeforeUpdate": true,
19
+ "backupDirectory": ".backups",
20
+ "lookupFields": {
21
+ "TypeID": {
22
+ "entity": "MJ: AI Agent Types",
23
+ "field": "Name"
24
+ },
25
+ "CategoryID": {
26
+ "entity": "MJ: AI Agent Categories",
27
+ "field": "Name"
28
+ }
29
+ },
30
+ "relatedEntities": {
31
+ "MJ: AI Agent Prompts": {
32
+ "entity": "MJ: AI Agent Prompts",
33
+ "foreignKey": "AgentID"
34
+ },
35
+ "MJ: AI Agent Actions": {
36
+ "entity": "MJ: AI Agent Actions",
37
+ "foreignKey": "AgentID"
38
+ },
39
+ "MJ: AI Agent Steps": {
40
+ "entity": "MJ: AI Agent Steps",
41
+ "foreignKey": "AgentID"
42
+ }
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,15 @@
1
+ [
2
+ {
3
+ "fields": {
4
+ "Name": "Customer Insight Specialist Prompt",
5
+ "Description": "Analyzes customer profile data and recent orders to provide executive account insights.",
6
+ "CategoryID": "@lookup:MJ: AI Prompt Categories.Name=Agent Type System Prompts",
7
+ "TypeID": "@lookup:MJ: AI Prompt Types.Name=Chat",
8
+ "Status": "Active",
9
+ "TemplateText": "@file:templates/customer-insight.template.md"
10
+ },
11
+ "primaryKey": {
12
+ "ID": "B1C90D1A-9321-4E18-912A-6844917B3C10"
13
+ }
14
+ }
15
+ ]
@@ -0,0 +1,45 @@
1
+ {
2
+ "entity": "MJ: AI Prompts",
3
+ "filePattern": "**/.*.json",
4
+ "defaults": {
5
+ "CategoryID": "@lookup:MJ: AI Prompt Categories.Name=Agent Type System Prompts?create&Description=Prompts for Custom Agents",
6
+ "TypeID": "@lookup:MJ: AI Prompt Types.Name=Chat"
7
+ },
8
+ "ignoreDirectories": [
9
+ "output",
10
+ "templates"
11
+ ],
12
+ "pull": {
13
+ "createNewFileIfNotFound": true,
14
+ "newFileName": ".prompts.json",
15
+ "appendRecordsToExistingFile": true,
16
+ "updateExistingRecords": true,
17
+ "ignoreNullFields": true,
18
+ "ignoreVirtualFields": true,
19
+ "preserveFields": [
20
+ "TemplateText"
21
+ ],
22
+ "excludeFields": [
23
+ "TemplateID"
24
+ ],
25
+ "mergeStrategy": "merge",
26
+ "backupBeforeUpdate": true,
27
+ "backupDirectory": ".backups",
28
+ "externalizeFields": [
29
+ {
30
+ "field": "TemplateText",
31
+ "pattern": "@file:templates/{Name}.template.md"
32
+ }
33
+ ],
34
+ "lookupFields": {
35
+ "CategoryID": {
36
+ "entity": "MJ: AI Prompt Categories",
37
+ "field": "Name"
38
+ },
39
+ "TypeID": {
40
+ "entity": "MJ: AI Prompt Types",
41
+ "field": "Name"
42
+ }
43
+ }
44
+ }
45
+ }