@punica/editor 1.20.0 → 1.21.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/dist/index.bundle.esm.js +2 -2
- package/dist/index.bundle.esm.js.map +1 -1
- package/dist/index.bundle.umd.js +2 -2
- package/dist/index.bundle.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/punica.module.kernel.events.d.ts +14 -3
- package/types/punica.module.runtime.capabilities.d.ts +55 -0
package/package.json
CHANGED
|
@@ -150,9 +150,20 @@ declare module 'punica' {
|
|
|
150
150
|
getRecent(limit?: number): KernelEvent[];
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
|
-
* Filter events by various criteria.
|
|
154
|
-
*
|
|
155
|
-
*
|
|
153
|
+
* Filter events by various criteria. **In-memory audit buffer only** —
|
|
154
|
+
* the bounded ring, not the durable store.
|
|
155
|
+
*
|
|
156
|
+
* `includePersisted` is accepted and does nothing. Reading the store is
|
|
157
|
+
* async and this signature is not, so the flag was left as a placeholder
|
|
158
|
+
* and the doc claimed it worked; a consumer that trusted it got the ring
|
|
159
|
+
* and no indication of what it missed. Corrected 2026-08-28 after an
|
|
160
|
+
* evidence package would have reported a run as shorter than it was.
|
|
161
|
+
*
|
|
162
|
+
* To read the store, call `loadPersistedEvents` and merge — the two sets
|
|
163
|
+
* overlap and both are needed, because persistence batches at ten records
|
|
164
|
+
* or five seconds and a just-finished run is not on disk yet.
|
|
165
|
+
*
|
|
166
|
+
* @deprecated includePersisted — pass nothing; use `loadPersistedEvents`.
|
|
156
167
|
*/
|
|
157
168
|
filterEvents(options?: {
|
|
158
169
|
correlationId?: string;
|
|
@@ -89,6 +89,61 @@ declare module 'punica' {
|
|
|
89
89
|
signal?: AbortSignal;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* The closed vocabulary of lineage subject kinds.
|
|
94
|
+
*
|
|
95
|
+
* A capability schema declares a field a subject with the
|
|
96
|
+
* non-standard `subject: '<kind>'` keyword, and the gateway copies
|
|
97
|
+
* what it finds onto the audit record. That record is the only
|
|
98
|
+
* source an evidence package has for "which data did this run
|
|
99
|
+
* touch?", which is why the kinds are closed: a reader comparing
|
|
100
|
+
* two packages cannot interpret a word an author invented.
|
|
101
|
+
*
|
|
102
|
+
* `dataset` is a named body of data, `file` a workspace path whose
|
|
103
|
+
* contents a call read or wrote, `model` a model that produced
|
|
104
|
+
* something, `prompt` the configured behaviour it ran with,
|
|
105
|
+
* `collection` a vector index a retrieval read from, and `artifact`
|
|
106
|
+
* something the run produced.
|
|
107
|
+
*/
|
|
108
|
+
export type SubjectKind =
|
|
109
|
+
| 'dataset'
|
|
110
|
+
| 'file'
|
|
111
|
+
| 'model'
|
|
112
|
+
| 'prompt'
|
|
113
|
+
| 'collection'
|
|
114
|
+
| 'artifact';
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* One thing a call touched, as recorded on the `capability.audited`
|
|
118
|
+
* event's payload under `subjects`.
|
|
119
|
+
*
|
|
120
|
+
* Absent rather than empty when the capability declares none, which
|
|
121
|
+
* is most of them: absence says nobody has decided what this
|
|
122
|
+
* capability's subjects are, where an empty array would say the call
|
|
123
|
+
* touched nothing.
|
|
124
|
+
*
|
|
125
|
+
* `from` matters and is not bookkeeping. On `llm.invoke` the prompt
|
|
126
|
+
* is an input (the caller names it, so it is known even when the
|
|
127
|
+
* call fails) and the model is an output (the instruction class
|
|
128
|
+
* picks it from its provider chain at call time), so a reader that
|
|
129
|
+
* ignored this field would read a requested model as a used one.
|
|
130
|
+
*
|
|
131
|
+
* `digest` is present only where a capability had a cheap way to
|
|
132
|
+
* produce one — a `dvc.lock` read hands back a digest beside each
|
|
133
|
+
* path, a file read does not, and hashing on every `fs.readFile`
|
|
134
|
+
* would put I/O in the audit path. Its absence downgrades the answer
|
|
135
|
+
* from integrity to identity; it does not invalidate it.
|
|
136
|
+
*/
|
|
137
|
+
export interface CapabilitySubject {
|
|
138
|
+
kind: SubjectKind | string;
|
|
139
|
+
/** How it is named: a path, a model id, a collection. */
|
|
140
|
+
id: string;
|
|
141
|
+
/** Its content digest, when a sibling field declared one. */
|
|
142
|
+
digest?: string;
|
|
143
|
+
/** Which side of the call named it. */
|
|
144
|
+
from: 'input' | 'output';
|
|
145
|
+
}
|
|
146
|
+
|
|
92
147
|
/**
|
|
93
148
|
* Capability Gateway API
|
|
94
149
|
*/
|