harvask-cli 0.3.1 → 0.6.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 (40) hide show
  1. package/README.md +77 -3
  2. package/dist/api-client.js +23 -9
  3. package/dist/api-client.js.map +1 -1
  4. package/dist/cli.js +20 -1
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/attachment/index.js +11 -1
  7. package/dist/commands/attachment/index.js.map +1 -1
  8. package/dist/commands/issue/builds.js +4 -0
  9. package/dist/commands/issue/builds.js.map +1 -1
  10. package/dist/commands/issue/deliverable.js +93 -0
  11. package/dist/commands/issue/deliverable.js.map +1 -0
  12. package/dist/commands/issue/index.js +18 -2
  13. package/dist/commands/issue/index.js.map +1 -1
  14. package/dist/commands/project/builds.js +13 -9
  15. package/dist/commands/project/builds.js.map +1 -1
  16. package/dist/commands/project/index.js +2 -1
  17. package/dist/commands/project/index.js.map +1 -1
  18. package/dist/commands/scheduled-task/index.js +290 -47
  19. package/dist/commands/scheduled-task/index.js.map +1 -1
  20. package/dist/commands/storage/index.js +17 -1
  21. package/dist/commands/storage/index.js.map +1 -1
  22. package/dist/commands/workspace/batch.js +65 -0
  23. package/dist/commands/workspace/batch.js.map +1 -0
  24. package/dist/commands/workspace/collect.js +368 -0
  25. package/dist/commands/workspace/collect.js.map +1 -0
  26. package/dist/commands/workspace/index.js +240 -0
  27. package/dist/commands/workspace/index.js.map +1 -0
  28. package/dist/errors/hint-map.js +34 -0
  29. package/dist/errors/hint-map.js.map +1 -1
  30. package/dist/registry.js +2 -0
  31. package/dist/registry.js.map +1 -1
  32. package/dist/utils/input.js +14 -0
  33. package/dist/utils/input.js.map +1 -1
  34. package/dist/utils/upload.js +29 -0
  35. package/dist/utils/upload.js.map +1 -1
  36. package/package.json +1 -1
  37. package/skills/harvask/AGENTS.md +38 -3
  38. package/skills/harvask/GEMINI.md +38 -3
  39. package/skills/harvask/SKILL.md +38 -3
  40. package/skills/harvask/migration.md +72 -0
@@ -43,6 +43,12 @@ If a command fails with an auth error (exit code 3), run `harvask login` again.
43
43
  harvask issue assign -p PRJ 1234 --assignee-id 42
44
44
  ```
45
45
 
46
+ ## Migrating an existing project
47
+
48
+ Bringing a local directory (or another tool's export) into a harvask project has its own
49
+ rules — where files should go, what must never be uploaded, and why a live session blocks
50
+ writes. Read `migration.md` in this skill directory before pushing anything.
51
+
46
52
  ## project key vs id
47
53
 
48
54
  - Humans know the **key** (e.g. `PRJ`); the API uses a numeric **id**.
@@ -71,6 +77,25 @@ If a command fails with an auth error (exit code 3), run `harvask login` again.
71
77
  ```
72
78
  - The `api` escape hatch accepts a JSON body the same way (`@body.json`, `-`).
73
79
 
80
+ ## Deliverable declarations
81
+
82
+ - `issue create/update --deliverable <json>` attaches the deliverable the work
83
+ must produce (inline JSON, `@decl.json`, or `-`). Only `type`
84
+ (`text|file|none`) is required. Optional fields are `label`, `note`,
85
+ `required`, `rules` (`min_chars`, `max_chars`, `required_keywords`,
86
+ `required_headings`, `format`, `extensions`, `max_rework`), `judge`
87
+ (`enabled`, `criteria`), and `builder` (`enabled`, `instructions`).
88
+ ```
89
+ harvask issue create -p PRJ --title "Notice" --deliverable '{"type":"text","rules":{"min_chars":60}}'
90
+ harvask issue update -p PRJ PRJ-1 --deliverable null # remove the declaration
91
+ ```
92
+ - Omitting `--deliverable` on `update` leaves the declaration untouched.
93
+ - `issue show` returns `issue.deliverable` with three parts:
94
+ - `config`: the declaration
95
+ - `final`: the accepted deliverable (`content` or `attachment.download_url`)
96
+ - `history`: newest first, with `status`, `content_length`, and failed
97
+ `validation.checks[]`
98
+
74
99
  ## Common errors and what to do
75
100
 
76
101
  - **exit 3 / 401** — token invalid or expired → `harvask login --tenant <domain>`.
@@ -102,7 +127,7 @@ harvask login | logout | whoami
102
127
 
103
128
  # project-scoped (pass -p <key|id>)
104
129
  harvask project list | show <key|id> | create | members list|add|remove <key|id>
105
- harvask issue list | show | create | update | search | status | assign
130
+ harvask issue list | show | create | update (--deliverable <json|null>) | search | status | assign
106
131
  harvask issue comment list | create
107
132
  harvask issue todo list | show | create | update | delete
108
133
  harvask issue memory list | show | create | update | delete
@@ -111,9 +136,10 @@ harvask issue bulk-create | bulk-update (--items @file.json [--atomic])
111
136
  harvask wiki list | show | create | update (--base-version required) | search | set-home | history | delete | bulk-create | bulk-update
112
137
  harvask milestone list | create | update
113
138
  harvask workflow list | show | create | update | execute (non-idempotent, --yes required non-interactively)
114
- harvask scheduled-task list | show | create | update | delete
139
+ harvask scheduled-task list | show | create | update | execute (non-idempotent, --yes required non-interactively) | delete
115
140
  harvask file search | stats
116
- harvask storage list | search | stats | upload | folder | move | rename | delete | download | content
141
+ harvask storage list | search | stats | upload (--on-conflict rename|overwrite|error) | folder | move | rename | delete | download | content
142
+ harvask workspace push <dir> (--dest, --dry-run, --exclude) # local tree -> AI workspace
117
143
  harvask preview-config show | update
118
144
  harvask site-credential # list browser credentials
119
145
 
@@ -132,5 +158,14 @@ Notes:
132
158
  - `personal-wiki` is intentionally not available via the CLI.
133
159
  - File/binary: `storage upload` / `attachment upload` take `--file <path>`;
134
160
  `storage download` / `attachment download` save with `--out <path>`.
161
+ `attachment upload --type chat_message` also needs `--chat-id <id>`.
162
+ - `project create --key` is optional; without it the server derives a unique key
163
+ from `--name`.
164
+ - `scheduled-task` has three execution types: `issue`, `workflow` and `chat`
165
+ (`--chat-message` is the body, required for chat). `update` changes only the
166
+ fields you pass, including the schedule (`--frequency` / `--time` /
167
+ `--day-of-week` / `--day-of-month` / `--cron`). Fields that do not belong to
168
+ the resulting execution type are rejected by the CLI, because the server
169
+ silently drops them.
135
170
 
136
171
  Use `harvask <command> --help` for options, examples, and prerequisites.
@@ -0,0 +1,72 @@
1
+ # Migrating an existing local project into harvask
2
+
3
+ Use this when someone wants to bring a project that lives on their machine (or in another
4
+ tool) into a harvask project: source trees, design docs, spreadsheets, legacy assets.
5
+
6
+ ## First: pick the destination. They are not interchangeable.
7
+
8
+ | What you have | Where it goes | How |
9
+ |---|---|---|
10
+ | Code in a git repository | **Keep it in git.** Link the repo in the project settings (Web UI: Settings > Repository) | No migration needed — AI sessions clone it |
11
+ | Files the AI should work on directly: docs, data, assets, legacy scripts, a non-git tree | **AI workspace** (Files tab = `~/work` in AI sessions) | `harvask workspace push` |
12
+ | Reference documents people will search and share | **Storage** | `harvask storage upload` |
13
+ | Knowledge that should be read, edited and versioned as text | **Wiki** | `harvask wiki create` / `global-wiki` |
14
+
15
+ If the answer is "code that is already in git", say so and stop — pushing a clone into the
16
+ workspace duplicates it and the copies drift apart.
17
+
18
+ ## Workspace push
19
+
20
+ ```bash
21
+ harvask workspace push ./legacy-app -p PRJ --dest legacy --dry-run # plan only, sends nothing
22
+ harvask workspace push ./legacy-app -p PRJ --dest legacy --yes # do it
23
+ ```
24
+
25
+ Always run `--dry-run` first and show the plan (`would_create` / `would_overwrite` /
26
+ `skipped` / `excluded`) before sending anything. Overwrites are silent and there is no
27
+ version history, so `--yes` is required to overwrite in a non-interactive shell.
28
+
29
+ ### Rules that bite
30
+
31
+ - **Never push `.env` or credentials.** The CLI excludes `.env*` and cannot be told
32
+ otherwise, because the workspace is visible to every project member. If secrets are
33
+ needed by the AI, use project secrets (Web UI), not files.
34
+ - `.gitignore` is respected when the directory is a git repo (the CLI lets `git ls-files`
35
+ enumerate, so `.git/info/exclude` and your global gitignore count too). `node_modules/`,
36
+ `vendor/`, `dist/`, `build/`, `__pycache__/`, `.venv/`, `.DS_Store` are excluded by
37
+ default; `--include-ignored` (everything) or `--include <glob>` (one path) brings them
38
+ back. `--exclude <glob>` wins over `--include`.
39
+ - Windows binaries and scripts (`.exe .bat .cmd .ps1 .vbs .com .msi .dll`) cannot be
40
+ stored. They are reported as `skipped`, not treated as an error. `.sh` is allowed, but
41
+ the workspace has no execute bit — run it as `sh script.sh`.
42
+ - Do not push into `apps/` or `canvas/`. Mini-app sources plus their SQLite data and
43
+ Canvas documents live there; overwriting them breaks the running app. The CLI refuses
44
+ unless `--force`, and you should ask the user before reaching for it.
45
+ - Symlinks are not followed (reported as `excluded`), and empty directories are not
46
+ reproduced (object storage has no directories).
47
+
48
+ ### When it stops
49
+
50
+ - **409 `workspace_session_active`** — a mini-app or browser-agent session is live for
51
+ that project. Do **not** retry: while a session runs, the workspace is synced from the
52
+ session and anything you upload is silently rolled back. End the session, then push.
53
+ - **Invalid paths** — the dry run reports them and the CLI refuses to send. Those paths
54
+ can never be stored (`..`, empty segments, deeper than 20 levels); one bad path fails a
55
+ whole request, so fix or drop them.
56
+ - **Partial failure** — batches are not atomic. The result JSON lists `remaining`; re-run
57
+ the same command to continue. Re-uploading is safe: same path = overwrite.
58
+ - **413 / timeouts** on a slow link — send less per request with
59
+ `--max-batch-bytes 52428800` and re-run; what already landed is not sent again.
60
+
61
+ ## After the files land
62
+
63
+ Migration is not finished when the bytes arrive. Leave the AI something to work from:
64
+
65
+ 1. Tell the user what landed and where (`--dest` path), and what was skipped or excluded.
66
+ 2. Write down what the project is, how it runs, and what is missing — a project Wiki page
67
+ (`harvask wiki create -p PRJ`) is the right home; the AI reads it before working.
68
+ 3. If the migration exists to get work done, file the first issue
69
+ (`harvask issue create -p PRJ`) describing that work.
70
+
71
+ Check the result in the Files tab (`/projects/{id}/files`) or with a fresh `--dry-run`:
72
+ everything should now report as `would_overwrite`, nothing as `would_create`.