create-principles-disciple 1.147.16 → 1.147.18
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/_release/product-identity.json +2 -2
- package/codex-adapter/package.json +1 -1
- package/core/dist/host/host-installer.d.ts +11 -0
- package/core/dist/host/host-installer.d.ts.map +1 -1
- package/core/dist/host/host-installer.js.map +1 -1
- package/core/dist/runtime/index.d.ts +2 -2
- package/core/dist/runtime/index.d.ts.map +1 -1
- package/core/dist/runtime/index.js +1 -1
- package/core/dist/runtime/index.js.map +1 -1
- package/core/dist/runtime/types/event-types.d.ts +62 -3
- package/core/dist/runtime/types/event-types.d.ts.map +1 -1
- package/core/dist/runtime/types/event-types.js +43 -0
- package/core/dist/runtime/types/event-types.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/installer.d.ts +20 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +75 -12
- package/dist/installer.js.map +1 -1
- package/dist/installers/codex-host-installer.d.ts +21 -0
- package/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/dist/installers/codex-host-installer.js +105 -4
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/dist/installers/workbuddy-host-installer.d.ts +2 -2
- package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
- package/dist/installers/workbuddy-host-installer.js +23 -7
- package/dist/installers/workbuddy-host-installer.js.map +1 -1
- package/host-runtime/dist/active-principle-prompt.d.ts +24 -0
- package/host-runtime/dist/active-principle-prompt.js +36 -0
- package/host-runtime/dist/product-telemetry/consent-store.d.ts +112 -14
- package/host-runtime/dist/product-telemetry/consent-store.js +343 -132
- package/host-runtime/dist/product-telemetry/control-state-lock.d.ts +99 -0
- package/host-runtime/dist/product-telemetry/control-state-lock.js +320 -0
- package/host-runtime/dist/product-telemetry/service.d.ts +26 -9
- package/host-runtime/dist/product-telemetry/service.js +90 -150
- package/host-runtime/dist/signal-stage2-cycle.js +8 -1
- package/host-runtime/package.json +1 -1
- package/install-layout/dist/index.d.ts +49 -0
- package/install-layout/dist/index.js +59 -0
- package/install-layout/package.json +1 -1
- package/package.json +4 -4
- package/pd-cli/dist/commands/health-workbuddy.d.ts +31 -0
- package/pd-cli/dist/commands/health-workbuddy.d.ts.map +1 -0
- package/pd-cli/dist/commands/health-workbuddy.js +192 -0
- package/pd-cli/dist/commands/health-workbuddy.js.map +1 -0
- package/pd-cli/dist/commands/health.d.ts.map +1 -1
- package/pd-cli/dist/commands/health.js +12 -0
- package/pd-cli/dist/commands/health.js.map +1 -1
- package/pd-cli/dist/commands/telemetry.d.ts.map +1 -1
- package/pd-cli/dist/commands/telemetry.js +3 -1
- package/pd-cli/dist/commands/telemetry.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +429 -428
- package/plugin/dist/core/event-log.d.ts +8 -1
- package/plugin/dist/governance-audit.js +2 -2
- package/plugin/dist/hooks/llm-input-presence.d.ts +42 -0
- package/plugin/dist/hooks/prompt-presence-expectations.d.ts +6 -1
- package/plugin/dist/hooks/prompt-presence-lite.d.ts +53 -0
- package/plugin/dist/hooks/prompt-presence-measure.d.mts +1 -0
- package/plugin/dist/hooks/prompt-presence-registry.d.ts +150 -0
- package/plugin/dist/openclaw-sdk.d.ts +17 -0
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/types/event-types.d.ts +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/release-manager/dist/installer.js +75 -12
- package/release-manager/dist/installers/codex-host-installer.js +105 -4
- package/release-manager/dist/installers/workbuddy-host-installer.js +23 -7
- package/release-manager/package.json +1 -1
- package/workbuddy-adapter/package.json +1 -1
|
@@ -14,15 +14,37 @@
|
|
|
14
14
|
* (HMAC(secret, canonical workspace path); never uploaded). One
|
|
15
15
|
* workspace succeeding must never suppress another workspace's export.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* Single-format contract (PRI-1138, 6th dual-track convergence):
|
|
18
|
+
* - The ONLY writable/persisted format is the current schema version.
|
|
19
|
+
* writeProductTelemetryControlState refuses every state whose
|
|
20
|
+
* schemaVersion is not current, so no code path can persist or
|
|
21
|
+
* regenerate a legacy v1 file.
|
|
22
|
+
* - Legacy v1 files remain readable through migrateLegacyConsentFile — a
|
|
23
|
+
* one-way, read-only migrator (legacy reader / one-way migrator, never a
|
|
24
|
+
* writer). A read parses a v1 file in memory (identity preserved) but
|
|
25
|
+
* NEVER writes; persistence of the migration happens exclusively inside
|
|
26
|
+
* withControlStateLock transactions (PRI-1151): the legacy v1→v2
|
|
27
|
+
* migration write-back, enable/disable/reset, and workspace export
|
|
28
|
+
* bookkeeping merges all serialize on the same cross-process
|
|
29
|
+
* `<state>.state-lock`, so no writer can build its write from a stale
|
|
30
|
+
* read or overwrite a completed authorization change.
|
|
31
|
+
* - Migration from schema v1: consent, consentVersion, and telemetrySecret
|
|
32
|
+
* are preserved verbatim; legacy machine-global export bookkeeping
|
|
33
|
+
* (lastSucceededAt, retry state, attempt counters) is DISCARDED — it
|
|
34
|
+
* cannot be attributed to a workspace, and it is operational state, not a
|
|
35
|
+
* governance fact. Dropping it can cause at most one extra same-day
|
|
36
|
+
* snapshot per eligible workspace on the machine (each workspace re-exports
|
|
37
|
+
* once before its own fresh bookkeeping exists).
|
|
22
38
|
*/
|
|
23
39
|
export declare const PRODUCT_TELEMETRY_STATE_FILENAME = "product-telemetry.json";
|
|
40
|
+
/** The ONE writable schema version (single-format contract, PRI-1138). */
|
|
24
41
|
export declare const PRODUCT_TELEMETRY_CONTROL_SCHEMA_VERSION = "2";
|
|
25
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Legacy schema v1 — LEGACY-READER SEMANTICS ONLY (PRI-1138): this constant
|
|
44
|
+
* exists solely so the one-way migrator can recognize historical files. It
|
|
45
|
+
* is never a writable target; writeProductTelemetryControlState refuses
|
|
46
|
+
* every state whose schemaVersion is not PRODUCT_TELEMETRY_CONTROL_SCHEMA_VERSION.
|
|
47
|
+
*/
|
|
26
48
|
export declare const PRODUCT_TELEMETRY_LEGACY_CONTROL_SCHEMA_VERSION = "1";
|
|
27
49
|
/** Hard bound on tracked workspaces so the file cannot grow unboundedly. */
|
|
28
50
|
export declare const MAX_WORKSPACE_EXPORT_ENTRIES = 200;
|
|
@@ -72,23 +94,99 @@ export type ControlStateWrite = {
|
|
|
72
94
|
export declare function defaultProductTelemetryControlState(): ProductTelemetryControlState;
|
|
73
95
|
export declare function getProductTelemetryStatePath(homeDir: string): string;
|
|
74
96
|
/**
|
|
75
|
-
*
|
|
76
|
-
* never-configured case (defaults, existed=false). A malformed file is a
|
|
77
|
-
* loud failure — silently treating it as "unset" could re-prompt or re-export
|
|
78
|
-
* against the user's recorded decision (rc-3/rc-9).
|
|
97
|
+
* Atomic write (temp file + rename) so a crash never truncates the state.
|
|
79
98
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
99
|
+
* Single-format contract (PRI-1138): ONLY the current schema version is
|
|
100
|
+
* writable. This is the structural guarantee that no code path can persist
|
|
101
|
+
* or regenerate a legacy v1 file — a state carrying any other schemaVersion
|
|
102
|
+
* is refused loud and the file on disk is left untouched.
|
|
103
|
+
*
|
|
104
|
+
* Concurrency convention (PRI-1151): production read-modify-write callers
|
|
105
|
+
* must run inside withControlStateLock (tx.write) so their write is built
|
|
106
|
+
* from a read taken under the same cross-process mutex as every other
|
|
107
|
+
* writer; calling this function directly is for lock-held transaction
|
|
108
|
+
* internals and single-writer utilities.
|
|
109
|
+
*/
|
|
110
|
+
export declare function writeProductTelemetryControlState(homeDir: string, state: ProductTelemetryControlState): ControlStateWrite;
|
|
111
|
+
/**
|
|
112
|
+
* Lock-held read result: the parsed CURRENT disk state plus the schema
|
|
113
|
+
* version the bytes on disk actually carried (so a transaction can tell a
|
|
114
|
+
* migrated-in-memory v1 apart from a genuine v2 and persist the migration).
|
|
115
|
+
*/
|
|
116
|
+
export type LatestControlStateRead = {
|
|
117
|
+
ok: true;
|
|
118
|
+
state: ProductTelemetryControlState;
|
|
119
|
+
existed: boolean;
|
|
120
|
+
diskSchemaVersion: '1' | '2';
|
|
121
|
+
} | {
|
|
122
|
+
ok: false;
|
|
123
|
+
reason: string;
|
|
124
|
+
nextAction: string;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Read and validate the control state — PURE READ, never writes (PRI-1151).
|
|
128
|
+
* A legacy v1 file is parsed in memory (identity preserved, bookkeeping
|
|
129
|
+
* dropped) so callers observe the migrated semantics, but persisting the
|
|
130
|
+
* migration happens exclusively inside withControlStateLock transactions;
|
|
131
|
+
* a read-only caller (status/preview) can therefore never race a concurrent
|
|
132
|
+
* authorization change.
|
|
82
133
|
*/
|
|
83
134
|
export declare function readProductTelemetryControlState(homeDir: string): ControlStateRead;
|
|
135
|
+
/** Transactional read/write surface handed to withControlStateLock bodies. */
|
|
136
|
+
export interface ControlStateLockTx {
|
|
137
|
+
/**
|
|
138
|
+
* Read the CURRENT disk state inside the lock. No re-acquisition — the
|
|
139
|
+
* caller already holds the lock; nesting withControlStateLock inside a
|
|
140
|
+
* body is a programming error and would deadlock against the bounded
|
|
141
|
+
* wait.
|
|
142
|
+
*/
|
|
143
|
+
readLatest(): LatestControlStateRead;
|
|
144
|
+
/** Atomic single-format write inside the lock. */
|
|
145
|
+
write(state: ProductTelemetryControlState): ControlStateWrite;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* withControlStateLock — the ONE cross-process transaction entry for the
|
|
149
|
+
* control state (PRI-1151): acquire `<state>.state-lock` → run the body with
|
|
150
|
+
* lock-held readLatest/write primitives → release. Every control-state
|
|
151
|
+
* writer (legacy migration write-back, enable/disable/reset, workspace
|
|
152
|
+
* bookkeeping merge) goes through here, so each write is built from a read
|
|
153
|
+
* taken under the same mutex that serializes every other writer — a stale
|
|
154
|
+
* read can no longer overwrite a completed authorization change (e.g. a
|
|
155
|
+
* concurrent disable).
|
|
156
|
+
*
|
|
157
|
+
* Failure semantics: lock acquisition is bounded and CONTENTION (timeout) is
|
|
158
|
+
* distinguished from a FILESYSTEM failure (e.g. unwritable directory); on
|
|
159
|
+
* either failure nothing was written (no lock-free degradation). A body that
|
|
160
|
+
* runs longer than the lock's stale threshold may find its lock taken over
|
|
161
|
+
* by another process — tx.write then refuses (lock_lost) instead of
|
|
162
|
+
* committing without the mutex. A throwing body releases the lock and
|
|
163
|
+
* returns a structured failure — this function never throws.
|
|
164
|
+
*/
|
|
165
|
+
export declare function withControlStateLock<T>(homeDir: string, body: (tx: ControlStateLockTx) => Promise<T> | T, options?: {
|
|
166
|
+
timeoutMs?: number;
|
|
167
|
+
}): Promise<{
|
|
168
|
+
ok: true;
|
|
169
|
+
value: T;
|
|
170
|
+
} | {
|
|
171
|
+
ok: false;
|
|
172
|
+
reason: string;
|
|
173
|
+
nextAction: string;
|
|
174
|
+
}>;
|
|
175
|
+
/**
|
|
176
|
+
* One-way legacy v1→v2 migration as a locked transaction (PRI-1151): read
|
|
177
|
+
* the CURRENT disk state under the lock; if it is still v1, persist the
|
|
178
|
+
* migrated state (identity preserved) through the normal atomic write; if it
|
|
179
|
+
* is already the current format, do nothing (idempotent — no rewrite). A
|
|
180
|
+
* concurrent disable/reset/enable serializes on the same lock, so this can
|
|
181
|
+
* never overwrite a completed authorization change.
|
|
182
|
+
*/
|
|
183
|
+
export declare function migrateLegacyControlState(homeDir: string): Promise<ControlStateWrite>;
|
|
84
184
|
/**
|
|
85
185
|
* Drop `workspaceExports` entries whose most recent activity (attempt or
|
|
86
186
|
* success) is older than WORKSPACE_EXPORT_STATE_MAX_AGE_DAYS. Bounded local
|
|
87
187
|
* operational state only — this is not a workspace history database.
|
|
88
188
|
*/
|
|
89
189
|
export declare function pruneWorkspaceExports(state: ProductTelemetryControlState, nowMs: number): ProductTelemetryControlState;
|
|
90
|
-
/** Atomic write (temp file + rename) so a crash never truncates the state. */
|
|
91
|
-
export declare function writeProductTelemetryControlState(homeDir: string, state: ProductTelemetryControlState): ControlStateWrite;
|
|
92
190
|
/** State after `pd telemetry enable`: explicit granted consent + secret. */
|
|
93
191
|
export declare function grantedControlState(previous: ProductTelemetryControlState): ProductTelemetryControlState;
|
|
94
192
|
/**
|