@descix/cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/README.md +95 -0
  2. package/SERVICE_README_sdk.md +399 -0
  3. package/agent-assets/guides/README.md +61 -0
  4. package/agent-assets/guides/dynamic-site-pattern.md +125 -0
  5. package/agent-assets/guides/knowledge-only-pattern.md +93 -0
  6. package/agent-assets/guides/microservice-pattern.md +152 -0
  7. package/agent-assets/guides/static-site-pattern.md +111 -0
  8. package/agent-assets/instructions/app-asset-validation.md +477 -0
  9. package/agent-assets/instructions/onboarding-flow.md +408 -0
  10. package/agent-assets/instructions/standard-folder-structure.md +125 -0
  11. package/agent-assets/reference/app-creation.md +381 -0
  12. package/agent-assets/reference/architecture.md +406 -0
  13. package/agent-assets/reference/local-dev.md +138 -0
  14. package/agent-assets/reference/mcp-integration.md +424 -0
  15. package/agent-assets/reference/workspace-config.md +415 -0
  16. package/agent-assets/rules/descix_mcp.template.mdc +243 -0
  17. package/bin/descix.js +3930 -0
  18. package/bin/mcp-server.js +382 -0
  19. package/descix-cli-1.0.0.tgz +0 -0
  20. package/lib/agent-files.js +162 -0
  21. package/lib/api-client.js +458 -0
  22. package/lib/auth-guard.js +67 -0
  23. package/lib/commands/app-wizard.js +627 -0
  24. package/lib/commands/auth.js +407 -0
  25. package/lib/commands/buy.js +207 -0
  26. package/lib/commands/clone.js +91 -0
  27. package/lib/commands/config.js +155 -0
  28. package/lib/commands/doctor.js +277 -0
  29. package/lib/commands/folder.js +291 -0
  30. package/lib/commands/init.js +257 -0
  31. package/lib/commands/kb.js +654 -0
  32. package/lib/commands/mcp.js +273 -0
  33. package/lib/commands/serve.js +12 -0
  34. package/lib/commands/status.js +239 -0
  35. package/lib/commands/update.js +653 -0
  36. package/lib/core/Chunker.js +610 -0
  37. package/lib/core/Hydrator.js +801 -0
  38. package/lib/core/PathContext.js +335 -0
  39. package/lib/core/Syncer.js +310 -0
  40. package/lib/core/index.js +32 -0
  41. package/lib/global-config.js +86 -0
  42. package/lib/google-storage-adc.js +511 -0
  43. package/lib/wallet-file.js +232 -0
  44. package/lib/wizard/setup.js +502 -0
  45. package/lib/workspace-config.js +712 -0
  46. package/lib/workspace-utils.js +126 -0
  47. package/package.json +41 -0
  48. package/templates/agent-claude.md +226 -0
  49. package/templates/agent-cline.md +133 -0
  50. package/templates/agent-copilot.md +133 -0
  51. package/templates/agent-cursor.md +133 -0
  52. package/templates/descix_mcp.mdc +122 -0
  53. package/templates/drive/README.md +42 -0
  54. package/templates/drive/app/assets/app_description.md +13 -0
  55. package/templates/drive/app/assets/icon.png +0 -0
  56. package/templates/drive/app/assets/system_instructions.md +17 -0
  57. package/templates/drive/app/kb/General/README.md +25 -0
  58. package/templates/drive/community/Apps/.gitkeep +4 -0
  59. package/templates/drive/community/community_assets/community_description.md +15 -0
  60. package/templates/drive/community/community_assets/icon.png +0 -0
  61. package/templates/drive_templates/README.md +104 -0
  62. package/templates/drive_templates/agent_app_template/assets/app_description.txt +13 -0
  63. package/templates/drive_templates/agent_app_template/assets/system_instructions.txt +17 -0
  64. package/templates/drive_templates/agent_app_template/kb/General/README.md +25 -0
  65. package/templates/drive_templates/agent_app_template/microservice/.gitkeep +10 -0
  66. package/templates/drive_templates/agent_app_template/site/.gitkeep +4 -0
  67. package/templates/drive_templates/community_template/Apps/.gitkeep +4 -0
  68. package/templates/drive_templates/community_template/community_assets/community_description.txt +15 -0
  69. package/templates/scaffolds/README.md +62 -0
  70. package/templates/scaffolds/microservice/Dockerfile +19 -0
  71. package/templates/scaffolds/microservice/SERVICE_README_sdk.md +399 -0
  72. package/templates/scaffolds/microservice/app.js +50 -0
  73. package/templates/scaffolds/microservice/app.yaml +8 -0
  74. package/templates/scaffolds/microservice/defaults-config.json +5 -0
  75. package/templates/scaffolds/microservice/dev-overrides.json.example +5 -0
  76. package/templates/scaffolds/microservice/manifest.json +49 -0
  77. package/templates/scaffolds/microservice/package-lock.json +2645 -0
  78. package/templates/scaffolds/microservice/package.json +29 -0
  79. package/templates/scaffolds/microservice/scripts/register.js +55 -0
  80. package/templates/scaffolds/microservice/services/apiFront.js +75 -0
  81. package/templates/scaffolds/microservice/services/commandHandlers/sampleCommands.js +57 -0
  82. package/templates/scaffolds/microservice/services/mcpClient.js +78 -0
  83. package/templates/scaffolds/microservice/services/utils.js +247 -0
  84. package/templates/scaffolds/microservice/setup-schema.json +18 -0
  85. package/templates/scaffolds/microservice/templates/SERVICE_README_TEMPLATE.md +143 -0
  86. package/templates/scaffolds/site/DeSciXAppSDK.js +62 -0
  87. package/templates/scaffolds/site/README.md +51 -0
  88. package/templates/scaffolds/site/app.js +22 -0
  89. package/templates/scaffolds/site/index.html +42 -0
  90. package/templates/scaffolds/site/styles.css +123 -0
  91. package/test-hydration.js +150 -0
  92. package/vendor/mcp/transports/http-sse-transport.js +196 -0
  93. package/vendor/mcp/transports/index.js +15 -0
  94. package/vendor/mcp/transports/stdio-transport.js +118 -0
@@ -0,0 +1,133 @@
1
+ # DeSciX App Development
2
+
3
+ <!-- BOOTSTRAP: Auto-generated. Update this file as you learn the project. -->
4
+
5
+ ## First Action
6
+
7
+ Call `descix_doctor` MCP tool to check auth, workspace, and available tools.
8
+
9
+ ## Platform
10
+
11
+ DeSciX is a virtual university for knowledge-powered apps. Communities are
12
+ departments, apps are courses/textbooks/services. You are the primary
13
+ interface — guide the user to explore, build, or discover.
14
+
15
+ ## Pre-Step 0: Check for Invite Config
16
+
17
+ Before scanning the repo, check if `.descix/app.json` exists.
18
+
19
+ If it does:
20
+ 1. Read it — extract `app_id`, `community_id`, `agent_hint`, `kb_ready`, `has_repo`
21
+ 2. If it contains `invite_token`, call `resolve_invite` with that token to get live context
22
+ 3. **Read `agent_hint` carefully** — it was written by the app creator specifically for you.
23
+ It describes this user's skill level and goals. Let it override default checkpoints.
24
+ For example, if the hint says "no coding background", do not ask technical questions.
25
+ 4. If `kb_ready` is true, skip KB setup and demonstrate value immediately:
26
+ `descix chat -a <app_id> "What is this about?"` — show the user what the AI knows
27
+ 5. If `kb_ready` is false, skip the chat demo — the KB is not populated yet.
28
+ Proceed to setup (`descix init`, `app init`, `update kb`), then demo afterward.
29
+ Frame it as: "Let's get this set up so you can start exploring."
30
+ 6. If `has_repo` is true and no source code is present locally, offer `descix clone -a <app_id>`.
31
+ For non-technical users (infer from `agent_hint`): "Want to run this on your own machine?"
32
+ For developers: "I'll clone the source code so you can build on it."
33
+ 7. If `app.json` contains `api_url`, use it as the backend target — skip Checkpoint 3 (environment).
34
+ 8. After the demo and clone, check if `workspace.json` exists. If not, run standard setup
35
+ (`descix init`, `app init`). If it does, setup is already done — proceed to development.
36
+ 9. If `descix_doctor` shows an existing workspace with a **different** `app_id` than the invite,
37
+ ask the user: "You have an existing workspace for [X]. Add the invited app, or switch context?"
38
+
39
+ **Important:** If `app.json` is present, Step 0's empty-repo detection does NOT mean "scaffold from scratch."
40
+ The project context comes from the invite, not the file structure.
41
+
42
+ ## Step 0: Scan the Repo
43
+
44
+ Before asking questions, list the working directory and check for:
45
+ - Existing content: `docs/`, `src/`, `README.md`, `package.json`
46
+ - Existing DeSciX structure: `kb/`, `site/`, `microservice/`, `.descix/`
47
+ - Existing frameworks: `vite.config.*`, `next.config.*`, `tsconfig.json`
48
+
49
+ Tailor your questions based on what you find (e.g., offer to use existing docs
50
+ as KB, configure an existing site, skip starter content if KB is already populated).
51
+
52
+ ## Setup Workflow (if doctor reports setup_needed)
53
+
54
+ Ask the user at each checkpoint — don't assume:
55
+
56
+ 1. **Objective:** "Explore existing apps or build something new?"
57
+ 2. **Community/App:** Use `find_communities` + `list_apps_for_community`, then ask which to target
58
+ 3. **Environment:** "Local dev (localhost:4000) or hosted API?" (Skip if `app.json` has `api_url`)
59
+
60
+ Canonical setup commands:
61
+ ```bash
62
+ descix whoami # confirm identity
63
+ descix app list # see available apps
64
+ descix init -c <community> -a <app> -p . # create workspace.json
65
+ descix app init -a <app> -c <community> # register app on platform
66
+ ```
67
+
68
+ 4. **Content strategy:** "Create starter KB now or wait for your docs?"
69
+ 5. **Frontend scope:** "Plain HTML or a framework (React, VitePress)?"
70
+
71
+ ## Important: Use Explicit Flags
72
+
73
+ Always use `-c <community> -a <app>` for all commands until verified:
74
+ ```bash
75
+ descix chat -c <community> -a <app> -q "..."
76
+ descix update kb -c <community> -a <app>
77
+ ```
78
+
79
+ ## Success Criteria
80
+
81
+ - App visible in `descix app list`
82
+ - KB sync succeeds: `descix update kb -c <community> -a <app>`
83
+ - Chat returns response: `descix chat -c <community> -a <app> -q "test"`
84
+
85
+ ## Local Development
86
+
87
+ | Goal | Command |
88
+ |------|---------|
89
+ | Serve `site/` locally | `npx serve site/` or `python3 -m http.server -d site/` on any port |
90
+ | Register port with DeSciX | `descix site servelocal <port> -c <community> -a <app>` |
91
+ | Run full gateway (multi-app) | `descix serve` (reverse proxy on :5173) |
92
+
93
+ Single-app dev: a static server is sufficient. Gateway is for multi-app or
94
+ platform routing tests.
95
+
96
+ ## MCP Tools
97
+
98
+ - `descix_doctor` — Startup diagnostic (call first)
99
+ - `ask_question_to_app` — RAG chat with app_id `{{appId}}`
100
+ - `query_knowledge_base` — Vector search (raw chunks)
101
+ - `find_communities` — List communities
102
+ - `list_apps_for_community` — List apps in a community
103
+ - `tell_me_how` — Discover any platform capability (use scope "discovery" if "entitlements" is empty)
104
+ - `resolve_invite` — Exchange an invite token for app context + agent hint
105
+
106
+ ## Integrating Existing Content
107
+
108
+ **NEVER copy existing project files into `site/` or `kb/`.** Integrate in place:
109
+
110
+ - **Existing HTML/JS app:** Serve as-is. Add `DeSciXAppSDK.js` for DeSciX integration.
111
+ - **React/Vite app:** Wrap root in `<AppShell appId="{{appId}}">` from `@descix/app-sdk/AppShell`.
112
+ - **Auth only (no DeSciX UI):** Use `PowchClient` from `@descix/app-sdk/powch-client`.
113
+ - **Existing docs:** Copy `docs/*.md` to `kb/General/` for sync. Keep originals as source of truth.
114
+ - **Empty repo:** Scaffold from scratch.
115
+
116
+ ## App Structure
117
+
118
+ - `site/` — Frontend (any framework)
119
+ - `kb/General/` — Knowledge base source docs (markdown)
120
+ - `microservice/` — Backend service (optional)
121
+
122
+ ## Context
123
+
124
+ - App ID: `{{appId}}` | Community: `{{communityId}}` | API: `{{apiUrl}}`
125
+
126
+ ## Known CLI Quirks
127
+
128
+ - `descix status` may show "No workspace found" even when config exists — use explicit flags
129
+ - `descix status` may suggest `descix setup` — use `descix init` instead
130
+
131
+ ## After Bootstrap
132
+
133
+ Rewrite this file with project-specific context once you understand the user's intent.
@@ -0,0 +1,122 @@
1
+ ---
2
+ alwaysApply: true
3
+ ---
4
+
5
+ ### DeSciX Intelligent Tool Discovery
6
+
7
+ **IMPORTANT: Use `tell_me_how` before attempting any DeSciX platform operation.**
8
+
9
+ The DeSciX platform uses semantic tool discovery. Instead of memorizing commands:
10
+ 1. Ask `tell_me_how` what you want to accomplish
11
+ 2. The platform finds relevant tools based on your access level
12
+ 3. Execute the recommended tools via `execute_remote_command`
13
+
14
+ ### Tool Discovery with Scope Control
15
+
16
+ Use `tell_me_how` with appropriate scope:
17
+
18
+ - **Project scope** (`--scope project`): When working within a specific project context
19
+ ```
20
+ tell_me_how({ question: "How do I sync my KB?", scope: "project" })
21
+ ```
22
+ Uses communities/apps from `.descix/workspace.json`
23
+
24
+ - **Entitlements scope** (DEFAULT): When you need actionable tools you can use now
25
+ ```
26
+ tell_me_how({ question: "How do I deploy a token?" })
27
+ ```
28
+ Only returns tools from communities you're a member of and apps you own/purchased
29
+
30
+ - **Discovery scope** (`--scope discovery`): When exploring platform capabilities
31
+ ```
32
+ tell_me_how({ question: "What AI training tools exist?", scope: "discovery" })
33
+ ```
34
+ Returns all tools; indicates which require purchase
35
+
36
+ ### Execution Pattern
37
+
38
+ After `tell_me_how` returns recommended tools:
39
+
40
+ ```javascript
41
+ // 1. Ask how to do something
42
+ const plan = await tell_me_how({
43
+ question: "Create a bonding curve for my community",
44
+ scope: "entitlements"
45
+ });
46
+
47
+ // 2. Execute the recommended command
48
+ await execute_remote_command({
49
+ command: plan.recommended_tools[0].name,
50
+ params: { /* parameters from plan */ }
51
+ });
52
+ ```
53
+
54
+ ### Local Operations
55
+
56
+ These tools run locally (no `tell_me_how` needed):
57
+
58
+ - `descix_init` - Initialize project with `.descix/workspace.json`
59
+ - `descix_wizard_step` - Multi-step wizards (app creation, etc.)
60
+ - `git_sync_ops` - Git operations with auto-generated commit messages
61
+
62
+ ### Knowledge Base Queries
63
+
64
+ For documentation and RAG queries, use `tell_me_how` to discover the right KB:
65
+
66
+ ```
67
+ tell_me_how({ question: "Where is the SDK authentication documented?" })
68
+ ```
69
+
70
+ Or query directly if you know the KB:
71
+
72
+ - `search_knowledge_base` with `communityId`, `appId`, `kbId`
73
+ - `chat_with_kb` for conversational queries
74
+
75
+ ### Knowledge Base References
76
+
77
+ The DeSciX platform documentation is organized in the `descix/docs` app:
78
+
79
+ - **sdk** - SDK documentation, CLI commands, MCP integration
80
+ - **architecture** - Platform architecture, design patterns
81
+ - **cloud** - Backend services, API, deployment
82
+ - **pwa** - Frontend React components, state management
83
+ - **contracts** - Smart contracts, token economics
84
+
85
+ ### Service Registration
86
+
87
+ When registering a new microservice:
88
+
89
+ 1. **Create SERVICE_README_{app_id}.md** in the app's Drive folder
90
+ 2. Follow the template provided by `descix service register --help`
91
+ 3. The README is vectorized for `tell_me_how` discovery
92
+
93
+ If the README is missing, the CLI provides AI-friendly instructions you can use directly.
94
+
95
+ ### Error Recovery
96
+
97
+ If a command fails:
98
+
99
+ 1. Use `tell_me_how` to find alternative approaches
100
+ 2. Check `search_knowledge_base` for error-specific documentation
101
+ 3. Verify scope - you may need `discovery` scope to find the right tool
102
+
103
+ ### CLI Quick Reference
104
+
105
+ ```bash
106
+ # Discover tools (primary command)
107
+ descix tell-me-how "What you want to accomplish"
108
+ descix tell-me-how --scope project "sync my knowledge base"
109
+ descix tell-me-how --scope discovery "what tokenomics tools exist"
110
+
111
+ # Local operations
112
+ descix init # Initialize project
113
+ descix setup # One-time setup
114
+
115
+ # Authentication
116
+ descix login # Authenticate
117
+ descix mcp quickstart # Full MCP setup
118
+ ```
119
+
120
+ ---
121
+
122
+ *This rules file is deployed by `descix mcp init`. Regenerate with `descix mcp quickstart`.*
@@ -0,0 +1,42 @@
1
+ # Drive Templates
2
+
3
+ These templates are the canonical source for content that lives in Google Drive. They are uploaded to Drive and used by the backend when creating new communities and apps.
4
+
5
+ ## Template Structure
6
+
7
+ ### Community Template (`community/`)
8
+
9
+ ```
10
+ community/
11
+ ├── community_assets/
12
+ │ ├── icon.png # 512x512 community icon
13
+ │ └── community_description.md
14
+ └── Apps/ # Empty folder for apps
15
+ ```
16
+
17
+ ### App Template (`app/`)
18
+
19
+ ```
20
+ app/
21
+ ├── assets/
22
+ │ ├── app_description.md # App store listing
23
+ │ ├── system_instructions.md # AI persona definition
24
+ │ └── icon.png # 512x512 app icon
25
+ └── kb/
26
+ └── General/
27
+ └── README.md # KB starter document
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ These templates are:
33
+ 1. Uploaded to Google Drive (by admin)
34
+ 2. Referenced by folder ID in `DeSciX_Cloud/defaults-config.json`
35
+ 3. Copied by the backend when `create_community_with_app` is called
36
+
37
+ **Note:** Code scaffolds (site, microservice) live in `../scaffolds/`, not here. Drive templates contain only content that syncs to/from Google Drive.
38
+
39
+ ## Placeholder Variables
40
+
41
+ - `{{APP_NAME}}` - Replaced with the app name during creation
42
+ - `{{COMMUNITY_NAME}}` - Replaced with the community name during creation
@@ -0,0 +1,13 @@
1
+ # {{APP_NAME}}
2
+
3
+ {{APP_NAME}} is an AI-powered application on the DeSciX platform.
4
+
5
+ ## Overview
6
+
7
+ Edit this description to explain what your app does and how users can benefit from it.
8
+
9
+ ## Features
10
+
11
+ - AI-powered interactions via the Knowledge Base
12
+ - Customizable system instructions
13
+ - Extensible with microservices
@@ -0,0 +1,17 @@
1
+ You are the AI assistant for {{APP_NAME}}.
2
+
3
+ Your role is to help users interact with this application by:
4
+ 1. Answering questions based on the Knowledge Base
5
+ 2. Providing guidance on using the app's features
6
+ 3. Assisting with tasks related to the app's domain
7
+
8
+ ## Guidelines
9
+
10
+ - Be helpful and concise
11
+ - Reference the Knowledge Base when answering questions
12
+ - If you don't know something, say so clearly
13
+ - Maintain a professional and friendly tone
14
+
15
+ ## Knowledge Base
16
+
17
+ You have access to documents in the `kb/` folder. Use this information to provide accurate answers to user questions.
@@ -0,0 +1,25 @@
1
+ # Knowledge Base
2
+
3
+ Welcome to the {{APP_NAME}} Knowledge Base.
4
+
5
+ ## Overview
6
+
7
+ This folder contains the documents that power the AI assistant. Add your content here to make it available to users interacting with your app.
8
+
9
+ ## How It Works
10
+
11
+ 1. **Add Documents**: Upload markdown, text, or PDF files to this folder
12
+ 2. **Sync**: Use `descix kb sync` to process and vectorize your documents
13
+ 3. **Query**: Users can now ask questions and get answers based on your content
14
+
15
+ ## Folder Structure
16
+
17
+ - `General/` - General knowledge and documentation
18
+ - Create additional subfolders for different topics
19
+
20
+ ## Best Practices
21
+
22
+ - Use clear, descriptive file names
23
+ - Structure content with headers for better retrieval
24
+ - Keep documents focused on single topics
25
+ - Update regularly to keep information current
@@ -0,0 +1,4 @@
1
+ # Apps Folder
2
+
3
+ This folder contains apps belonging to the community.
4
+ Each app has its own subfolder following the agent_app_template structure.
@@ -0,0 +1,15 @@
1
+ # {{COMMUNITY_NAME}}
2
+
3
+ Welcome to {{COMMUNITY_NAME}}!
4
+
5
+ This is your community on the DeSciX platform. Edit this description to tell members about your community's purpose, goals, and what makes it unique.
6
+
7
+ ## About
8
+
9
+ Describe your community here.
10
+
11
+ ## Getting Started
12
+
13
+ - Join the community discussions
14
+ - Explore available apps
15
+ - Contribute to the knowledge base
@@ -0,0 +1,104 @@
1
+ # DeSciX Drive Templates
2
+
3
+ **IMPORTANT:** These templates should be uploaded to Google Drive and are the SINGLE SOURCE OF TRUTH for creating communities and apps.
4
+
5
+ ## Google Drive Location
6
+
7
+ **Target Folder:** https://drive.google.com/drive/folders/1AcX-YDR5mFQo1QolBgMG7KpX2cTWF0dn
8
+ **Owner:** dip@descix.net
9
+
10
+ ## Template Structure
11
+
12
+ ### `community_template/`
13
+
14
+ The canonical folder structure for creating new communities:
15
+
16
+ ```
17
+ community_template/
18
+ ├── community_assets/
19
+ │ ├── icon.png # Required: 512x512 community icon
20
+ │ └── community_description.md # Required: Community description (placeholder)
21
+ └── Apps/ # Empty folder - apps are added here
22
+ ```
23
+
24
+ ### `agent_app_template/`
25
+
26
+ The canonical folder structure for creating new agent apps:
27
+
28
+ ```
29
+ agent_app_template/
30
+ ├── assets/
31
+ │ ├── app_description.md # Required: App description (placeholder)
32
+ │ ├── system_instructions.md # Required: AI persona instructions (placeholder)
33
+ │ └── icon.png # Required: 512x512 app icon
34
+ ├── kb/
35
+ │ └── General/
36
+ │ └── README.md # Starter KB document
37
+ ├── site/ # Empty - for static site content
38
+ └── microservice/ # Empty - for backend service code
39
+ ```
40
+
41
+ ## How Templates Are Used
42
+
43
+ ### Creating a Community
44
+
45
+ 1. Backend calls `copyFolderRecursive(COMMUNITY_TEMPLATE_ID, userBaseFolderId, communityId)`
46
+ 2. The entire `community_template/` structure is copied to the user's folder
47
+ 3. Folder is renamed to the `community_id`
48
+ 4. Firestore `Community` document is created
49
+ 5. User can then add apps to the community
50
+
51
+ ### Creating an App
52
+
53
+ 1. Backend calls `copyFolderRecursive(AGENT_APP_TEMPLATE_ID, communityFolderId, appId)`
54
+ 2. The entire `agent_app_template/` structure is copied into the community folder
55
+ 3. Folder is renamed to the `app_id`
56
+ 4. Firestore `App` and `KnowledgeBase` documents are created
57
+ 5. User can then customize assets and add KB content
58
+
59
+ ## Placeholder Variables
60
+
61
+ Templates contain placeholder variables that can be replaced post-copy:
62
+
63
+ | Variable | Description |
64
+ |----------|-------------|
65
+ | `{{COMMUNITY_NAME}}` | The community's display name |
66
+ | `{{APP_NAME}}` | The app's display name |
67
+
68
+ These are NOT automatically replaced - they serve as guidance for the user to edit.
69
+
70
+ ## Uploading to Google Drive
71
+
72
+ **Status:** ✅ Templates have been uploaded.
73
+
74
+ If you need to re-upload:
75
+ 1. Upload the `community_template/` folder to the target Drive folder
76
+ 2. Upload the `agent_app_template/` folder to the target Drive folder
77
+ 3. Update folder IDs in `DeSciX_Cloud/defaults-config.json`
78
+
79
+ **Note:** Default icons are already included (from `DeSciX_PWA/assets/icon.png`).
80
+
81
+ ## Important Notes
82
+
83
+ - **Do NOT modify templates without updating all consumers**
84
+ - **Templates are the SINGLE source for folder structure**
85
+ - **All structure validation has been removed from the backend**
86
+ - **If template structure is wrong, all new communities/apps will be wrong**
87
+
88
+ ## Configuration
89
+
90
+ Template folder IDs are stored in `DeSciX_Cloud/defaults-config.json` (not secrets):
91
+
92
+ ```json
93
+ "DRIVE_COMMUNITY_TEMPLATE_FOLDER_ID": "1ocVhrODQPGMICWmod3OWSGAj4-t6-o-B",
94
+ "DRIVE_AGENT_APP_TEMPLATE_FOLDER_ID": "1ewnvtVG5hhEcRg_rcYmnGiWjTjznu8nu"
95
+ ```
96
+
97
+ **Google Drive Links:**
98
+ - Community Template: https://drive.google.com/drive/folders/1ocVhrODQPGMICWmod3OWSGAj4-t6-o-B
99
+ - Agent App Template: https://drive.google.com/drive/folders/1ewnvtVG5hhEcRg_rcYmnGiWjTjznu8nu
100
+
101
+ ## Related Documentation
102
+
103
+ - [Template-Based Creation Consolidation](../../../design/proposed/template-based-creation-consolidation.md)
104
+ - [Standard Folder Structure](../../agent-assets/instructions/standard-folder-structure.md)
@@ -0,0 +1,13 @@
1
+ # {{APP_NAME}}
2
+
3
+ {{APP_NAME}} is an AI-powered application on the DeSciX platform.
4
+
5
+ ## Overview
6
+
7
+ Edit this description to explain what your app does and how users can benefit from it.
8
+
9
+ ## Features
10
+
11
+ - AI-powered interactions via the Knowledge Base
12
+ - Customizable system instructions
13
+ - Extensible with microservices
@@ -0,0 +1,17 @@
1
+ You are the AI assistant for {{APP_NAME}}.
2
+
3
+ Your role is to help users interact with this application by:
4
+ 1. Answering questions based on the Knowledge Base
5
+ 2. Providing guidance on using the app's features
6
+ 3. Assisting with tasks related to the app's domain
7
+
8
+ ## Guidelines
9
+
10
+ - Be helpful and concise
11
+ - Reference the Knowledge Base when answering questions
12
+ - If you don't know something, say so clearly
13
+ - Maintain a professional and friendly tone
14
+
15
+ ## Knowledge Base
16
+
17
+ You have access to documents in the `kb/` folder. Use this information to provide accurate answers to user questions.
@@ -0,0 +1,25 @@
1
+ # Knowledge Base
2
+
3
+ Welcome to the {{APP_NAME}} Knowledge Base.
4
+
5
+ ## Overview
6
+
7
+ This folder contains the documents that power the AI assistant. Add your content here to make it available to users interacting with your app.
8
+
9
+ ## How It Works
10
+
11
+ 1. **Add Documents**: Upload markdown, text, or PDF files to this folder
12
+ 2. **Sync**: Use `descix kb sync` to process and vectorize your documents
13
+ 3. **Query**: Users can now ask questions and get answers based on your content
14
+
15
+ ## Folder Structure
16
+
17
+ - `General/` - General knowledge and documentation
18
+ - Create additional subfolders for different topics
19
+
20
+ ## Best Practices
21
+
22
+ - Use clear, descriptive file names
23
+ - Structure content with headers for better retrieval
24
+ - Keep documents focused on single topics
25
+ - Update regularly to keep information current
@@ -0,0 +1,10 @@
1
+ # Microservice Folder
2
+
3
+ This folder contains the backend service code for the app.
4
+ Typically includes:
5
+ - Dockerfile
6
+ - package.json
7
+ - src/index.js
8
+ - Service manifest
9
+
10
+ Use the service template from packages/descix-cli/templates/scaffolds/microservice/ as a starting point.
@@ -0,0 +1,4 @@
1
+ # Site Folder
2
+
3
+ This folder contains the static website or Single Page Application (SPA) for the app.
4
+ Add your index.html and other web assets here.
@@ -0,0 +1,4 @@
1
+ # Apps Folder
2
+
3
+ This folder contains apps belonging to the community.
4
+ Each app has its own subfolder following the agent_app_template structure.
@@ -0,0 +1,15 @@
1
+ # {{COMMUNITY_NAME}}
2
+
3
+ Welcome to {{COMMUNITY_NAME}}!
4
+
5
+ This is your community on the DeSciX platform. Edit this description to tell members about your community's purpose, goals, and what makes it unique.
6
+
7
+ ## About
8
+
9
+ Describe your community here.
10
+
11
+ ## Getting Started
12
+
13
+ - Join the community discussions
14
+ - Explore available apps
15
+ - Contribute to the knowledge base
@@ -0,0 +1,62 @@
1
+ # Code Scaffolds
2
+
3
+ These templates contain **code** that must live in Git (not Google Drive). They are copied by the CLI when a user needs to add a site or microservice to their app.
4
+
5
+ ## Why Scaffolds?
6
+
7
+ DeSciX uses a two-tier template system:
8
+
9
+ 1. **Drive Templates** (`../drive/`) - Content (assets, KB docs) synced to/from Google Drive
10
+ 2. **Git Scaffolds** (this folder) - Code that lives in Git, deployed separately
11
+
12
+ Code cannot live in Drive because:
13
+ - Code needs version control (Git)
14
+ - Code is deployed to Cloud Run / GCS (not synced to Drive)
15
+ - Code has dependencies (package.json, Dockerfile)
16
+
17
+ ## Available Scaffolds
18
+
19
+ ### Site (`site/`)
20
+
21
+ A hello-world static site with:
22
+ - `index.html` - Main entry point
23
+ - `styles.css` - Basic styling
24
+ - `app.js` - Client-side JavaScript
25
+ - `README.md` - Usage instructions
26
+
27
+ **Install with:**
28
+ ```bash
29
+ descix site init
30
+ ```
31
+
32
+ ### Microservice (`microservice/`)
33
+
34
+ A complete Express microservice with:
35
+ - `app.js` - Server entry point
36
+ - `manifest.json` - Command registration
37
+ - `services/` - API handlers
38
+ - `Dockerfile` - Container build
39
+ - `SERVICE_README_TEMPLATE.md` - Tool discovery docs
40
+
41
+ **Install with:**
42
+ ```bash
43
+ descix microservice init
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ Run scaffold commands from your app directory (auto-detects context):
49
+
50
+ ```bash
51
+ cd my-app/
52
+ descix site init # Copies site/ scaffold
53
+ descix microservice init # Copies microservice/ scaffold
54
+ ```
55
+
56
+ ## Placeholder Variables
57
+
58
+ Scaffolds use these placeholders (replaced during copy):
59
+
60
+ - `{{APP_NAME}}` - App display name
61
+ - `{{APP_ID}}` - App identifier (lowercase)
62
+ - `{{COMMUNITY_ID}}` - Community identifier
@@ -0,0 +1,19 @@
1
+ # Use official Node.js image
2
+ FROM node:24-slim
3
+
4
+ # Create app directory
5
+ WORKDIR /usr/src/app
6
+
7
+ # Install dependencies
8
+ # Copy package.json and package-lock.json
9
+ COPY package*.json ./
10
+ RUN npm ci --only=production
11
+
12
+ # Copy app source
13
+ COPY . .
14
+
15
+ # Expose port (Cloud Run sets PORT env var)
16
+ EXPOSE 8080
17
+
18
+ # Start
19
+ CMD [ "npm", "start" ]