@atrib/attest 0.3.0 → 0.3.1
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.d.ts +6 -1
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -176,7 +176,7 @@ declare function createServerKeyResolver(options: CreateAtribEmitServerOptions):
|
|
|
176
176
|
interface HandleEmitInput {
|
|
177
177
|
input: z.infer<typeof EmitInput>;
|
|
178
178
|
key: ResolvedKey | null;
|
|
179
|
-
queue
|
|
179
|
+
queue?: SubmissionQueue;
|
|
180
180
|
/**
|
|
181
181
|
* Producer label written to the sidecar's `_local.producer` field for
|
|
182
182
|
* cross-source disambiguation in mirror queries. Defaults to
|
|
@@ -209,6 +209,11 @@ export interface EmitInProcessOptions {
|
|
|
209
209
|
key?: ResolvedKey;
|
|
210
210
|
/** Override the log endpoint (defaults to ATRIB_LOG_ENDPOINT or @atrib/mcp default). */
|
|
211
211
|
logEndpoint?: string | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Set false for local-only producers. The record is still signed and
|
|
214
|
+
* mirrored, but this process does not create a public-log queue.
|
|
215
|
+
*/
|
|
216
|
+
submit?: boolean;
|
|
212
217
|
/**
|
|
213
218
|
* Producer label written to the sidecar's `_local.producer` field for
|
|
214
219
|
* cross-source disambiguation. Defaults to `'atrib-emit'`. Callers that
|
package/dist/index.js
CHANGED
|
@@ -535,7 +535,7 @@ async function handleEmit({ input, key, queue, producer, logEndpoint, mirrorPath
|
|
|
535
535
|
// Submit asynchronously; the queue handles retry + degradation per §5.8.
|
|
536
536
|
// Cognitive events default to normal priority, annotations/observations
|
|
537
537
|
// never need to block the agent.
|
|
538
|
-
if (!localSubstrateCommitted) {
|
|
538
|
+
if (!localSubstrateCommitted && queue) {
|
|
539
539
|
queue.submit(record, 'normal');
|
|
540
540
|
}
|
|
541
541
|
// Best-effort mirror; mirrorRecord internally swallows errors per §5.8.
|
|
@@ -554,7 +554,7 @@ async function handleEmit({ input, key, queue, producer, logEndpoint, mirrorPath
|
|
|
554
554
|
if (!proof && localSubstrateCommitted) {
|
|
555
555
|
warnings.push('submission delegated to local substrate coordinator; proof not available in this process');
|
|
556
556
|
}
|
|
557
|
-
else if (!proof) {
|
|
557
|
+
else if (!proof && queue) {
|
|
558
558
|
warnings.push('submission queued; proof not yet available (poll the log later if needed)');
|
|
559
559
|
}
|
|
560
560
|
if (localSubstrate?.waitForAttempt && localSubstrateShadow) {
|
|
@@ -881,6 +881,8 @@ function notifyLocalSubstrateWarning(localSubstrate, message, detail) {
|
|
|
881
881
|
* warning, even when the record had already landed on the log.
|
|
882
882
|
*/
|
|
883
883
|
function getProofFor(queue, recordHash) {
|
|
884
|
+
if (!queue)
|
|
885
|
+
return undefined;
|
|
884
886
|
return queue.getProof(recordHash.startsWith('sha256:') ? recordHash.slice('sha256:'.length) : recordHash);
|
|
885
887
|
}
|
|
886
888
|
const DEFAULT_FLUSH_DEADLINE_MS = 5000;
|
|
@@ -917,11 +919,11 @@ export async function emitInProcess(rawInput, options = {}) {
|
|
|
917
919
|
const key = options.key ?? (await resolveKey());
|
|
918
920
|
const logEndpoint = options.logEndpoint ?? process.env['ATRIB_LOG_ENDPOINT'];
|
|
919
921
|
const flushDeadlineMs = options.flushDeadlineMs ?? DEFAULT_FLUSH_DEADLINE_MS;
|
|
920
|
-
const queue = createSubmissionQueue(logEndpoint);
|
|
922
|
+
const queue = options.submit === false ? undefined : createSubmissionQueue(logEndpoint);
|
|
921
923
|
const result = await handleEmit({
|
|
922
924
|
input,
|
|
923
925
|
key,
|
|
924
|
-
queue,
|
|
926
|
+
...(queue !== undefined ? { queue } : {}),
|
|
925
927
|
producer: options.producer,
|
|
926
928
|
logEndpoint,
|
|
927
929
|
mirrorPath: options.mirrorPath,
|
|
@@ -941,7 +943,7 @@ export async function emitInProcess(rawInput, options = {}) {
|
|
|
941
943
|
transport: 'emit-in-process',
|
|
942
944
|
}),
|
|
943
945
|
});
|
|
944
|
-
if (!result.signed) {
|
|
946
|
+
if (!result.signed || queue === undefined) {
|
|
945
947
|
return result;
|
|
946
948
|
}
|
|
947
949
|
// Drain before returning, bounded by flushDeadlineMs. The typical caller
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atrib/attest",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "MCP server for atrib's write verb. One attest tool signs observations, annotations, and revisions; the legacy emit, atrib-annotate, and atrib-revise tool names stay mounted as aliases over the same handler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atrib",
|