@promptctl/cc-candybar 1.42.1 → 1.43.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 (126) hide show
  1. package/dist/index.mjs +72 -71
  2. package/package.json +5 -6
  3. package/src/check.ts +0 -478
  4. package/src/cli-flags.ts +0 -8
  5. package/src/click/wire.ts +0 -158
  6. package/src/config/action.ts +0 -329
  7. package/src/config/cli.ts +0 -71
  8. package/src/config/default-dsl-config.ts +0 -1645
  9. package/src/config/disclosure.ts +0 -170
  10. package/src/config/dsl-loader.ts +0 -339
  11. package/src/config/dsl-types.ts +0 -581
  12. package/src/config/edit-chrome.ts +0 -559
  13. package/src/config/help.ts +0 -151
  14. package/src/config/ident.ts +0 -22
  15. package/src/config/layout-ops.ts +0 -177
  16. package/src/config/loader/actions.ts +0 -972
  17. package/src/config/loader/cache.ts +0 -206
  18. package/src/config/loader/cross-ref.ts +0 -714
  19. package/src/config/loader/cycles.ts +0 -148
  20. package/src/config/loader/diagnostics.ts +0 -99
  21. package/src/config/loader/discovery.ts +0 -182
  22. package/src/config/loader/edit-mode.ts +0 -137
  23. package/src/config/loader/emit-schema.ts +0 -68
  24. package/src/config/loader/globals.ts +0 -269
  25. package/src/config/loader/helpers.ts +0 -48
  26. package/src/config/loader/layout.ts +0 -693
  27. package/src/config/loader/looks.ts +0 -96
  28. package/src/config/loader/menu-synth.ts +0 -435
  29. package/src/config/loader/merge.ts +0 -115
  30. package/src/config/loader/persist-target.ts +0 -67
  31. package/src/config/loader/presets.ts +0 -119
  32. package/src/config/loader/refs.ts +0 -100
  33. package/src/config/loader/reserved-namespace.ts +0 -38
  34. package/src/config/loader/segments.ts +0 -120
  35. package/src/config/loader/validate-core.ts +0 -737
  36. package/src/config/loader/variables.ts +0 -260
  37. package/src/config/menu-keys.ts +0 -139
  38. package/src/config/option-domain.ts +0 -164
  39. package/src/config/presets.ts +0 -326
  40. package/src/config/settings-menu.ts +0 -775
  41. package/src/daemon/acquire.ts +0 -684
  42. package/src/daemon/cache/git.ts +0 -649
  43. package/src/daemon/cache/render.ts +0 -623
  44. package/src/daemon/cache/session-usage-store.ts +0 -720
  45. package/src/daemon/cache/watchers.ts +0 -249
  46. package/src/daemon/client-debug.ts +0 -120
  47. package/src/daemon/client-stats.ts +0 -130
  48. package/src/daemon/client-transport.ts +0 -273
  49. package/src/daemon/client.ts +0 -78
  50. package/src/daemon/config-overrides-store.ts +0 -663
  51. package/src/daemon/debug-types.ts +0 -91
  52. package/src/daemon/debug.ts +0 -264
  53. package/src/daemon/fork-bomb-breaker.ts +0 -351
  54. package/src/daemon/limits.ts +0 -211
  55. package/src/daemon/log.ts +0 -81
  56. package/src/daemon/parent-watchdog.ts +0 -87
  57. package/src/daemon/paths.ts +0 -211
  58. package/src/daemon/process-fingerprint.ts +0 -146
  59. package/src/daemon/protocol.ts +0 -292
  60. package/src/daemon/render-payload.ts +0 -1256
  61. package/src/daemon/server.ts +0 -1330
  62. package/src/daemon/session-state-file.ts +0 -108
  63. package/src/daemon/session-state.ts +0 -237
  64. package/src/daemon/socket-lease.ts +0 -209
  65. package/src/daemon/socket-ownership.ts +0 -209
  66. package/src/daemon/stats.ts +0 -235
  67. package/src/daemon/verbs/config-validators.ts +0 -250
  68. package/src/daemon/verbs/index.ts +0 -706
  69. package/src/daemon/verbs/state-validators.ts +0 -249
  70. package/src/daemon/verbs/validator-registry.ts +0 -457
  71. package/src/demo/dsl.ts +0 -143
  72. package/src/demo/mock-data.ts +0 -67
  73. package/src/demo/statusline.json5 +0 -94
  74. package/src/dsl/node-registry.ts +0 -374
  75. package/src/dsl/render.ts +0 -803
  76. package/src/help-text.ts +0 -90
  77. package/src/index.ts +0 -210
  78. package/src/install/currency.ts +0 -197
  79. package/src/install/index.ts +0 -557
  80. package/src/proc/launch.ts +0 -459
  81. package/src/proc/stats-handle.ts +0 -13
  82. package/src/render/action.ts +0 -883
  83. package/src/render/active-segment.ts +0 -78
  84. package/src/render/diagnostic-style.ts +0 -23
  85. package/src/render/diagnostic-text.ts +0 -77
  86. package/src/render/error-glyph.ts +0 -53
  87. package/src/render/menu.ts +0 -257
  88. package/src/render/outcome-plan.ts +0 -45
  89. package/src/render/picker.ts +0 -372
  90. package/src/render/segment-color.ts +0 -74
  91. package/src/render/split-lines.ts +0 -51
  92. package/src/render/strip.ts +0 -228
  93. package/src/segments/cache.ts +0 -131
  94. package/src/segments/context.ts +0 -190
  95. package/src/segments/git.ts +0 -1084
  96. package/src/segments/metrics.ts +0 -187
  97. package/src/segments/pricing.ts +0 -452
  98. package/src/segments/session.ts +0 -23
  99. package/src/segments/tmux.ts +0 -74
  100. package/src/template-engine/cells.ts +0 -90
  101. package/src/template-engine/colors.ts +0 -124
  102. package/src/template-engine/engine.ts +0 -108
  103. package/src/template-engine/funcs.ts +0 -232
  104. package/src/template-engine/index.ts +0 -11
  105. package/src/template-engine/layout.ts +0 -133
  106. package/src/template-engine/scope.ts +0 -62
  107. package/src/template-engine/sparkline.ts +0 -79
  108. package/src/themes/index.ts +0 -20
  109. package/src/themes/palette-resolvers.ts +0 -84
  110. package/src/themes/policy.ts +0 -393
  111. package/src/utils/cache.ts +0 -206
  112. package/src/utils/claude.ts +0 -683
  113. package/src/utils/color-support.ts +0 -118
  114. package/src/utils/formatters.ts +0 -99
  115. package/src/utils/logger.ts +0 -5
  116. package/src/utils/outcome.ts +0 -33
  117. package/src/utils/schema-validator.ts +0 -126
  118. package/src/utils/single-flight.ts +0 -57
  119. package/src/utils/terminal-width.ts +0 -51
  120. package/src/utils/terminal.ts +0 -11
  121. package/src/utils/transcript-fs.ts +0 -279
  122. package/src/var-system/index.ts +0 -24
  123. package/src/var-system/sources.ts +0 -1047
  124. package/src/var-system/store.ts +0 -223
  125. package/src/var-system/types.ts +0 -57
  126. package/src/version.ts +0 -17
@@ -1,206 +0,0 @@
1
- // [LAW:types-are-the-program] The cache-policy schema: a CacheDecl is exactly one
2
- // of ttl / watch_file / depends_on / key / never, declared as DATA (CACHE_SCHEMA)
3
- // and interpreted by the tag-by-present-key engine (oneOfPresent).
4
- // requireCache/optionalCache gate presence by source kind. This file changes when
5
- // the cache vocabulary changes — add an arm to CACHE_SCHEMA and CacheDecl.
6
-
7
- import {
8
- CACHE_KEYS,
9
- SOURCES_REQUIRING_CACHE,
10
- type CacheDecl,
11
- type SourceKind,
12
- type TtlCacheDecl,
13
- } from "../dsl-types.js";
14
- import { findKeyLine } from "./diagnostics.js";
15
- import {
16
- describeValue,
17
- oneOfPresent,
18
- oneOfPresentJson,
19
- type FieldSpec,
20
- type JsonNode,
21
- type OneOfPresentSchema,
22
- type ValidateCtx,
23
- } from "./validate-core.js";
24
-
25
- export function requireCache(
26
- ctx: ValidateCtx,
27
- path: string,
28
- raw: Record<string, unknown>,
29
- kind: SourceKind,
30
- ): CacheDecl | null {
31
- if (raw.cache === undefined) {
32
- if (SOURCES_REQUIRING_CACHE.includes(kind)) {
33
- ctx.issues.push({
34
- path: `${path}.cache`,
35
- message: `${kind} variables must declare a cache policy (one of: ${CACHE_KEYS.join(", ")})`,
36
- line: findKeyLine(ctx.source, path.split(".")),
37
- });
38
- return null;
39
- }
40
- // For kinds where cache is optional and absent, this path is unreachable
41
- // because callers use optionalCache; keep narrow.
42
- return null;
43
- }
44
- return validateCache(ctx, `${path}.cache`, raw.cache);
45
- }
46
-
47
- export function optionalCache(
48
- ctx: ValidateCtx,
49
- path: string,
50
- raw: Record<string, unknown>,
51
- ): CacheDecl | undefined {
52
- if (raw.cache === undefined) return undefined;
53
- const c = validateCache(ctx, `${path}.cache`, raw.cache);
54
- return c ?? undefined;
55
- }
56
-
57
- // [LAW:dataflow-not-control-flow] The `cache` field as a record-field spec, so a
58
- // per-kind variable schema declares its cache policy as DATA. `kind` selects the
59
- // requiredness: file/shell/git require it (a missing cache reports the per-kind
60
- // message and fails the arm); template leaves it optional; time is optional but
61
- // ttl-only (ttlOnlyCacheSpec below). The field key is conventionally "cache",
62
- // read directly by requireCache/optionalCache.
63
- export function requireCacheSpec(kind: SourceKind): FieldSpec<CacheDecl> {
64
- return {
65
- required: true,
66
- json: cacheJson(),
67
- parse: (ctx, path, _field, raw) =>
68
- requireCache(ctx, path, raw, kind) ?? undefined,
69
- };
70
- }
71
-
72
- export function optionalCacheSpec(): FieldSpec<CacheDecl> {
73
- return {
74
- required: false,
75
- json: cacheJson(),
76
- parse: (ctx, path, _field, raw) => optionalCache(ctx, path, raw),
77
- };
78
- }
79
-
80
- // [LAW:single-enforcer] One arm helper to push a variant's bespoke message and
81
- // drop — the message is the only thing that varies per arm, carried as DATA.
82
- function reject<M>(ctx: ValidateCtx, path: string, message: string): M | null {
83
- ctx.issues.push({
84
- path,
85
- message,
86
- line: findKeyLine(ctx.source, path.split(".")),
87
- });
88
- return null;
89
- }
90
-
91
- // [LAW:types-are-the-program] The cache schema declared as DATA: arm keys in
92
- // CACHE_KEYS order (the structural messages join them), each arm carrying its
93
- // value-validation predicate and bespoke message. The literal "cache.<key>"
94
- // prefix is the contract text, independent of the runtime path used for line.
95
- // [LAW:one-source-of-truth] Each arm's `json` is the schema for the VALUE at its
96
- // present key — duration/path/key are strings, depends_on a string array, never
97
- // the literal true; the duration FORMAT (and non-empty) is a semantic check the
98
- // validator keeps (a JSON Schema `pattern` could mirror it, but the loader's
99
- // duration grammar is the single authority, so the schema stays at `type:string`).
100
- const CACHE_SCHEMA: OneOfPresentSchema<CacheDecl> = {
101
- noun: "cache",
102
- arms: {
103
- ttl: {
104
- json: { type: "string" },
105
- parse: (ctx, path, value) =>
106
- typeof value === "string" && isValidDuration(value)
107
- ? { ttl: value }
108
- : reject(
109
- ctx,
110
- path,
111
- `cache.ttl must be a duration string like "5s", "100ms", "2m", "1h"; got ${describeValue(value)}`,
112
- ),
113
- },
114
- watch_file: {
115
- json: { type: "string" },
116
- parse: (ctx, path, value) =>
117
- typeof value === "string" && value !== ""
118
- ? { watch_file: value }
119
- : reject(
120
- ctx,
121
- path,
122
- `cache.watch_file must be a non-empty path string, got ${describeValue(value)}`,
123
- ),
124
- },
125
- depends_on: {
126
- json: { type: "array", items: { type: "string" } },
127
- parse: (ctx, path, value) =>
128
- Array.isArray(value) && value.every((v) => typeof v === "string")
129
- ? { depends_on: value as string[] }
130
- : reject(
131
- ctx,
132
- path,
133
- `cache.depends_on must be an array of variable-name strings, got ${describeValue(value)}`,
134
- ),
135
- },
136
- key: {
137
- json: { type: "string" },
138
- parse: (ctx, path, value) =>
139
- typeof value === "string" && value !== ""
140
- ? { key: value }
141
- : reject(
142
- ctx,
143
- path,
144
- `cache.key must be a non-empty template string, got ${describeValue(value)}`,
145
- ),
146
- },
147
- never: {
148
- json: { const: true },
149
- parse: (ctx, path, value) =>
150
- value === true
151
- ? { never: true }
152
- : reject(
153
- ctx,
154
- path,
155
- `cache.never must be the literal boolean true, got ${describeValue(value)}`,
156
- ),
157
- },
158
- },
159
- };
160
-
161
- function validateCache(
162
- ctx: ValidateCtx,
163
- path: string,
164
- raw: unknown,
165
- ): CacheDecl | null {
166
- return oneOfPresent(ctx, CACHE_SCHEMA, path, raw);
167
- }
168
-
169
- // [LAW:types-are-the-program] The ttl-only subset for kinds whose runtime
170
- // honors no other invalidation (time vars refresh on a clock; declareTime
171
- // always registers a TTL timer). OneOfPresentSchema<TtlCacheDecl> forces
172
- // exactly the ttl arm at compile time, and the arm is CACHE_SCHEMA's own —
173
- // a subset of the vocabulary, never a parallel grammar. A non-ttl form is a
174
- // load-time diagnostic naming ttl as the only supported key, replacing the
175
- // runtime's former silent coercion to the default TTL [LAW:no-silent-failure].
176
- const TTL_ONLY_CACHE_SCHEMA: OneOfPresentSchema<TtlCacheDecl> = {
177
- noun: "time-variable cache",
178
- arms: { ttl: CACHE_SCHEMA.arms.ttl },
179
- };
180
-
181
- export function ttlOnlyCacheSpec(): FieldSpec<TtlCacheDecl> {
182
- return {
183
- required: false,
184
- json: oneOfPresentJson(TTL_ONLY_CACHE_SCHEMA),
185
- parse: (ctx, path, _field, raw) =>
186
- raw.cache === undefined
187
- ? undefined
188
- : (oneOfPresent(
189
- ctx,
190
- TTL_ONLY_CACHE_SCHEMA,
191
- `${path}.cache`,
192
- raw.cache,
193
- ) ?? undefined),
194
- };
195
- }
196
-
197
- // [LAW:one-source-of-truth] The cache emitter derives from the SAME CACHE_SCHEMA
198
- // the validator interprets — shared by the per-kind variable cache fields.
199
- export function cacheJson(): JsonNode {
200
- return oneOfPresentJson(CACHE_SCHEMA);
201
- }
202
-
203
- const DURATION_RE = /^(\d+(?:\.\d+)?)(ms|s|m|h)$/;
204
- function isValidDuration(s: string): boolean {
205
- return DURATION_RE.test(s);
206
- }