howone 0.1.31 → 0.1.32

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 (19) hide show
  1. package/package.json +1 -1
  2. package/templates/vite/.howone/skills/howone/01-architect/01-app-generation.md +33 -27
  3. package/templates/vite/.howone/skills/howone/01-architect/02-manifest-codegen.md +2 -2
  4. package/templates/vite/.howone/skills/howone/02-entity-schema/01-schema-design.md +9 -29
  5. package/templates/vite/.howone/skills/howone/02-entity-schema/02-schema-operations.md +166 -235
  6. package/templates/vite/.howone/skills/howone/02-entity-schema/03-access-models.md +151 -0
  7. package/templates/vite/.howone/skills/howone/02-entity-schema/04-query-contracts.md +123 -0
  8. package/templates/vite/.howone/skills/howone/02-entity-schema/05-ai-persistence-patterns.md +84 -201
  9. package/templates/vite/.howone/skills/howone/03-ai-capabilities/01-ai-capability-architecture.md +37 -32
  10. package/templates/vite/.howone/skills/howone/03-ai-capabilities/02-workflow-contract-rules.md +5 -4
  11. package/templates/vite/.howone/skills/howone/03-ai-capabilities/04-workflow-operations.md +89 -204
  12. package/templates/vite/.howone/skills/howone/03-ai-capabilities/05-ai-feature-playbooks.md +8 -29
  13. package/templates/vite/.howone/skills/howone/04-app-sdk/01-client-setup.md +1 -2
  14. package/templates/vite/.howone/skills/howone/04-app-sdk/07-ai-action-calls.md +2 -2
  15. package/templates/vite/.howone/skills/howone/04-app-sdk/08-ai-manifest-handoff.md +6 -5
  16. package/templates/vite/.howone/skills/howone/04-app-sdk/09-extension-boundaries.md +1 -1
  17. package/templates/vite/.howone/skills/howone/{02-entity-schema/03-data-access-patterns.md → 04-app-sdk/11-entity-data-access-patterns.md} +4 -4
  18. package/templates/vite/.howone/skills/howone/{02-entity-schema/04-query-dsl-and-responses.md → 04-app-sdk/12-query-dsl-and-responses.md} +1 -1
  19. package/templates/vite/.howone/skills/howone/SKILL.md +112 -75
@@ -4,7 +4,7 @@ Use this reference when designing `capability.description`, `inputSchema`, `outp
4
4
  `outputEntityName` for HowOne AI workflows.
5
5
 
6
6
  These rules come from `docs/ai-worlfow-guide-schema.md`. Violating them can make the workflow
7
- service reject the request or produce a workflow that the SDK cannot call reliably.
7
+ service reject the request or produce a workflow the runtime cannot execute reliably.
8
8
 
9
9
  ## Contract Shape
10
10
 
@@ -122,7 +122,8 @@ Forbidden:
122
122
  - inline PDF/image/audio bytes;
123
123
  - browser upload logic in workflow.
124
124
 
125
- The app uploads first through `howone.upload.*`, then passes the URL to the workflow.
125
+ The app uploads first, then passes the resulting URL to the workflow. File upload helpers belong to
126
+ the SDK track.
126
127
 
127
128
  ## Output Minimalism
128
129
 
@@ -227,8 +228,8 @@ Forbidden in capability descriptions and schemas:
227
228
  Instead:
228
229
 
229
230
  1. workflow returns output fields;
230
- 2. frontend/server code calls SDK entity methods;
231
- 3. persistence helper maps durable fields.
231
+ 2. app code persists through the entity runtime after SDK handoff;
232
+ 3. durable fields map to the entity contract.
232
233
 
233
234
  ## External Data Assumptions
234
235
 
@@ -1,256 +1,141 @@
1
1
  # Workflow Operations
2
2
 
3
- Use this reference when submitting or checking external workflow create/update operations.
3
+ Use this reference when submitting HowOne external AI workflow create/update operations through
4
+ `external-ai-capability`. This is an AI workflow design reference, not an app SDK guide.
4
5
 
5
- Source: `docs/ai-worlfow-guide-schema.md`.
6
+ ## Current Tool Contract
6
7
 
7
- ## Endpoints
8
+ Do not hand-build raw workflow HTTP requests in generated app work. Use `external-ai-capability`
9
+ after `.howone/ai/manifest.json` has been synced.
8
10
 
9
- | Purpose | Method | Path |
10
- |---|---|---|
11
- | Submit create/update operations | `POST` | `/workflow/{project_short_id}/operate` |
12
- | Check operation status | `GET` | `/workflow/status_check/{request_id}` |
11
+ The tool performs:
13
12
 
14
- All requests require `Authorization: Bearer <token>`.
15
-
16
- ## Operation Object
17
-
18
- ```json
19
- {
20
- "appId": "proj_docs",
21
- "workflowId": "550e8400-e29b-41d4-a716-446655440000",
22
- "mode": "create",
23
- "capability": {
24
- "name": "summarizeDocument",
25
- "description": "Reads an uploaded document and produces a concise summary highlighting the key points.",
26
- "inputSchema": {},
27
- "outputSchema": {},
28
- "outputEntityName": "DocumentSummary"
29
- },
30
- "requestMeta": {}
31
- }
13
+ ```text
14
+ POST /workflows
15
+ GET /jobs/{job_id}
32
16
  ```
33
17
 
34
- Field rules:
18
+ The tool reads the synced manifest and submits operations for selected capabilities.
35
19
 
36
- | Field | Required | Notes |
37
- |---|---:|---|
38
- | `appId` | yes | Must match path project short ID. |
39
- | `workflowId` | yes | UUID v4 from manifest/capability contract. |
40
- | `mode` | yes | `"create"` or `"update"`. |
41
- | `capability` | yes | Synced capability contract. |
42
- | `workflowConfigID` | update only | Comes from completed status result. |
43
- | `updatePrompt` | update only | Natural language behavior change request. |
44
- | `requestMeta` | no | Optional execution metadata. |
20
+ ## Create
45
21
 
46
- Do not hand-copy stale schemas. Submit from synced `.howone/ai/manifest.json` whenever possible.
22
+ Use create when the capability has a synced manifest entry and no external implementation has been
23
+ submitted for its current `workflowId`.
47
24
 
48
- ## Create Request
25
+ Tool input:
49
26
 
50
27
  ```json
51
28
  {
52
- "operations": [
53
- {
54
- "appId": "proj_docs",
55
- "workflowId": "550e8400-e29b-41d4-a716-446655440000",
56
- "mode": "create",
57
- "capability": {
58
- "name": "summarizeDocument",
59
- "description": "Reads an uploaded document and produces a concise summary highlighting the key points.",
60
- "inputSchema": {
61
- "type": "object",
62
- "properties": {
63
- "document_url": {
64
- "type": "string",
65
- "format": "uri",
66
- "description": "Supabase Storage URL of the uploaded document."
67
- },
68
- "summary_length": {
69
- "type": "string",
70
- "description": "Desired summary length, e.g. short, medium, long, or a specific sentence count."
71
- }
72
- },
73
- "required": ["document_url"]
74
- },
75
- "outputSchema": {
76
- "type": "object",
77
- "properties": {
78
- "summary": {
79
- "type": "string",
80
- "description": "The generated summary in the same language as the source document."
81
- }
82
- },
83
- "required": ["summary"]
84
- },
85
- "outputEntityName": "DocumentSummary"
86
- },
87
- "requestMeta": {}
88
- }
89
- ]
29
+ "cwd": "<app-root>",
30
+ "capabilityNames": ["summarizeDocument"]
90
31
  }
91
32
  ```
92
33
 
93
- Create response:
34
+ Tool behavior:
94
35
 
95
- ```json
96
- {
97
- "request_ids": [
98
- {
99
- "request_id": "req_abc123",
100
- "workflow_id": "550e8400-e29b-41d4-a716-446655440000",
101
- "workflow_config_id": null,
102
- "operation_type": "generate"
103
- }
104
- ]
105
- }
36
+ ```text
37
+ config_id = manifest.capabilities[].workflowId
38
+ mode = create
39
+ capability = synced manifest capability contract
106
40
  ```
107
41
 
108
- Store every `request_id`.
42
+ Do not generate a second UUID for create. The AI capability design/sync path already produced the
43
+ manifest `workflowId`.
44
+
45
+ ## Update
109
46
 
110
- ## Update Request
47
+ Use update when the external implementation exists and the user asks to change workflow behavior or
48
+ to regenerate implementation for a changed contract.
111
49
 
112
- Use update when the external workflow implementation already exists.
50
+ Tool input:
113
51
 
114
52
  ```json
115
53
  {
116
- "operations": [
54
+ "cwd": "<app-root>",
55
+ "updates": [
117
56
  {
118
- "appId": "proj_docs",
119
- "workflowId": "550e8400-e29b-41d4-a716-446655440000",
120
- "workflowConfigID": "cfg_xyz789",
121
- "mode": "update",
122
- "capability": {
123
- "name": "summarizeDocument",
124
- "description": "Reads an uploaded document and produces a concise summary. Supports paragraph or bullet-point format.",
125
- "inputSchema": {
126
- "type": "object",
127
- "properties": {
128
- "document_url": {
129
- "type": "string",
130
- "format": "uri",
131
- "description": "Supabase Storage URL of the uploaded document."
132
- },
133
- "output_format": {
134
- "type": "string",
135
- "description": "Format of the summary output: paragraphs or bullet_points."
136
- }
137
- },
138
- "required": ["document_url"]
139
- },
140
- "outputSchema": {
141
- "type": "object",
142
- "properties": {
143
- "summary": {
144
- "type": "string",
145
- "description": "The generated summary in the requested format and same language as the source document."
146
- }
147
- },
148
- "required": ["summary"]
149
- },
150
- "outputEntityName": "DocumentSummary"
151
- },
152
- "updatePrompt": "Add support for optional bullet-point summary output through output_format.",
153
- "requestMeta": {}
57
+ "capabilityName": "summarizeDocument",
58
+ "updatePrompt": "Support concise bullet-point summaries when the user asks for bullet format."
154
59
  }
155
60
  ]
156
61
  }
157
62
  ```
158
63
 
159
- Update response has `operation_type: "edit"`.
160
-
161
- ## Status Polling
64
+ Tool behavior:
162
65
 
163
66
  ```text
164
- POST /workflow/{project_short_id}/operate
165
- -> request_ids[]
166
-
167
- GET /workflow/status_check/{request_id}
168
- -> queued/running/completed/failed
67
+ previous config = current manifest capability.workflowId
68
+ new config = freshly generated UUID
69
+ mode = update
70
+ manifest = rewritten so capability.workflowId is the fresh UUID
169
71
  ```
170
72
 
171
- Poll every 2-5 seconds until terminal.
73
+ After update, re-read `.howone/ai/manifest.json`. The new manifest `workflowId` is the value used by
74
+ SDK bindings and future execution.
172
75
 
173
- Status values:
76
+ Do not pass stale `workflowConfigID` values from old docs or older status payloads. The current
77
+ tool owns config rotation and manifest write-back.
174
78
 
175
- | Status | Meaning | Action |
176
- |---|---|---|
177
- | `queued` | waiting | continue polling |
178
- | `running` | being generated/edited | continue polling |
179
- | `completed` | operation finished | inspect `payload.success` |
180
- | `failed` | system failure | report/display error |
79
+ ## Selection Rules
181
80
 
182
- Completed success:
81
+ - `capabilityNames` limits create operations.
82
+ - `updates[]` limits update operations.
83
+ - If `updates[]` is provided without `capabilityNames`, only those update capabilities are selected.
84
+ - Do not submit every capability when the user asked to update one behavior.
183
85
 
184
- ```json
185
- {
186
- "success": true,
187
- "jobId": "req_abc123",
188
- "status": "completed",
189
- "payload": {
190
- "success": true,
191
- "workflow_details": {
192
- "workflow_graph": {},
193
- "new_workflow_config_id": "cfg_xyz789"
194
- }
195
- }
196
- }
197
- ```
86
+ ## Status And Results
198
87
 
199
- Completed business failure:
88
+ The tool may return immediately when a host poller is available. Preserve:
200
89
 
201
- ```json
202
- {
203
- "success": true,
204
- "status": "completed",
205
- "payload": {
206
- "success": false,
207
- "display_error_message": "Unable to generate workflow: the requested capability is not supported.",
208
- "full_error_message": "Detailed internal error..."
209
- }
210
- }
211
- ```
90
+ - `jobId`;
91
+ - `taskId` / `requestId` when present;
92
+ - `submittedConfigId`;
93
+ - `previousConfigId` for updates;
94
+ - `manifestUpdates` mapping old workflow IDs to new workflow IDs.
212
95
 
213
- System failure:
96
+ Terminal result meaning:
214
97
 
215
- ```json
216
- {
217
- "success": true,
218
- "status": "failed",
219
- "payload": {
220
- "success": false,
221
- "display_error_message": "Service temporarily unavailable.",
222
- "full_error_message": "Timeout after 120s waiting for LLM response."
223
- }
224
- }
98
+ | Status | Meaning |
99
+ |---|---|
100
+ | `submitted` | background poller will continue |
101
+ | `running` / `queued` | not terminal |
102
+ | `completed` | workflow operation completed |
103
+ | `failed` / `canceled` / `timed_out` | report error and do not pretend workflow is ready |
104
+
105
+ ## Standard Flow
106
+
107
+ New AI feature:
108
+
109
+ ```text
110
+ ai-capability-design apply_capability_patch
111
+ sync_ai_artifacts
112
+ external-ai-capability { cwd, capabilityNames }
113
+ read .howone/ai/manifest.json
225
114
  ```
226
115
 
227
- On success, persist:
116
+ Schema-changing AI update:
228
117
 
229
- - `request_id`;
230
- - `workflowId`;
231
- - `new_workflow_config_id`;
232
- - capability name;
233
- - mode;
234
- - any status/error useful for future update.
118
+ ```text
119
+ ai-capability-design apply_capability_patch
120
+ sync_ai_artifacts
121
+ external-ai-capability { cwd, updates: [{ capabilityName, updatePrompt }] }
122
+ read .howone/ai/manifest.json
123
+ ```
235
124
 
236
- ## Agent Handoff Notes
125
+ Behavior-only update:
237
126
 
238
- When another tool/layer owns submission:
127
+ ```text
128
+ external-ai-capability { cwd, updates: [{ capabilityName, updatePrompt }] }
129
+ read .howone/ai/manifest.json
130
+ ```
239
131
 
240
- - provide the synced capability name and manifest path;
241
- - do not rewrite raw schemas if the tool can load manifest;
242
- - preserve returned request IDs;
243
- - after status success, preserve `workflowConfigID` for future edits;
244
- - regenerate SDK only after manifest changes, not after behavior-only workflow edits.
132
+ SDK/code work happens after these steps and belongs to the SDK track.
245
133
 
246
- ## Operation Checklist
134
+ ## Checklist
247
135
 
248
136
  - Manifest is synced before submit.
249
- - `appId` matches path project ID.
250
- - `workflowId` is a UUID.
251
- - `mode=create` omits `workflowConfigID`.
252
- - `mode=update` includes confirmed `workflowConfigID`.
253
- - `updatePrompt` says what to change, not a whole new fake schema.
254
- - Request IDs are stored.
255
- - Status is polled to terminal.
256
- - Business failure and system failure are handled differently.
137
+ - Create uses the existing manifest `workflowId`.
138
+ - Update lets the tool generate a fresh config UUID.
139
+ - Update has a concrete `updatePrompt`.
140
+ - The manifest is re-read after update.
141
+ - SDK bindings are copied from manifest, not from memory or old status IDs.
@@ -1,7 +1,7 @@
1
1
  # AI Feature Playbooks
2
2
 
3
- Use this reference when turning a user request into concrete HowOne AI capabilities, database
4
- entities, and SDK calls.
3
+ Use this reference when turning a user request into concrete HowOne AI capabilities and optional
4
+ persistence entities. App-side SDK calls belong to `04-app-sdk/`.
5
5
 
6
6
  ## Playbook: Document Summary
7
7
 
@@ -47,11 +47,8 @@ Persistence:
47
47
  - private `DocumentSummary` if user history is needed;
48
48
  - fields: `documentUrl`, `summary`, `status`, `errorMessage`, `requestedAt`, `completedAt`.
49
49
 
50
- SDK:
51
-
52
- ```ts
53
- const output = await howone.ai.summarizeDocument.run({ document_url: fileUrl })
54
- ```
50
+ App implementation handoff: after sync and external workflow submit, read the SDK track before
51
+ writing app-side AI runtime calls.
55
52
 
56
53
  ## Playbook: Image Generator
57
54
 
@@ -97,26 +94,8 @@ Persistence:
97
94
  - use `Generation` for private history;
98
95
  - public share requires separate `SharedGeneration`.
99
96
 
100
- SDK:
101
-
102
- ```ts
103
- await runAiActionAndPersist({
104
- entity: howone.entities.Generation,
105
- input: { image_description, style_preference },
106
- createPending: (input) => ({
107
- prompt: input.image_description,
108
- style: input.style_preference ?? null,
109
- status: 'pending',
110
- requestedAt: new Date().toISOString(),
111
- }),
112
- run: (input) => howone.ai.generateImage.run(input),
113
- mapCompleted: ({ output }) => ({
114
- status: 'completed',
115
- resultUrl: output.generated_image_url,
116
- completedAt: new Date().toISOString(),
117
- }),
118
- })
119
- ```
97
+ App implementation handoff: if persistence is needed, finish the entity contract first, then read
98
+ the SDK track for runtime action calls and persistence helper usage.
120
99
 
121
100
  ## Playbook: Image Editor
122
101
 
@@ -288,9 +267,9 @@ Rules:
288
267
  ## Feature Design Checklist
289
268
 
290
269
  - Choose one playbook or clearly combine compatible playbooks.
291
- - Verify capability exists in `04-service-capability-catalog.md`.
270
+ - Verify capability exists in `03-service-capability-catalog.md`.
292
271
  - Use URL inputs for files/media.
293
272
  - Keep outputs minimal and product-facing.
294
273
  - Decide persistence separately.
295
- - Generate SDK bindings only after manifest sync.
274
+ - Generate SDK bindings only after manifest sync and external workflow submit.
296
275
  - Use app-owned UI for progress/errors.
@@ -77,7 +77,6 @@ client.public.raw: RawHttpClient
77
77
  client.schema.listDefinitions()
78
78
  client.schema.getDefinition(entityName)
79
79
  client.schema.operate(operation)
80
- client.schema.previewPatch(patch, { expectedVersionId, reason })
81
80
  client.schema.applyPatch(patch, { expectedVersionId, reason })
82
81
  client.schema.getState()
83
82
  client.schema.listVersions()
@@ -289,7 +288,7 @@ client.auth.logout()
289
288
 
290
289
  - Use `client.entities.*` / `howone.entities.*` for authenticated app data. The backend derives owner from the JWT; do not pass owner filters or owner fields.
291
290
  - Use `client.public.entities.*` / `howone.public.entities.*` for public landing pages, public article lists, scoped QR/profile pages, and public forms.
292
- - Use `client.schema.*` only for backend contract management: definitions, schema operations, schema patch preview/apply, versions, and restore.
291
+ - Use `client.schema.*` only for backend contract management: definitions, schema operations, schema patch apply, versions, and restore.
293
292
  - Use `client.raw.*` only for custom endpoints not covered by typed SDK methods.
294
293
 
295
294
  ---
@@ -27,8 +27,8 @@ Correct sequence:
27
27
  1. `ai-capability-design` — design the capability contract
28
28
  2. `sync_ai_artifacts` — sync manifest to disk
29
29
  3. `external-ai-capability` — submit workflow create/update to EAX from the synced manifest
30
- 4. Workflow status/background-task layer confirms readiness and captures `workflowConfigID` for future edits
31
- 5. Read `.howone/ai/manifest.json` → write `src/lib/sdk.ts` with `workflowId`
30
+ 4. Re-read `.howone/ai/manifest.json`; update may have rotated `workflowId`
31
+ 5. Write `src/lib/sdk.ts` with the current manifest `workflowId`
32
32
 
33
33
  Building without errors does **not** mean the AI workflow binding is correct. A missing `workflowId` causes a runtime UUID error at the EAX execution call.
34
34
 
@@ -217,12 +217,13 @@ Do not ask the workflow to write records. Do not pass owner fields for authentic
217
217
  When changing external workflow behavior later:
218
218
 
219
219
  1. If schema changes, update AI capability contract first and sync manifest.
220
- 2. Use `workflowConfigID` from a completed status result.
221
- 3. Submit update with `capabilityName`, `workflowConfigID`, and `updatePrompt`.
222
- 4. Preserve the new status result and config ID if it changes.
223
- 5. Regenerate SDK only if manifest contract changed.
220
+ 2. Submit update through `external-ai-capability` with `updates: [{ capabilityName, updatePrompt }]`.
221
+ 3. Re-read `.howone/ai/manifest.json`; update may rotate `workflowId` to a fresh config UUID.
222
+ 4. Regenerate SDK bindings whenever the manifest `workflowId`, input schema, or output schema changed.
223
+ 5. Behavior-only updates still require checking the manifest before deciding SDK is unchanged.
224
224
 
225
- `workflowConfigID` is not `workflowId`.
225
+ The SDK does not use old `workflowConfigID` status values. It binds to the current manifest
226
+ `workflowId`, which is the EAX config id used in execution URLs.
226
227
 
227
228
  ## Handoff Checklist
228
229
 
@@ -61,7 +61,7 @@ Do not add one-off flags when an adapter/callback can express the behavior.
61
61
  | Auth | token source, session state, login/logout destination policy, hosted HowOne defaults | login page visuals, account menu, loading states, auth error UI |
62
62
  | React provider | context, auth callbacks, optional bottom-right HowOne `FloatingButton` logo | layout, toasts, overlays, route components, theme system |
63
63
  | Entities | typed CRUD/query clients, public/private routing, payload normalization | forms, list rendering, optimistic UI, field-level UX |
64
- | Schema | definition operations, preview/apply/version/restore calls | migration approval UI, admin experience |
64
+ | Schema | definition operations, apply/version/restore calls | migration approval UI, admin experience |
65
65
  | Entity contract utilities | payload whitelisting, public query guardrail validation, structured validation issues | deciding product copy, rendering validation errors |
66
66
  | AI workflows | run/stream/events, Zod validation, workflowId binding | progress UI, result rendering, failure surfaces |
67
67
  | AI persistence | pending-first orchestration helper, state callbacks, completed/failed mapping hook | choosing schema fields, retry UX, visible state UI |
@@ -1,10 +1,10 @@
1
- # Data Access Patterns
1
+ # Entity Data Access Patterns (App SDK)
2
2
 
3
3
  Use this reference to connect backend `access` design to frontend SDK calls. It answers:
4
4
  **which namespace should the app call, which filters are legal, and what must not be persisted?**
5
5
 
6
- For schema design, read `01-schema-design.md`. For query syntax details, read
7
- `04-query-dsl-and-responses.md`.
6
+ For schema design, read `02-entity-schema/01-schema-design.md`. For query syntax details, read
7
+ `12-query-dsl-and-responses.md`.
8
8
 
9
9
  ## Namespace Decision
10
10
 
@@ -14,7 +14,7 @@ For schema design, read `01-schema-design.md`. For query syntax details, read
14
14
  | Logged-in shared records | `howone.entities.Entity` | yes | `query`, `get`, CRUD |
15
15
  | Public list page | `howone.public.entities.Entity` | no | `query` |
16
16
  | Public scoped share/detail | `howone.public.entities.Entity` | no | `queryScoped`, `get` with scope options |
17
- | Schema tooling | `howone.schema` | yes | `previewPatch`, `applyPatch` |
17
+ | Schema tooling | `howone.schema` | yes | `applyPatch`, versions, restore |
18
18
  | Low-level fallback | `howone.raw` / `howone.public.raw` | depends | only when typed method missing |
19
19
 
20
20
  Do not mix authenticated and public namespaces for the same page without a clear reason.
@@ -1,4 +1,4 @@
1
- # Query DSL And Responses
1
+ # Entity Query DSL And Responses (App SDK)
2
2
 
3
3
  Use this reference when implementing list/detail pages, filters, sorting, pagination, or response
4
4
  normalization for HowOne dynamic entities.