@hiveku-apps/sync 0.5.5 → 0.5.7

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
@@ -11,8 +11,8 @@ Local sync CLI for a Hiveku account. Pairs with the Hiveku MCP server at
11
11
  (id, name, type, domain, owner, version, updated_at).
12
12
  It also writes the account memory (see "Account memory" below) to
13
13
  `hiveku-data/account/ACCOUNT_MEMORY.md`, read-only, and brings the folder
14
- layout and memory rules in `CLAUDE.md` up to date (see "CLAUDE.md stays
15
- current" below).
14
+ layout, the memory rules and the plan rules in `CLAUDE.md` up to date (see
15
+ "CLAUDE.md stays current" below).
16
16
 
17
17
  The goal: open one folder per Hiveku tenant in VS Code with Claude Code,
18
18
  with the account's memory mirrored as local `.md` files Claude can read
@@ -347,7 +347,8 @@ region `hiveku-sync codex` rewrites.
347
347
  ## CLAUDE.md stays current
348
348
 
349
349
  `init` writes `CLAUDE.md` once, and the rest of the file is yours from then on,
350
- except its "Folder layout" and "Memory writes" sections. They sit between
350
+ except its "Folder layout", "Memory writes" and "Your plan and its limits"
351
+ sections. They sit between
351
352
  `<!-- hiveku:memory:begin -->` and `<!-- hiveku:memory:end -->`, and `pull` (and
352
353
  `codex`) bring them up to date, so a folder an older release made stops teaching
353
354
  the old layout and the old `memory_update` call:
@@ -363,6 +364,12 @@ The kept-current part also states that Hiveku Memory is the source of truth,
363
364
  in the Hiveku MCP server's own words, and that the local files are a mirror
364
365
  memory wins over. `AGENTS.md` says the same.
365
366
 
367
+ Since 0.5.6 it also carries the account's plan and its limits, in the words
368
+ Hiveku writes once for every agent (copied byte for byte and pinned by
369
+ sha256): call `account_usage_get` before work the plan counts, and a tool
370
+ answer with `limit_kind` is the plan's answer, not a fault, so tell the person
371
+ and never retry or report it. `AGENTS.md` carries the one-line version.
372
+
366
373
  A `CLAUDE.md` that is read-only, a link to another file, or whose markers are not
367
374
  there once each and in order is left alone (`pull` says so). `pull` never creates
368
375
  a missing one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiveku-apps/sync",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Sync a Hiveku account's memory/rules/skills + coder projects into a local folder, and ship projects (push/deploy/pull-env) from the terminal. Pairs with the Hiveku MCP at core.hiveku.com/mcp so Claude Code can drive Hiveku tools per-folder.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/claude-md.mjs CHANGED
@@ -2,7 +2,8 @@
2
2
  * The part of an account folder's CLAUDE.md that hiveku-sync keeps current:
3
3
  * the folder layout and the memory-write rules, between two markers. Since
4
4
  * 2026-10-03 it also states that Hiveku Memory is the source of truth (the MCP
5
- * server's words) and that the local files are a mirror memory wins over.
5
+ * server's words) and that the local files are a mirror memory wins over, and
6
+ * since 0.5.6 the account's plan and its limits (the builder's words, pinned).
6
7
  *
7
8
  * `init` writes CLAUDE.md once. Everything outside the markers is the user's
8
9
  * from then on, but the layout and the memory rules change with releases
@@ -55,6 +56,42 @@ export const WORK_LOG_LINE =
55
56
  "Hiveku records this session's Doing at its first change and its Done when the session goes quiet " +
56
57
  'or ends. When the work ends, send a Done with `memory_log_add` and a one-line summary of what you ' +
57
58
  'did, if you want the log to say more than the count of changes; leave `thread` out.';
59
+
60
+ /**
61
+ * What every agent is told about the account's plan and its limits, written once
62
+ * in the builder (hiveku_builder src/lib/platform-guide/plan-usage.ts, builder
63
+ * #1332, served with no key at /api/public/platform-guide/plan-usage) and copied
64
+ * here byte for byte, as the MCP server, the agent servers, the Claude Code and
65
+ * Codex plugins and the VS Code extension copy it. test/claude-md.test.mjs pins
66
+ * both texts to the builder's sha256, so a change there is a change here, made on
67
+ * purpose. Never reword them.
68
+ *
69
+ * PLAN_USAGE_RULES, the full block, is the kept-current part's "Your plan and its
70
+ * limits" section, so `pull` brings it to folders an earlier release made.
71
+ */
72
+ export const PLAN_USAGE_RULES = `Hiveku rules: the account's plan and its limits
73
+ - Every paid plan (Starter, Standard, Premium) opens every feature except the Outbound add-on. Plans differ in how much of each thing they include.
74
+ - Before work that adds something the plan counts (a contact import, a marketing send, phone numbers, social profiles, ad campaigns, websites, automations, databases, AI images or video), call account_usage_get and tell the person what the plan includes, what is used and what happens past the number.
75
+ - A tool answer with limit_kind is not a fault: nothing was done. Never retry it unchanged, never look for a way around it, and never report it as a Hiveku problem. Tell the person in one or two calm sentences what waits and why (the answer's message), and do what its hint says.
76
+ - When limit_kind is plan_limit, not_on_plan or ai_credits, also say when it starts again (resets_at, if any), and the next plan with its number and price (next_plan, next_limit, plans). An owner or admin can upgrade in Settings > Billing (billing_url). When try_next_plan.available is true, they can instead try the next plan free for 14 days, once (try_next_plan.how says where). For billing, add_on, setup and spend_cap, say only what the message and the hint say.
77
+ - Where past is billed, going past the number costs money (rate, up to ceiling): say what it costs before you go past it.
78
+ - Take every number, price and date from account_usage_get or the answer itself, never from memory. Never change the plan, start a try or buy credits or add-ons: an owner or admin does that (billing_url, try_next_plan.how and features.outbound.how say where).
79
+ - Say this only to the account's own people, never to a customer or caller.`;
80
+
81
+ /**
82
+ * The builder's PLAN_LIMIT_LINE (same source and pins as PLAN_USAGE_RULES): one
83
+ * line for AGENTS.md's "Hiveku itself in your way?" item, right after the
84
+ * memory_write_refused sentence (codex.mjs), so a tool refused at the plan's
85
+ * number is told to the person and never retried or reported.
86
+ */
87
+ export const PLAN_LIMIT_LINE =
88
+ "A tool answer with limit_kind (a plan's number reached, something the plan does not include, AI " +
89
+ "credits used up, billing that needs attention, an add-on or phones not set up, a chat's spending " +
90
+ 'limit reached) is not a fault: nothing was done. Never retry it unchanged or report it; tell the ' +
91
+ 'person its message and do what its hint says. Only for plan_limit, not_on_plan and ai_credits, also ' +
92
+ 'say when it starts again and the next plan and its number, using account_usage_get or the answer for ' +
93
+ 'every number, and point an owner or admin to its billing_url.';
94
+
58
95
  export const CLAUDE_MD_END = '<!-- hiveku:memory:end -->';
59
96
 
60
97
  /** The kept-current part: the markers and the two sections between them. */
@@ -62,8 +99,9 @@ export function claudeMdMemoryRegion() {
62
99
  return `${CLAUDE_MD_BEGIN}
63
100
  ## Folder layout
64
101
 
65
- \`hiveku-sync pull\` keeps this section and "Memory writes" below current. Where
66
- anything else in this file disagrees with them, follow these two sections.
102
+ \`hiveku-sync pull\` keeps this section, "Memory writes" and "Your plan and its
103
+ limits" below current. Where anything else in this file disagrees with them,
104
+ follow these three sections.
67
105
 
68
106
  ${SOURCE_OF_TRUTH_LINE}
69
107
  ${WORK_LOG_LINE}
@@ -143,6 +181,10 @@ keeps or removes it), and tell the user that owners and admins edit it on the
143
181
  Hiveku dashboard under Account memory.
144
182
 
145
183
  Then run \`hiveku-sync pull\` to refresh the local copies.
184
+
185
+ ## Your plan and its limits
186
+
187
+ ${PLAN_USAGE_RULES}
146
188
  ${CLAUDE_MD_END}`;
147
189
  }
148
190
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "locus2012/hiveku-codex-plugin feature/secrets-b3-declare-client (4f9d569, 0.3.14), plugins/hiveku/.mcp.json: every hiveku.tools entry with approval_mode \"prompt\" (project_vcs_rollback included)",
2
+ "source": "locus2012/hiveku-codex-plugin feature/lead-email-tools-prompt (a225436, on 0.3.19), plugins/hiveku/.mcp.json: every hiveku.tools entry with approval_mode \"prompt\" (project_vcs_rollback included)",
3
3
  "why": "hiveku-sync writes its own [mcp_servers.hiveku] into a Codex folder. Codex then uses that entry, not the plugin's, for the server's connection and for every tool's approval mode, so these prompts must be written here too. Refresh this list whenever the Codex plugin's prompt list changes.",
4
4
  "tools": [
5
5
  "deploy_site",
@@ -281,6 +281,11 @@
281
281
  "cms_delete_entry",
282
282
  "cms_bulk_delete",
283
283
  "cms_delete_collection",
284
- "cms_remove_field"
284
+ "cms_remove_field",
285
+ "mobile_app_sdk_upgrade",
286
+ "mobile_app_identity_set",
287
+ "mobile_app_apple_account_set",
288
+ "ppc_recent_change_override",
289
+ "marketing_form_notifications_update"
285
290
  ]
286
291
  }
package/src/codex.mjs CHANGED
@@ -45,7 +45,7 @@ import { formatKey, readTomlDeclarations } from './toml.mjs';
45
45
  import { loadDotenv, safeSlug } from './util.mjs';
46
46
  import { ownerFolder } from './knowledge-files.mjs';
47
47
  import { SHARED_OWNER, ownerLabel, ownerOrder } from './memory-owner.mjs';
48
- import { SOURCE_OF_TRUTH_LINE, WORK_LOG_LINE } from './claude-md.mjs';
48
+ import { PLAN_LIMIT_LINE, SOURCE_OF_TRUTH_LINE, WORK_LOG_LINE } from './claude-md.mjs';
49
49
 
50
50
  /**
51
51
  * The FIXED list of high-risk Hiveku tools that Codex asks about before
@@ -212,6 +212,7 @@ ${digest}
212
212
  - **Hiveku itself in your way?** A Hiveku tool still failing after one sensible retry → \`hiveku_report_issue\`;
213
213
  a capability no tool offers (search \`hiveku_docs_search\` first) → \`hiveku_request_feature\`. No secrets or personal data.
214
214
  A memory write refused with \`memory_write_refused\` is not a failure: show the person its message and link, follow its hint, and never retry it unchanged or report it.
215
+ ${PLAN_LIMIT_LINE}
215
216
  - **Tell the user only if it changes what they get:** one or two calm sentences — flagged to the Hiveku team (give the
216
217
  ref), the team is quick to fix these, you'll let them know when it's sorted. No error codes, blame or promised times.
217
218
  - Video generation is paid + capped — \`marketing_generate_video\` with \`dry_run: true\` first.