@dayofweek/dcli 1.4.0 → 1.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.
package/README.md CHANGED
@@ -85,6 +85,81 @@ https://field.dayofweek.com/brain/<areaId>/source/<sourceId>
85
85
 
86
86
  Unknown hosts, user-info, ports, query strings, fragments, encoded path separators, malformed identifiers, and oversized input are rejected before any API request.
87
87
 
88
+ ## Entity knowledge
89
+
90
+ Knowledge documents attached to an entity — read them, add to them, mirror them
91
+ out into another knowledge base.
92
+
93
+ ```bash
94
+ # Read
95
+ dcli knowledge list --entity <entityId> --json
96
+ dcli knowledge list --entity <entityId> --full --json # whole content, not excerpts
97
+ dcli knowledge get <documentId> --json
98
+ dcli knowledge search "cold chain" --entity <entityId> --json
99
+
100
+ # Add a markdown note — submitted for human review
101
+ dcli knowledge add --entity <entityId> --title "Variety catalogue" --file note.md
102
+
103
+ # Mirror an entity's sources to disk as markdown with provenance front-matter
104
+ dcli knowledge export --entity <entityId> --out ./knowledge
105
+ ```
106
+
107
+ `add` submits a proposal by default: a person approves it before it lands. If
108
+ your token has admin rights you can pass `--direct` to skip review, and
109
+ `dcli knowledge attach --file article.pdf` to upload a binary source. Both write
110
+ immediately, so treat them as something you do when a person has asked for that
111
+ specific document — not as the normal path. The server rejects them for
112
+ non-admin tokens.
113
+
114
+ ## Datasets
115
+
116
+ The platform offers additional read-only datasets beyond entities and
117
+ knowledge. The catalog is server-owned and discovered at runtime — what
118
+ `data list` returns is exactly what your credential may read.
119
+
120
+ ```bash
121
+ dcli data list --json
122
+ dcli data get <dataset> --limit 100 --json
123
+ ```
124
+
125
+ Responses are `{ dataset, total, truncated, rows }`. The CLI has no built-in
126
+ dataset names; new datasets appear in the listing without a CLI update.
127
+
128
+ ## Feedback backlog
129
+
130
+ The customer feedback backlog that humans and coding agents work together.
131
+
132
+ ```bash
133
+ dcli feedback next --json # what should I work on next
134
+ dcli feedback list --status backlog --json
135
+ dcli feedback show <itemId> --json
136
+ dcli feedback claim <itemId> --json # signal that you picked it up
137
+ dcli feedback comment <itemId> --body "Fixed in #482"
138
+ dcli feedback status <itemId> --status shipped
139
+ ```
140
+
141
+ Access follows the token's scopes: `read:feedback` for the reads,
142
+ `write:feedback` to comment, `admin:feedback` for claim/status/priority.
143
+ Day of Week staff hold all three implicitly.
144
+
145
+ ## Customer emails (staff)
146
+
147
+ Mail sent to a customer's own inbox address becomes a thread you can answer.
148
+ The commands appear once `dcli auth status` has cached your admin role.
149
+
150
+ ```bash
151
+ dcli emails list --status needs_reply --json
152
+ dcli emails show <threadKey> --json
153
+ dcli emails reply <threadKey> --message "..." --approved
154
+ dcli emails compose --entity <entityId> --to person@example.com \
155
+ --subject "..." --message "..." --approved
156
+ ```
157
+
158
+ `reply` and `compose` refuse to run without `--approved`. Sending mail as a
159
+ customer is irreversible and outward-facing, so it cannot happen as a side
160
+ effect of reading the inbox — a person approves the exact text first, and
161
+ `--approved` records that they did.
162
+
88
163
  ## Legacy platform commands
89
164
 
90
165
  Existing read/proposal workflows remain compatible:
@@ -109,11 +184,31 @@ Development commands:
109
184
  ```bash
110
185
  npm install
111
186
  npm test
112
- npm run build
187
+ npm run build # tsc + the dependency-free bundle
188
+ npm run build:bundle # just dist/bundle/dcli.cjs
113
189
  npm run standalone:build
114
190
  npm run standalone:smoke
115
191
  ```
116
192
 
193
+ ### What gets published
194
+
195
+ `npm run build` produces two runnable forms, and both ship:
196
+
197
+ - **`dist/bin/dcli.js`** — the normal entry point, the one `bin` points at. It
198
+ imports `commander` and `open` from `node_modules`, which is exactly right
199
+ when npm installed the package.
200
+ - **`dist/bundle/dcli.cjs`** — the same CLI with its dependencies compiled in,
201
+ runnable straight from an unpacked tarball.
202
+
203
+ The bundle exists for consumers that unpack the tarball themselves instead of
204
+ installing it, the Day of Week desktop app being the one that matters: it fetches
205
+ the published package and runs it with Electron's Node, so a customer with no
206
+ `node` and no `npm` still gets a working `dcli`. Without the bundle that install
207
+ starts and immediately fails on a missing `commander`.
208
+
209
+ Keep both. Dropping `dist/bundle/` from `files` silently breaks the desktop app's
210
+ dcli updates.
211
+
117
212
  ## License
118
213
 
119
214
  MIT