@osfactory/otel-hook 0.2.0 → 0.4.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/{adapter-DIgRACtL.d.ts → adapter-BgqtlADe.d.ts} +12 -5
- package/dist/cli.js +1439 -626
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.js +5 -1
- package/dist/config.js.map +1 -1
- package/dist/{content-CoB7aNP1.d.ts → content-M9xIKG7h.d.ts} +8 -1
- package/dist/{events-VxBnDFaO.d.ts → events-C3h3GvHj.d.ts} +58 -0
- package/dist/{filesystem-store-J8jjDMTh.d.ts → filesystem-store-BAq3VGVv.d.ts} +1 -1
- package/dist/{hook-CGpo-vks.d.ts → hook-CQiNa88Q.d.ts} +13 -5
- package/dist/index.d.ts +16 -15
- package/dist/index.js +1569 -741
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +8 -7
- package/dist/install.js +132 -68
- package/dist/install.js.map +1 -1
- package/dist/integration.d.ts +18 -11
- package/dist/integration.js +618 -158
- package/dist/integration.js.map +1 -1
- package/dist/lifecycle.d.ts +3 -3
- package/dist/lifecycle.js +27 -4
- package/dist/lifecycle.js.map +1 -1
- package/dist/{memory-DXVBc8V9.d.ts → memory-kflYgZbg.d.ts} +2 -2
- package/dist/model.d.ts +3 -2
- package/dist/model.js +81 -41
- package/dist/model.js.map +1 -1
- package/dist/{otlp-log-sink-CeIFDDpn.d.ts → otlp-log-sink-BZIgYPKN.d.ts} +4 -4
- package/dist/{payload-CHr53E_v.d.ts → payload-DpyU8F-z.d.ts} +1 -1
- package/dist/{policy-D1CrlYn3.d.ts → policy-CimmCfRp.d.ts} +1 -1
- package/dist/{ports-Q8x0ODhs.d.ts → ports-B_iwJQPQ.d.ts} +20 -2
- package/dist/privacy.d.ts +4 -4
- package/dist/privacy.js +11 -0
- package/dist/privacy.js.map +1 -1
- package/dist/providers.d.ts +30 -12
- package/dist/providers.js +983 -552
- package/dist/providers.js.map +1 -1
- package/dist/{registry-BzYmC9OC.d.ts → registry-BSBS8t7S.d.ts} +1 -1
- package/dist/runtime.d.ts +88 -12
- package/dist/runtime.js +392 -68
- package/dist/runtime.js.map +1 -1
- package/dist/{semconv-Baoz-0OI.d.ts → semconv-BeUPQ7_q.d.ts} +2 -1
- package/dist/{service-j4jEO6cZ.d.ts → service-CbI9CObT.d.ts} +8 -2
- package/dist/state.d.ts +4 -4
- package/dist/state.js.map +1 -1
- package/dist/target-8RfaVxp8.d.ts +83 -0
- package/dist/telemetry.d.ts +7 -7
- package/dist/telemetry.js +186 -46
- package/dist/telemetry.js.map +1 -1
- package/dist/testing.d.ts +17 -10
- package/dist/testing.js +1149 -593
- package/dist/testing.js.map +1 -1
- package/package.json +4 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Clock, I as IdGenerator,
|
|
2
|
-
import { b as CanonicalEvent } from './events-
|
|
1
|
+
import { C as Clock, I as IdGenerator, e as StateStore, S as StateRecord, c as LogLevel, d as Logger, g as TelemetrySink } from './ports-B_iwJQPQ.js';
|
|
2
|
+
import { b as CanonicalEvent } from './events-C3h3GvHj.js';
|
|
3
3
|
import { b as Attributes } from './primitives-CJ8-rn-f.js';
|
|
4
4
|
|
|
5
5
|
/** Clock backed by the host process. */
|
package/dist/model.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { a as AttributeValue } from './primitives-CJ8-rn-f.js';
|
|
3
3
|
export { A as AttributePrimitive, b as Attributes, D as DETECTION_CONFIDENCE_RANK, c as DetectionConfidence, E as EpochMillis, d as EventId, I as InvocationId, M as MAX_ATTRIBUTE_ARRAY_LENGTH, e as MAX_ATTRIBUTE_STRING_LENGTH, f as MAX_IDENTIFIER_LENGTH, P as PROVIDER_ID_PATTERN, g as ProviderId, R as ResolvedProviderId, S as SessionId, h as SourceTransport, U as UNKNOWN_PROVIDER_ID, i as UnknownProviderId, W as WORKSPACE_ID_PATTERN, j as WorkspaceId, k as attributePrimitiveSchema, l as attributeValueSchema, m as attributesSchema, n as compareDetectionConfidence, o as detectionConfidenceSchema, p as durationMillisSchema, q as epochMillisSchema, r as eventIdSchema, s as invocationIdSchema, t as isUnknownProvider, u as nonEmptyStringSchema, v as providerIdSchema, w as resolvedProviderIdSchema, x as sequenceNumberSchema, y as sessionIdSchema, z as sourceTransportSchema, B as tokenCountSchema, C as workspaceIdSchema } from './primitives-CJ8-rn-f.js';
|
|
4
|
-
export { C as CONTENT_HASH_PATTERN, a as ContentDisclosure, b as ContentFact, c as ContentKind, d as ContentRole, e as contentDisclosureSchema, f as contentFactSchema, g as contentFactsSchema, h as contentKindSchema, i as contentRoleSchema, j as isContentFactConsistent } from './content-
|
|
5
|
-
export { C as CANONICAL_EVENT_TYPES, a as CacheCreationAccounting, b as CanonicalEvent, c as CanonicalEventInput, d as CanonicalEventOfType, e as CanonicalEventType, f as CanonicalUsage, g as CompactionPerformedEvent, h as CostFacts, E as EMPTY_DELTA_USAGE, i as ErrorRaisedEvent, j as EventOutcome, k as EventValidationResult, G as GenerationEndEvent, l as GenerationStartEvent, M as ModelDescriptor, P as PromptSubmittedEvent, m as ProviderTotalAgreement, S as SessionEndEvent, n as SessionStartEvent, o as SubagentEndEvent, p as SubagentStartEvent, T as ToolEndEvent, q as ToolKind, r as ToolStartEvent, U as UsageDeltaResult, s as UsageNormalizationError, t as UsageNormalizationIssue, u as UsageNormalizationResult, v as UsageReport, w as UsageTemporality, x as addUsage, y as cacheCreationAccountingSchema, z as canonicalEventSchema, A as canonicalEventTypeSchema, B as canonicalUsageSchema, D as compactionPerformedEventSchema, F as compareEvents, H as costFactsSchema, I as cumulativeToDelta, J as errorRaisedEventSchema, K as eventUsage, L as generationEndEventSchema, N as generationStartEventSchema, O as modelDescriptorSchema, Q as normalizeUsage, R as normalizeUsageOrThrow, V as parseCanonicalEvent, W as promptSubmittedEventSchema, X as providerTotalAgreementSchema, Y as sessionEndEventSchema, Z as sessionStartEventSchema, _ as subagentEndEventSchema, $ as subagentStartEventSchema, a0 as toReport, a1 as toolEndEventSchema, a2 as toolKindSchema, a3 as toolStartEventSchema, a4 as usageReportSchema, a5 as usageTemporalitySchema, a6 as validateCanonicalEvent } from './events-
|
|
4
|
+
export { C as CONTENT_HASH_PATTERN, a as ContentDisclosure, b as ContentFact, c as ContentKind, d as ContentRole, e as contentDisclosureSchema, f as contentFactSchema, g as contentFactsSchema, h as contentKindSchema, i as contentRoleSchema, j as isContentFactConsistent, k as isUnavailableContentFact } from './content-M9xIKG7h.js';
|
|
5
|
+
export { C as CANONICAL_EVENT_TYPES, a as CacheCreationAccounting, b as CanonicalEvent, c as CanonicalEventInput, d as CanonicalEventOfType, e as CanonicalEventType, f as CanonicalUsage, g as CompactionPerformedEvent, h as CostFacts, E as EMPTY_DELTA_USAGE, i as ErrorRaisedEvent, j as EventOutcome, k as EventValidationResult, G as GenerationEndEvent, l as GenerationStartEvent, M as ModelDescriptor, P as PromptSubmittedEvent, m as ProviderTotalAgreement, S as SessionEndEvent, n as SessionStartEvent, o as SubagentEndEvent, p as SubagentStartEvent, T as ToolEndEvent, q as ToolKind, r as ToolStartEvent, U as UsageDeltaResult, s as UsageNormalizationError, t as UsageNormalizationIssue, u as UsageNormalizationResult, v as UsageReport, w as UsageTemporality, x as addUsage, y as cacheCreationAccountingSchema, z as canonicalEventSchema, A as canonicalEventTypeSchema, B as canonicalUsageSchema, D as compactionPerformedEventSchema, F as compareEvents, H as costFactsSchema, I as cumulativeToDelta, J as errorRaisedEventSchema, K as eventUsage, L as generationEndEventSchema, N as generationStartEventSchema, O as modelDescriptorSchema, Q as normalizeUsage, R as normalizeUsageOrThrow, V as parseCanonicalEvent, W as promptSubmittedEventSchema, X as providerTotalAgreementSchema, Y as sessionEndEventSchema, Z as sessionStartEventSchema, _ as subagentEndEventSchema, $ as subagentStartEventSchema, a0 as toReport, a1 as toolEndEventSchema, a2 as toolKindSchema, a3 as toolStartEventSchema, a4 as usageReportSchema, a5 as usageTemporalitySchema, a6 as validateCanonicalEvent } from './events-C3h3GvHj.js';
|
|
6
6
|
export { C as ConsumerAttributes, I as IdentityClaim, a as IdentityClaimFields, b as IdentityConflict, c as IdentityResolution, d as InvocationIdentity, R as ResolveIdentityInput, S as SourceProvenance, U as UNKNOWN_WORKSPACE_ID, W as WorkspaceIdentity, e as WorkspaceKeySource, f as consumerAttributesSchema, i as identityClaimFieldsSchema, g as identityClaimSchema, h as invocationIdentitySchema, r as resolveInvocationIdentity, s as sourceProvenanceSchema, u as unknownWorkspaceIdentity, w as workspaceIdentitySchema, j as workspaceKeySourceSchema } from './identity-BrVBs901.js';
|
|
7
|
+
export { M as MAX_TARGET_HINT_PATHS, a as MAX_TARGET_PATH_LENGTH, S as SUBAGENT_ID_PATTERN, b as SubagentId, T as TargetHint, c as TargetSource, W as WorkspaceTarget, s as subagentIdSchema, t as targetHintSchema, d as targetSourceSchema, w as workspaceTargetSchema } from './target-8RfaVxp8.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Version of the canonical event model.
|
package/dist/model.js
CHANGED
|
@@ -132,6 +132,7 @@ var contentFactSchema = z4.strictObject({
|
|
|
132
132
|
});
|
|
133
133
|
var contentFactsSchema = z4.array(contentFactSchema).max(64);
|
|
134
134
|
var isContentFactConsistent = (fact) => fact.disclosure === "omitted" ? fact.text === void 0 : fact.text !== void 0;
|
|
135
|
+
var isUnavailableContentFact = (fact) => fact.disclosure === "omitted" && fact.text === void 0 && fact.characterLength === 0 && fact.byteLength === 0;
|
|
135
136
|
|
|
136
137
|
// src/model/usage.ts
|
|
137
138
|
import { z as z5 } from "zod";
|
|
@@ -563,12 +564,33 @@ var resolveInvocationIdentity = (input) => {
|
|
|
563
564
|
return { status: "resolved", identity: parsed.data };
|
|
564
565
|
};
|
|
565
566
|
|
|
567
|
+
// src/model/target.ts
|
|
568
|
+
import { z as z7 } from "zod";
|
|
569
|
+
var targetSourceSchema = z7.enum(["tool-path", "shell-cwd", "session-cwd"]);
|
|
570
|
+
var MAX_TARGET_HINT_PATHS = 8;
|
|
571
|
+
var MAX_TARGET_PATH_LENGTH = 4096;
|
|
572
|
+
var localPathSchema = z7.string().min(1).max(MAX_TARGET_PATH_LENGTH).refine((value) => !value.includes("\0"), "path must not contain NUL");
|
|
573
|
+
var targetHintSchema = z7.strictObject({
|
|
574
|
+
source: targetSourceSchema,
|
|
575
|
+
paths: z7.array(localPathSchema).min(1).max(MAX_TARGET_HINT_PATHS).readonly(),
|
|
576
|
+
/** Absolute directory that relative `paths` resolve against. */
|
|
577
|
+
baseDirectory: localPathSchema.optional()
|
|
578
|
+
}).readonly();
|
|
579
|
+
var workspaceTargetSchema = z7.strictObject({
|
|
580
|
+
workspaceId: workspaceIdSchema,
|
|
581
|
+
/** Branch checked out in that worktree; absent on a detached HEAD. */
|
|
582
|
+
vcsBranchName: nonEmptyStringSchema.optional(),
|
|
583
|
+
source: targetSourceSchema
|
|
584
|
+
}).readonly();
|
|
585
|
+
var SUBAGENT_ID_PATTERN = /^[A-Za-z0-9_.:@+=-]{1,256}$/;
|
|
586
|
+
var subagentIdSchema = z7.string().regex(SUBAGENT_ID_PATTERN);
|
|
587
|
+
|
|
566
588
|
// src/model/events.ts
|
|
567
|
-
import { z as
|
|
589
|
+
import { z as z9 } from "zod";
|
|
568
590
|
|
|
569
591
|
// src/errors/taxonomy.ts
|
|
570
|
-
import { z as
|
|
571
|
-
var otelHookErrorCodeSchema =
|
|
592
|
+
import { z as z8 } from "zod";
|
|
593
|
+
var otelHookErrorCodeSchema = z8.enum([
|
|
572
594
|
/** Input was not usable at all (empty stdin, unparsable JSON). */
|
|
573
595
|
"invalid-input",
|
|
574
596
|
/** Input parsed but failed canonical schema validation. */
|
|
@@ -604,8 +626,8 @@ var otelHookErrorCodeSchema = z7.enum([
|
|
|
604
626
|
/** Anything unanticipated. Always reported, never fatal to the host. */
|
|
605
627
|
"internal-error"
|
|
606
628
|
]);
|
|
607
|
-
var errorSeveritySchema =
|
|
608
|
-
var errorPhaseSchema =
|
|
629
|
+
var errorSeveritySchema = z8.enum(["warning", "error"]);
|
|
630
|
+
var errorPhaseSchema = z8.enum([
|
|
609
631
|
"configuration",
|
|
610
632
|
"detection",
|
|
611
633
|
"identity",
|
|
@@ -616,7 +638,7 @@ var errorPhaseSchema = z7.enum([
|
|
|
616
638
|
"export",
|
|
617
639
|
"shutdown"
|
|
618
640
|
]);
|
|
619
|
-
var failurePostureSchema =
|
|
641
|
+
var failurePostureSchema = z8.enum(["fail-open", "fail-closed-attribution"]);
|
|
620
642
|
var ERROR_TAXONOMY = Object.freeze({
|
|
621
643
|
"invalid-input": {
|
|
622
644
|
code: "invalid-input",
|
|
@@ -740,7 +762,7 @@ var ERROR_TAXONOMY = Object.freeze({
|
|
|
740
762
|
summary: "An unexpected failure was contained."
|
|
741
763
|
}
|
|
742
764
|
});
|
|
743
|
-
var attributionOutcomeSchema =
|
|
765
|
+
var attributionOutcomeSchema = z8.enum([
|
|
744
766
|
/** Identity resolved; events carry provider and session identity. */
|
|
745
767
|
"attributed",
|
|
746
768
|
/** Identity could not be established safely; nothing was attributed. */
|
|
@@ -750,7 +772,7 @@ var attributionOutcomeSchema = z7.enum([
|
|
|
750
772
|
/** Input was recognized but intentionally carried no telemetry. */
|
|
751
773
|
"not-applicable"
|
|
752
774
|
]);
|
|
753
|
-
var attributionReasonSchema =
|
|
775
|
+
var attributionReasonSchema = z8.enum([
|
|
754
776
|
"provider-unknown",
|
|
755
777
|
"provider-detection-ambiguous",
|
|
756
778
|
"identity-conflict",
|
|
@@ -762,19 +784,19 @@ var attributionReasonSchema = z7.enum([
|
|
|
762
784
|
]);
|
|
763
785
|
|
|
764
786
|
// src/model/events.ts
|
|
765
|
-
var modelDescriptorSchema =
|
|
787
|
+
var modelDescriptorSchema = z9.strictObject({
|
|
766
788
|
modelId: nonEmptyStringSchema,
|
|
767
789
|
/** Vendor of the model, e.g. `anthropic`. Distinct from the agent provider. */
|
|
768
790
|
vendor: nonEmptyStringSchema.optional(),
|
|
769
791
|
family: nonEmptyStringSchema.optional()
|
|
770
792
|
});
|
|
771
|
-
var costFactsSchema =
|
|
793
|
+
var costFactsSchema = z9.strictObject({
|
|
772
794
|
/** ISO 4217 code. */
|
|
773
|
-
currency:
|
|
774
|
-
amount:
|
|
775
|
-
source:
|
|
795
|
+
currency: z9.string().length(3),
|
|
796
|
+
amount: z9.number().min(0).finite(),
|
|
797
|
+
source: z9.enum(["provider-reported", "computed"])
|
|
776
798
|
});
|
|
777
|
-
var canonicalEventTypeSchema =
|
|
799
|
+
var canonicalEventTypeSchema = z9.enum([
|
|
778
800
|
"session.start",
|
|
779
801
|
"session.end",
|
|
780
802
|
"prompt.submitted",
|
|
@@ -788,7 +810,7 @@ var canonicalEventTypeSchema = z8.enum([
|
|
|
788
810
|
"error.raised"
|
|
789
811
|
]);
|
|
790
812
|
var CANONICAL_EVENT_TYPES = canonicalEventTypeSchema.options;
|
|
791
|
-
var outcomeSchema =
|
|
813
|
+
var outcomeSchema = z9.enum(["ok", "error", "cancelled", "timeout", "denied", "unknown"]);
|
|
792
814
|
var baseEventFields = {
|
|
793
815
|
schemaVersion: canonicalSchemaVersionSchema,
|
|
794
816
|
eventId: eventIdSchema,
|
|
@@ -799,39 +821,45 @@ var baseEventFields = {
|
|
|
799
821
|
occurredAt: epochMillisSchema,
|
|
800
822
|
provenance: sourceProvenanceSchema,
|
|
801
823
|
workspace: workspaceIdentitySchema,
|
|
824
|
+
/**
|
|
825
|
+
* The provider's own id for the subagent this event was emitted inside (e.g.
|
|
826
|
+
* Claude Code's `agent_id`). Absent for the top-level agent. Set by the event
|
|
827
|
+
* factory, never by hand.
|
|
828
|
+
*/
|
|
829
|
+
subagentId: subagentIdSchema.optional(),
|
|
802
830
|
extensions: extensionsSchema.default(emptyExtensions)
|
|
803
831
|
};
|
|
804
|
-
var event = (shape) =>
|
|
832
|
+
var event = (shape) => z9.strictObject({ ...baseEventFields, ...shape });
|
|
805
833
|
var sessionStartEventSchema = event({
|
|
806
|
-
type:
|
|
807
|
-
sessionKind:
|
|
834
|
+
type: z9.literal("session.start"),
|
|
835
|
+
sessionKind: z9.enum(["interactive", "non-interactive", "unknown"]),
|
|
808
836
|
agentName: nonEmptyStringSchema.optional(),
|
|
809
837
|
agentVersion: nonEmptyStringSchema.optional(),
|
|
810
838
|
model: modelDescriptorSchema.optional()
|
|
811
839
|
});
|
|
812
840
|
var sessionEndEventSchema = event({
|
|
813
|
-
type:
|
|
814
|
-
reason:
|
|
841
|
+
type: z9.literal("session.end"),
|
|
842
|
+
reason: z9.enum(["completed", "aborted", "error", "timeout", "unknown"]),
|
|
815
843
|
durationMillis: durationMillisSchema.optional(),
|
|
816
844
|
/** Session totals, typically cumulative. */
|
|
817
845
|
usage: canonicalUsageSchema.optional(),
|
|
818
846
|
cost: costFactsSchema.optional()
|
|
819
847
|
});
|
|
820
848
|
var promptSubmittedEventSchema = event({
|
|
821
|
-
type:
|
|
822
|
-
promptSource:
|
|
849
|
+
type: z9.literal("prompt.submitted"),
|
|
850
|
+
promptSource: z9.enum(["user", "automation", "resumed", "unknown"]),
|
|
823
851
|
content: contentFactSchema.optional(),
|
|
824
|
-
turnIndex:
|
|
852
|
+
turnIndex: z9.number().int().min(0).optional()
|
|
825
853
|
});
|
|
826
854
|
var generationStartEventSchema = event({
|
|
827
|
-
type:
|
|
855
|
+
type: z9.literal("generation.start"),
|
|
828
856
|
generationId: nonEmptyStringSchema,
|
|
829
857
|
model: modelDescriptorSchema,
|
|
830
858
|
requestedMaxOutputTokens: tokenCountSchema.optional(),
|
|
831
859
|
inputContent: contentFactsSchema.optional()
|
|
832
860
|
});
|
|
833
861
|
var generationEndEventSchema = event({
|
|
834
|
-
type:
|
|
862
|
+
type: z9.literal("generation.end"),
|
|
835
863
|
generationId: nonEmptyStringSchema,
|
|
836
864
|
model: modelDescriptorSchema,
|
|
837
865
|
outcome: outcomeSchema,
|
|
@@ -841,7 +869,7 @@ var generationEndEventSchema = event({
|
|
|
841
869
|
cost: costFactsSchema.optional(),
|
|
842
870
|
outputContent: contentFactsSchema.optional()
|
|
843
871
|
});
|
|
844
|
-
var toolKindSchema =
|
|
872
|
+
var toolKindSchema = z9.enum([
|
|
845
873
|
"read",
|
|
846
874
|
"write",
|
|
847
875
|
"execute",
|
|
@@ -852,59 +880,63 @@ var toolKindSchema = z8.enum([
|
|
|
852
880
|
"unknown"
|
|
853
881
|
]);
|
|
854
882
|
var toolStartEventSchema = event({
|
|
855
|
-
type:
|
|
883
|
+
type: z9.literal("tool.start"),
|
|
856
884
|
toolCallId: nonEmptyStringSchema,
|
|
857
885
|
toolName: nonEmptyStringSchema,
|
|
858
886
|
toolKind: toolKindSchema,
|
|
859
887
|
generationId: nonEmptyStringSchema.optional(),
|
|
860
|
-
input: contentFactSchema.optional()
|
|
888
|
+
input: contentFactSchema.optional(),
|
|
889
|
+
/** The git worktree this call targeted, resolved by the core (ADR 0008). */
|
|
890
|
+
target: workspaceTargetSchema.optional()
|
|
861
891
|
});
|
|
862
892
|
var toolEndEventSchema = event({
|
|
863
|
-
type:
|
|
893
|
+
type: z9.literal("tool.end"),
|
|
864
894
|
toolCallId: nonEmptyStringSchema,
|
|
865
895
|
toolName: nonEmptyStringSchema,
|
|
866
896
|
outcome: outcomeSchema,
|
|
867
897
|
durationMillis: durationMillisSchema.optional(),
|
|
868
898
|
/** Present when the host asked for or recorded a permission decision. */
|
|
869
|
-
permissionDecision:
|
|
870
|
-
output: contentFactSchema.optional()
|
|
899
|
+
permissionDecision: z9.enum(["allowed", "denied", "deferred", "not-required"]).optional(),
|
|
900
|
+
output: contentFactSchema.optional(),
|
|
901
|
+
/** The git worktree this call targeted, resolved by the core (ADR 0008). */
|
|
902
|
+
target: workspaceTargetSchema.optional()
|
|
871
903
|
});
|
|
872
904
|
var subagentStartEventSchema = event({
|
|
873
|
-
type:
|
|
905
|
+
type: z9.literal("subagent.start"),
|
|
874
906
|
subagentInvocationId: invocationIdSchema,
|
|
875
907
|
subagentType: nonEmptyStringSchema.optional(),
|
|
876
908
|
/** 0 for the top-level agent; 1 for its direct children. */
|
|
877
|
-
delegationDepth:
|
|
909
|
+
delegationDepth: z9.number().int().min(0).max(64),
|
|
878
910
|
model: modelDescriptorSchema.optional()
|
|
879
911
|
});
|
|
880
912
|
var subagentEndEventSchema = event({
|
|
881
|
-
type:
|
|
913
|
+
type: z9.literal("subagent.end"),
|
|
882
914
|
subagentInvocationId: invocationIdSchema,
|
|
883
915
|
outcome: outcomeSchema,
|
|
884
916
|
durationMillis: durationMillisSchema.optional(),
|
|
885
917
|
usage: canonicalUsageSchema.optional()
|
|
886
918
|
});
|
|
887
919
|
var compactionPerformedEventSchema = event({
|
|
888
|
-
type:
|
|
889
|
-
trigger:
|
|
920
|
+
type: z9.literal("compaction.performed"),
|
|
921
|
+
trigger: z9.enum(["automatic", "manual", "unknown"]),
|
|
890
922
|
/** Provider-reported context size before and after compaction, if known. */
|
|
891
923
|
contextTokensBefore: tokenCountSchema.optional(),
|
|
892
924
|
contextTokensAfter: tokenCountSchema.optional(),
|
|
893
|
-
droppedMessageCount:
|
|
925
|
+
droppedMessageCount: z9.number().int().min(0).optional(),
|
|
894
926
|
usage: canonicalUsageSchema.optional()
|
|
895
927
|
});
|
|
896
928
|
var errorRaisedEventSchema = event({
|
|
897
|
-
type:
|
|
929
|
+
type: z9.literal("error.raised"),
|
|
898
930
|
errorCode: otelHookErrorCodeSchema,
|
|
899
931
|
severity: errorSeveritySchema,
|
|
900
932
|
phase: errorPhaseSchema,
|
|
901
|
-
retryable:
|
|
933
|
+
retryable: z9.boolean(),
|
|
902
934
|
/** Error text is content: it is described, never embedded verbatim by default. */
|
|
903
935
|
message: contentFactSchema.optional(),
|
|
904
936
|
/** Non-sensitive, provider-agnostic short label. */
|
|
905
937
|
detail: nonEmptyStringSchema.optional()
|
|
906
938
|
});
|
|
907
|
-
var canonicalEventSchema =
|
|
939
|
+
var canonicalEventSchema = z9.discriminatedUnion("type", [
|
|
908
940
|
sessionStartEventSchema,
|
|
909
941
|
sessionEndEventSchema,
|
|
910
942
|
promptSubmittedEventSchema,
|
|
@@ -944,8 +976,11 @@ export {
|
|
|
944
976
|
MAX_ATTRIBUTE_STRING_LENGTH,
|
|
945
977
|
MAX_EXTENSION_ENTRIES,
|
|
946
978
|
MAX_IDENTIFIER_LENGTH,
|
|
979
|
+
MAX_TARGET_HINT_PATHS,
|
|
980
|
+
MAX_TARGET_PATH_LENGTH,
|
|
947
981
|
PROVIDER_ID_PATTERN,
|
|
948
982
|
RESERVED_EXTENSION_NAMESPACES,
|
|
983
|
+
SUBAGENT_ID_PATTERN,
|
|
949
984
|
UNKNOWN_PROVIDER_ID,
|
|
950
985
|
UNKNOWN_WORKSPACE_ID,
|
|
951
986
|
UsageNormalizationError,
|
|
@@ -987,6 +1022,7 @@ export {
|
|
|
987
1022
|
invocationIdentitySchema,
|
|
988
1023
|
isContentFactConsistent,
|
|
989
1024
|
isReservedExtensionNamespace,
|
|
1025
|
+
isUnavailableContentFact,
|
|
990
1026
|
isUnknownProvider,
|
|
991
1027
|
isValidExtensionKey,
|
|
992
1028
|
modelDescriptorSchema,
|
|
@@ -1006,7 +1042,10 @@ export {
|
|
|
1006
1042
|
sourceProvenanceSchema,
|
|
1007
1043
|
sourceTransportSchema,
|
|
1008
1044
|
subagentEndEventSchema,
|
|
1045
|
+
subagentIdSchema,
|
|
1009
1046
|
subagentStartEventSchema,
|
|
1047
|
+
targetHintSchema,
|
|
1048
|
+
targetSourceSchema,
|
|
1010
1049
|
toReport,
|
|
1011
1050
|
tokenCountSchema,
|
|
1012
1051
|
toolEndEventSchema,
|
|
@@ -1018,6 +1057,7 @@ export {
|
|
|
1018
1057
|
validateCanonicalEvent,
|
|
1019
1058
|
workspaceIdSchema,
|
|
1020
1059
|
workspaceIdentitySchema,
|
|
1021
|
-
workspaceKeySourceSchema
|
|
1060
|
+
workspaceKeySourceSchema,
|
|
1061
|
+
workspaceTargetSchema
|
|
1022
1062
|
};
|
|
1023
1063
|
//# sourceMappingURL=model.js.map
|