@docyrus/docyrus 0.0.42 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,26 +25,6 @@ or
25
25
  pnpm add -g @docyrus/docyrus
26
26
  ```
27
27
 
28
- ## Environments
29
-
30
- List and switch environments:
31
-
32
- ```bash
33
- docyrus env list
34
- docyrus env use live
35
- ```
36
-
37
- Default environments:
38
-
39
- - `live` -> `https://api.docyrus.com`
40
- - `beta` -> `https://beta-api.docyrus.com`
41
- - `alpha` -> `https://alpha-api.docyrus.com`
42
- - `dev` -> `https://localhost:3366`
43
-
44
- Aliases:
45
-
46
- - `prod` -> `live`
47
-
48
28
  ## Authentication
49
29
 
50
30
  Login with explicit client ID:
@@ -61,6 +41,15 @@ Logout active account:
61
41
  docyrus auth logout
62
42
  ```
63
43
 
44
+ Work with accounts and tenants:
45
+
46
+ ```bash
47
+ docyrus auth accounts list --json
48
+ docyrus auth accounts use --userId "<user-id>" --json
49
+ docyrus auth tenants list --userId "<user-id>" --json
50
+ docyrus auth tenants use "<tenant-id-uuid-or-tenant-no>" --userId "<user-id>" --json
51
+ ```
52
+
64
53
  ## Help
65
54
 
66
55
  ```bash
@@ -70,63 +59,25 @@ docyrus env --help
70
59
  docyrus auth --help
71
60
  docyrus discover --help
72
61
  docyrus knowledge --help
62
+ docyrus project-plan --help
73
63
  docyrus ds --help
74
64
  docyrus apps --help
75
65
  docyrus studio --help
66
+ docyrus connect --help
76
67
  docyrus agent --help
77
68
  docyrus coder --help
69
+ docyrus server --help
78
70
  docyrus tui --help
79
71
  ```
80
72
 
81
- ## Example Usages
82
-
83
- Get current environment and active user/tenant context:
84
-
85
- ```bash
86
- docyrus --json
87
- ```
88
-
89
- Switch environment:
90
-
91
- ```bash
92
- docyrus env use beta
93
- docyrus env list --json
94
- ```
95
-
96
- Login and inspect current identity:
97
-
98
- ```bash
99
- docyrus auth login --clientId "83a8df32-3738-4b5a-a0c7-87976adb1631"
100
- docyrus auth who --json
101
- ```
102
-
103
- List apps:
104
-
105
- ```bash
106
- docyrus apps list --json
107
- ```
108
-
109
- Download current tenant OpenAPI spec:
110
-
111
- ```bash
112
- docyrus discover api --json
113
- ```
114
-
115
- Discover from downloaded tenant OpenAPI spec:
116
-
117
- ```bash
118
- docyrus discover namespaces --json
119
- docyrus discover path /v1/users --json
120
- docyrus discover endpoint /v1/users/me --json
121
- docyrus discover endpoint [PUT]/v1/users/me/photo --json
122
- docyrus discover entity UserEntity --json
123
- docyrus discover search users,UserEntity --json
124
- ```
73
+ ## Knowledge Graph
125
74
 
126
75
  Initialize and use the repo knowledge graph:
127
76
 
128
77
  ```bash
129
78
  docyrus knowledge init
79
+ docyrus knowledge generate-initial
80
+ docyrus knowledge refresh
130
81
  docyrus knowledge locate "Working Agreement" --json
131
82
  docyrus knowledge section "knowledge#Working Agreement" --json
132
83
  docyrus knowledge refs "knowledge#Working Agreement" --json
@@ -136,15 +87,42 @@ docyrus knowledge check --json
136
87
  docyrus knowledge config --json
137
88
  ```
138
89
 
139
- Work with accounts and tenants:
90
+ ## Project Plan
91
+
92
+ The project plan is a repo-tracked work graph stored at `docyrus/project-plan/project-plan.json`. It organizes work into sections (standalone groupings like phases or feature areas), features, and tasks. A derived `PROJECT_PLAN.md` is always kept in sync. Features are also synced into the knowledge base features document when it exists.
93
+
94
+ Manage sections, features, and tasks:
140
95
 
141
96
  ```bash
142
- docyrus auth accounts list --json
143
- docyrus auth accounts use --userId "<user-id>" --json
144
- docyrus auth tenants list --userId "<user-id>" --json
145
- docyrus auth tenants use "<tenant-id-uuid-or-tenant-no>" --userId "<user-id>" --json
97
+ docyrus project-plan show --json
98
+ docyrus project-plan check --json
99
+ docyrus project-plan ensure --json
100
+
101
+ # Sections
102
+ docyrus project-plan upsert-section --title "Core Features" --json
103
+ docyrus project-plan upsert-section --title "Testing" --slug "testing" --summary "Test coverage" --json
104
+
105
+ # Features
106
+ docyrus project-plan upsert-feature --sectionId "<section-id>" --title "Auth Flow" --json
107
+ docyrus project-plan upsert-feature --sectionId "<section-id>" --title "Data Export" --slug "data-export" --summary "CSV and JSON export" --json
108
+
109
+ # Tasks
110
+ docyrus project-plan upsert-task --featureId "<feature-id>" --title "Implement OAuth2" --type new-implementation --assignee agent --json
111
+ docyrus project-plan upsert-task --featureId "<feature-id>" --title "Fix token refresh" --type bug-fix --assignee agent --status in_progress --json
112
+ docyrus project-plan get-task --taskId "<task-id>" --json
113
+ docyrus project-plan set-task-status --taskId "<task-id>" --status done --json
114
+
115
+ # Linked local subtasks
116
+ docyrus project-plan create-linked-todo --taskId "<task-id>" --json
117
+ docyrus project-plan create-linked-todo --taskId "<task-id>" --title "Step 1" --body "Details" --json
146
118
  ```
147
119
 
120
+ Task types: `new-implementation`, `bug-fix`, `api-test`, `browser-automation-test`, `work`
121
+ Assignees: `agent`, `user`
122
+ Statuses: `planned`, `in_progress`, `blocked`, `done`
123
+
124
+ ## Data Sources
125
+
148
126
  Query data source items:
149
127
 
150
128
  ```bash
@@ -175,11 +153,44 @@ docyrus ds create base task --from-file ./tasks.csv --json
175
153
  docyrus ds update base task --from-file ./tasks-update.json --json
176
154
  ```
177
155
 
178
- Call raw API endpoints via curl command:
156
+ ## OpenAPI Discovery
157
+
158
+ Download current tenant OpenAPI spec:
179
159
 
180
160
  ```bash
181
- docyrus curl /users/me -i --json
182
- docyrus curl /dev/apps --json
161
+ docyrus discover api --json
162
+ ```
163
+
164
+ Discover from downloaded tenant OpenAPI spec:
165
+
166
+ ```bash
167
+ docyrus discover namespaces --json
168
+ docyrus discover path /v1/users --json
169
+ docyrus discover endpoint /v1/users/me --json
170
+ docyrus discover endpoint [PUT]/v1/users/me/photo --json
171
+ docyrus discover entity UserEntity --json
172
+ docyrus discover search users,UserEntity --json
173
+ ```
174
+
175
+ ## Connectors
176
+
177
+ ```bash
178
+ docyrus connect list-connectors --json
179
+ docyrus connect get-connector <slug> --json
180
+ docyrus connect get-action <slug> <actionKey> --json
181
+ docyrus connect list-connections <slug> --json
182
+ docyrus connect curl <slug> <endpoint> --json
183
+ docyrus connect run-action <appSlug> <actionKey> --json
184
+ ```
185
+
186
+ ## Apps and Studio
187
+
188
+ List and manage apps:
189
+
190
+ ```bash
191
+ docyrus apps list --json
192
+ docyrus apps delete --appId "<app-id>" --json
193
+ docyrus apps restore --appId "<app-id>" --json
183
194
  ```
184
195
 
185
196
  Manage dev studio data sources, fields, and enums:
@@ -205,12 +216,23 @@ docyrus studio update-enums --appId "<app-id>" --dataSourceId "<data-source-id>"
205
216
  docyrus studio delete-enums --appId "<app-id>" --dataSourceId "<data-source-id>" --fieldId "<field-id>" --data '["enum-1","enum-2"]' --json
206
217
  ```
207
218
 
219
+ ## Raw API Access
220
+
221
+ ```bash
222
+ docyrus curl /users/me -i --json
223
+ docyrus curl /dev/apps --json
224
+ ```
225
+
226
+ ## TUI
227
+
208
228
  Launch the OpenTUI terminal UI (requires Bun):
209
229
 
210
230
  ```bash
211
231
  docyrus tui
212
232
  ```
213
233
 
234
+ ## Agent Server
235
+
214
236
  Start the agent HTTP server:
215
237
 
216
238
  ```bash
@@ -222,6 +244,8 @@ docyrus server --model anthropic/claude-sonnet-4-20250514 --thinking high
222
244
 
223
245
  For full endpoint documentation see [docs/API.md](docs/API.md).
224
246
 
247
+ ## Pi Agent and Coding Agent
248
+
225
249
  Launch the scoped pi assistant and coding agent:
226
250
 
227
251
  ```bash
@@ -239,6 +263,8 @@ docyrus agent --print "Which tenant am I using?"
239
263
  docyrus coder --print --mode json "Summarize the CLI command surface in this repo"
240
264
  ```
241
265
 
266
+ ### Built-in Agent Tools
267
+
242
268
  When `docyrus/knowledge/` exists, `docyrus agent`, `docyrus coder`, and `docyrus server` load built-in knowledge tools:
243
269
 
244
270
  - `docyrus_knowledge_search`
@@ -248,26 +274,33 @@ When `docyrus/knowledge/` exists, `docyrus agent`, `docyrus coder`, and `docyrus
248
274
  - `docyrus_knowledge_expand`
249
275
  - `docyrus_knowledge_check`
250
276
 
251
- When `docyrus/project-plan/project-plan.json` exists, `docyrus agent`, `docyrus coder`, and `docyrus server` also load:
277
+ When `docyrus/project-plan/project-plan.json` exists, the `project_task` tool is also loaded with actions: `show`, `get`, `create-section`, `create-feature`, `create-task`, `set-status`, `create-linked-todo`.
278
+
279
+ The `todo` tool is always available with actions: `list`, `list-all`, `get`, `create`, `update`, `append`, `delete`, `claim`, `release`.
252
280
 
253
- - `project_task`
281
+ ### Slash Commands
254
282
 
255
283
  Inside the interactive agent TUI:
256
284
 
257
285
  ```bash
258
- /login # browser or API-key provider chooser
259
- /logout # remove saved provider configuration
260
- /plan [task] # start a planning-only branch and keep the current plan in .docyrus/plans/
261
- /end-plan # leave the planning branch, summarize it, and return to the original branch
262
- /end-architect # alias for leaving an architect planning session
263
- /plan-policy # show the effective planning-model policy and the resolved planning model
264
- /architect [brief] # discover tenant data sources and generate local planning artifacts under ./docyrus/architecture/
265
- /tasks # browse the canonical project-plan sections, features, and tasks
286
+ /login # browser or API-key provider chooser
287
+ /logout # remove saved provider configuration
288
+ /plan [task] # start a planning-only branch and keep the current plan in .docyrus/plans/
289
+ /end-plan # leave the planning branch, summarize it, and return to the original branch
290
+ /architect [brief] # discover tenant data sources and generate planning artifacts under ./docyrus/architecture/
291
+ /end-architect # alias for leaving an architect planning session
292
+ /plan-policy # show the effective planning-model policy and the resolved planning model
293
+ /read-only # enter read-only mode write and edit tools are disabled
294
+ /end-read-only # exit read-only mode and resume normal operation
295
+ /tasks # browse the canonical project-plan sections, features, and tasks
296
+ /todos # interactive todo manager
266
297
  ```
267
298
 
268
299
  When running through `docyrus server`, `/plan` and `/architect` can be sent through `/api/chat` as normal chat input. If clarification is needed, the server emits a synthetic `ask_user` client tool. Frontends using AI SDK `useChat` should render that tool and submit structured answers back with `addToolOutput`.
269
300
 
270
- Optional planning-model policy:
301
+ ### Planning-Model Policy
302
+
303
+ Optional planning-model policy for controlling which model is used during `/plan` sessions:
271
304
 
272
305
  - Project config: `<project>/.pi/plan-policy.json`
273
306
  - Global config: `~/.pi/agent/plan-policy.json`
package/agent-loader.js CHANGED
@@ -2892,6 +2892,15 @@ async function main() {
2892
2892
  if (pipedStdin !== void 0 && !request.print) {
2893
2893
  request.print = true;
2894
2894
  }
2895
+ const runtime = new pi.AgentSessionRuntime(session, {
2896
+ cwd,
2897
+ agentDir,
2898
+ authStorage,
2899
+ modelRegistry,
2900
+ resourceLoader,
2901
+ settingsManager,
2902
+ sessionManager
2903
+ });
2895
2904
  if (request.print || pipedStdin !== void 0) {
2896
2905
  if (!session.model) {
2897
2906
  throw new Error(`No models available.
@@ -2903,14 +2912,14 @@ Or create ${modelsJsonPath}`);
2903
2912
  }
2904
2913
  const initialMessage = pipedStdin || request.prompt;
2905
2914
  const initialMessages = pipedStdin && request.prompt ? [request.prompt] : void 0;
2906
- await pi.runPrintMode(session, {
2915
+ await pi.runPrintMode(runtime, {
2907
2916
  mode: request.mode || "text",
2908
2917
  initialMessage,
2909
2918
  messages: initialMessages
2910
2919
  });
2911
2920
  return;
2912
2921
  }
2913
- const interactiveMode = new pi.InteractiveMode(session, {
2922
+ const interactiveMode = new pi.InteractiveMode(runtime, {
2914
2923
  initialMessage: request.prompt,
2915
2924
  modelFallbackMessage,
2916
2925
  verbose: request.verbose