@native-marketing/sdk 0.2.0 → 0.3.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/README.md CHANGED
@@ -46,4 +46,22 @@ const native = createContentFactoryClient({ baseUrl: 'https://ip.shipkitx.com/ap
46
46
 
47
47
  The `/http` entry contains the existing typed HTTP client, validators and generated endpoint types; it does not import the Node MCP/CLI implementation. It does not retry writes or manage browser sessions for Node callers.
48
48
 
49
+ ## Tenant application connections and event permissions
50
+
51
+ Use the exact authorized `/mcp/tenants/TEN-*` resource with `cf.context.read`, `cf.knowledge.manage` and the current Tenant's `permissions.manage` permission. Project resources cannot administer Tenant event connections.
52
+
53
+ ```ts
54
+ await withNativeAgentClient({ resource, accessToken }, async (native) => {
55
+ const connections = await native.callTool('cf_list_event_exchanges', { limit: 20 });
56
+ const schema = await native.describeCapability('cf_configure_event_exchange');
57
+ console.log(connections.result, schema.definition);
58
+ });
59
+ ```
60
+
61
+ `cf_configure_event_exchange` registers or revokes one exact EventSDK event-type Grant with the original `requestId` and current Connection `expectedRevision`. Inspect the current schema and confirm the precise source/target Tenant refs, consumer, event type and grant version before writing; events are never selected or authorized automatically. Other event types remain unchanged. Local ACTIVE does not grant peer consent, Broker access or resource readability.
62
+
63
+ Recover an unknown configure result using `cf_get_event_exchange_receipt` with the original requestId. `cf_list_event_outbox` reads one bounded page and backlog/Worker observation. An explicitly authorized `cf_recover_event_outbox` command preserves the original delivery identity and expectedGeneration; UNKNOWN uses `cf_get_event_outbox_recovery_receipt`, without replaying the command. Read each receipt under the same authorized resource/client. Receipt absence does not permit another write. Authorization management does not emit a new authorization-change CloudEvent.
64
+
65
+ The HTTP subpath includes typed GET/POST `/tenants/{tenantCode}/event-exchanges`, receipt and Outbox endpoints. HTTP uses the existing authorized Session; MCP uses resource-bound OAuth. Tenant and authorization facts remain in Native Marketing's database.
66
+
49
67
  The package's `release.json` records the actual source commit and generated API-types hash. This is a local build receipt, not CI provenance or proof that every remote business journey has been accepted. Rights reserved; public package availability does not grant an open-source license (UNLICENSED).
package/dist/index.js CHANGED
@@ -6818,7 +6818,18 @@ var surveyRejections = [
6818
6818
  "PERSONAL_SURVEY_DRAFT_TRANSITION_IMMUTABLE"
6819
6819
  ];
6820
6820
  function isKnownCapabilityRejection(code2, name) {
6821
- return capabilityRejectedErrorCodes.includes(code2) || code2 === "INVALID_CURSOR" && isChangeAcknowledgement(name) || surveyWrites.includes(name ?? "") && surveyRejections.includes(code2) || researchWrites.includes(name ?? "") && ["FOUNDATION_RECORD_CONFLICT", "FOUNDATION_INPUT_REQUIRED"].includes(code2);
6821
+ return capabilityRejectedErrorCodes.includes(code2) || name === "cf_adopt_discovered_knowledge" && [
6822
+ "KNOWLEDGE_DISCOVERY_IDENTITY_CHANGED",
6823
+ "KNOWLEDGE_DISCOVERY_FORBIDDEN",
6824
+ "KNOWLEDGE_DISCOVERY_TEXT_TOO_LARGE",
6825
+ "KNOWLEDGE_DISCOVERY_TEXT_UNSUPPORTED",
6826
+ "KNOWLEDGE_DISCOVERY_UNAVAILABLE",
6827
+ "KNOWLEDGE_CATALOG_UNAVAILABLE",
6828
+ "KNOWLEDGE_CATALOG_INVALID",
6829
+ "KNOWLEDGE_CATALOG_SCOPE_NOT_CONFIGURED",
6830
+ "KNOWLEDGE_PROVIDER_AUTH_REQUIRED",
6831
+ "KNOWLEDGE_TENANT_IDENTITY_CHANGED"
6832
+ ].includes(code2) || code2 === "INVALID_CURSOR" && isChangeAcknowledgement(name) || surveyWrites.includes(name ?? "") && surveyRejections.includes(code2) || researchWrites.includes(name ?? "") && ["FOUNDATION_RECORD_CONFLICT", "FOUNDATION_INPUT_REQUIRED"].includes(code2);
6822
6833
  }
6823
6834
  var recoveries = {
6824
6835
  CAPABILITY_SCHEMA_CHANGED: "READ_EXACT_SCHEMA",
@@ -6890,6 +6901,167 @@ function capabilityRecovery(code2, outcome, name) {
6890
6901
  return "CHECK_ACCESS_OR_REFRESH_EXACT_INPUT";
6891
6902
  }
6892
6903
 
6904
+ // packages/contracts/src/event-exchange.ts
6905
+ import { z as z99 } from "zod";
6906
+
6907
+ // packages/contracts/src/event-exchange-browser.ts
6908
+ import { z as z98 } from "zod";
6909
+ var ref2 = z98.string().min(1).max(2048);
6910
+ var eventExchangeSourceSchema = z98.object({ source: ref2, serviceRef: ref2, tenantRef: ref2, issuer: ref2, subject: ref2 }).strict();
6911
+ var eventExchangeTargetSchema = z98.object({ serviceRef: ref2, tenantRef: ref2 }).strict();
6912
+ var eventExchangeBrowserCommandSchema = z98.object({
6913
+ schemaVersion: z98.literal(1),
6914
+ requestId: z98.string().min(1).max(256),
6915
+ expectedRevision: z98.number().int().positive().nullable(),
6916
+ source: eventExchangeSourceSchema,
6917
+ target: eventExchangeTargetSchema,
6918
+ grant: z98.object({
6919
+ grantRef: z98.string().min(1).max(256),
6920
+ version: z98.number().int().positive(),
6921
+ eventType: z98.string().min(1).max(256),
6922
+ consumerRef: ref2
6923
+ }).strict(),
6924
+ status: z98.enum(["ACTIVE", "REVOKED"])
6925
+ }).strict();
6926
+
6927
+ // packages/contracts/src/event-exchange.ts
6928
+ var eventExchangePageQuerySchema = z99.object({
6929
+ after: z99.string().max(256).default(""),
6930
+ limit: z99.number().int().min(1).max(100).default(50)
6931
+ }).strict();
6932
+ var eventExchangeReceiptQuerySchema = z99.object({ requestId: z99.string().min(1).max(256) }).strict();
6933
+ var knowledgeRefreshRevisionSchema = z99.object({
6934
+ schemaVersion: z99.literal(1),
6935
+ revision: z99.string().regex(/^\d+$/),
6936
+ recordedAt: z99.string().datetime().nullable(),
6937
+ baselines: z99.array(
6938
+ z99.object({
6939
+ connectionRef: z99.string(),
6940
+ source: z99.string(),
6941
+ baselineRef: z99.string(),
6942
+ watermark: z99.string().regex(/^\d+$/),
6943
+ sourceRevision: z99.string()
6944
+ }).strict()
6945
+ ).max(100).default([]),
6946
+ baselinesTruncated: z99.boolean().default(false)
6947
+ }).strict();
6948
+ var exchangeStatus = z99.enum(["ACTIVE", "REVOKED"]);
6949
+ var direction = z99.enum(["OUTBOUND", "RECEIVE"]);
6950
+ var eventExchangeResultSchema = z99.object({
6951
+ schemaVersion: z99.literal(1),
6952
+ connectionRef: z99.string().regex(/^urn:eventsdk:connection:[a-f0-9]{64}$/),
6953
+ revision: z99.number().int().positive(),
6954
+ direction,
6955
+ status: exchangeStatus,
6956
+ grantRef: z99.string().min(1).max(256),
6957
+ grantVersion: z99.number().int().positive(),
6958
+ eventType: z99.string().optional()
6959
+ }).strict();
6960
+ var eventExchangeReceiptSchema = z99.object({
6961
+ schemaVersion: z99.literal(1),
6962
+ requestId: z99.string().min(1).max(256),
6963
+ result: eventExchangeResultSchema.nullable()
6964
+ }).strict();
6965
+ var eventExchangePageSchema = z99.object({
6966
+ schemaVersion: z99.literal(1),
6967
+ localTenant: eventExchangeTargetSchema.optional(),
6968
+ items: z99.array(
6969
+ eventExchangeResultSchema.pick({
6970
+ connectionRef: true,
6971
+ revision: true,
6972
+ direction: true,
6973
+ status: true
6974
+ }).extend({
6975
+ source: eventExchangeSourceSchema.optional(),
6976
+ target: eventExchangeTargetSchema.optional(),
6977
+ grantsTruncated: z99.boolean().optional(),
6978
+ grants: z99.array(
6979
+ z99.object({
6980
+ eventType: z99.string(),
6981
+ grantRef: z99.string(),
6982
+ grantVersion: z99.number().int().positive(),
6983
+ consumerRef: z99.string().optional(),
6984
+ source: eventExchangeSourceSchema.optional(),
6985
+ target: eventExchangeTargetSchema.optional(),
6986
+ status: exchangeStatus
6987
+ }).strict()
6988
+ ).max(100).optional()
6989
+ })
6990
+ ).max(100),
6991
+ nextAfter: z99.string().max(256).nullable()
6992
+ }).strict();
6993
+
6994
+ // packages/contracts/src/knowledge-discovery.ts
6995
+ import { z as z100 } from "zod";
6996
+ var knowledgeRemoteRefSchema = z100.string().min(1).max(4096).refine((value) => {
6997
+ try {
6998
+ const url = new URL(value);
6999
+ return !url.username && !url.password && /^[a-z][a-z0-9+.-]*:$/.test(url.protocol);
7000
+ } catch {
7001
+ return false;
7002
+ }
7003
+ });
7004
+ var knowledgeDiscoveryQuerySchema = z100.object({
7005
+ q: z100.string().trim().min(2).max(160).optional(),
7006
+ cursor: z100.string().min(1).max(8192).optional(),
7007
+ resourceType: z100.string().regex(/^[a-z][a-z0-9._-]{0,63}$/).optional(),
7008
+ limit: z100.number().int().min(1).max(50).default(20)
7009
+ }).strict();
7010
+ var knowledgeDiscoveryReadQuerySchema = z100.object({
7011
+ ref: knowledgeRemoteRefSchema,
7012
+ expectedContentHash: z100.string().regex(/^sha256:[a-f0-9]{64}$/).optional()
7013
+ }).strict();
7014
+ var knowledgeDiscoveryItemSchema = z100.object({
7015
+ ref: knowledgeRemoteRefSchema,
7016
+ ownerTenantId: z100.string().min(1).max(256),
7017
+ resourceType: z100.string().min(1).max(128),
7018
+ originType: z100.enum(["LEGACY_PROJECT", "TENANT_AUTHOR", "TENANT_SOURCE"]),
7019
+ identityHash: z100.string().regex(/^sha256:[a-f0-9]{64}$/),
7020
+ identityKind: z100.enum(["CAS_BYTES", "REFERENCE_RECORD_DIGEST"]),
7021
+ kind: z100.string().min(1).max(128),
7022
+ classification: z100.string().max(128),
7023
+ mediaType: z100.string().min(1).max(256),
7024
+ title: z100.string().max(512),
7025
+ summary: z100.string().max(1024),
7026
+ readable: z100.boolean(),
7027
+ reasonCodes: z100.array(z100.string().max(128)).max(32)
7028
+ });
7029
+ var knowledgeDiscoveryPageSchema = z100.object({
7030
+ schemaVersion: z100.literal(1),
7031
+ sourceTenantId: z100.string().min(1).max(256),
7032
+ items: z100.array(knowledgeDiscoveryItemSchema).max(50),
7033
+ pageInfo: z100.object({ nextCursor: z100.string().max(8192).nullable() }).strict(),
7034
+ coverage: z100.enum(["CURRENT_AUTHORIZED_DIRECTORY", "INDEXED_DESCRIPTIONS_ONLY"]),
7035
+ checkedAt: z100.string().datetime()
7036
+ }).strict();
7037
+ var knowledgeDiscoveryReadSchema = z100.object({
7038
+ schemaVersion: z100.literal(1),
7039
+ sourceTenantId: z100.string().min(1).max(256),
7040
+ item: knowledgeDiscoveryItemSchema,
7041
+ contentHash: z100.string().regex(/^sha256:[a-f0-9]{64}$/),
7042
+ mediaType: z100.string().min(1).max(256),
7043
+ byteLength: z100.number().int().min(0).max(524288),
7044
+ content: z100.string().max(524288),
7045
+ verified: z100.literal(true),
7046
+ checkedAt: z100.string().datetime()
7047
+ }).strict();
7048
+ var knowledgeAdoptionCommandSchema = knowledgeDiscoveryReadQuerySchema.required().extend({
7049
+ requestId: z100.string().min(1).max(128)
7050
+ }).strict();
7051
+ var knowledgeAdoptionResultSchema = z100.object({ result: sourceRefSchema, replayed: z100.boolean() }).strict();
7052
+ var knowledgeAdoptionReceiptQuerySchema = z100.object({ requestId: z100.string().min(1).max(128) }).strict();
7053
+ var knowledgeAdoptionReceiptSchema = z100.discriminatedUnion("state", [
7054
+ z100.object({ state: z100.literal("FOUND"), result: sourceRefSchema }).strict(),
7055
+ z100.object({ state: z100.literal("NOT_FOUND"), result: z100.null() }).strict(),
7056
+ commandRejectedReceiptSchema
7057
+ ]);
7058
+ var adoptedKnowledgeResourceSchema = z100.object({
7059
+ schemaVersion: z100.literal(1),
7060
+ sourceTenantId: z100.string().min(1).max(256),
7061
+ ref: knowledgeRemoteRefSchema,
7062
+ identityHash: z100.string().regex(/^sha256:[a-f0-9]{64}$/)
7063
+ }).strict();
7064
+
6893
7065
  // packages/contracts/src/agent/capability-receipts.ts
6894
7066
  var rule = (capability, schema2, operation, keys = [], field) => ({ capability, schema: schema2, operation, keys, field });
6895
7067
  var foundation = (operation, field) => rule(
@@ -6911,6 +7083,18 @@ var execution = (family, operation) => ({
6911
7083
  });
6912
7084
  var learning = (op) => rule("cf_get_learning_command_receipt", learningReceiptSchema, op);
6913
7085
  var rules = {
7086
+ cf_configure_event_exchange: rule(
7087
+ "cf_get_event_exchange_receipt",
7088
+ eventExchangeReceiptQuerySchema
7089
+ ),
7090
+ cf_recover_event_outbox: rule(
7091
+ "cf_get_event_outbox_recovery_receipt",
7092
+ eventExchangeReceiptQuerySchema
7093
+ ),
7094
+ cf_adopt_discovered_knowledge: rule(
7095
+ "cf_get_knowledge_adoption_receipt",
7096
+ knowledgeAdoptionReceiptQuerySchema
7097
+ ),
6914
7098
  cf_save_test_record: rule("cf_get_test_record_receipt", testRecordReceiptSchema, "SAVE"),
6915
7099
  cf_cleanup_test_records: rule("cf_get_test_record_receipt", testRecordReceiptSchema, "CLEANUP"),
6916
7100
  cf_register_source: rule(
@@ -7122,7 +7306,7 @@ function capabilityReceiptRead(name, input) {
7122
7306
  }
7123
7307
 
7124
7308
  // packages/contracts/src/agent/capability-status.ts
7125
- import { z as z98 } from "zod";
7309
+ import { z as z101 } from "zod";
7126
7310
  var verification = {
7127
7311
  capability: "cf_material_verification_status",
7128
7312
  schema: materialVerificationIdSchema,
@@ -7140,7 +7324,7 @@ var rules2 = {
7140
7324
  },
7141
7325
  cf_tenant_material_scan_advance: {
7142
7326
  capability: "cf_tenant_material_scan_status",
7143
- schema: z98.object({}).strict()
7327
+ schema: z101.object({}).strict()
7144
7328
  },
7145
7329
  cf_sync_materials: {
7146
7330
  capability: "cf_reconcile_materials",
@@ -7530,7 +7714,9 @@ function knowledgeError(tool5, raw) {
7530
7714
  if (typeof error.checkedAt === "string" && /^\d{4}-\d{2}-\d{2}T[\d:.]+Z$/.test(error.checkedAt))
7531
7715
  details.checkedAt = error.checkedAt;
7532
7716
  const descriptor = object2(error.descriptor);
7533
- if (descriptor && typeof descriptor.readingPath === "string" && /^\/projects\/PRJ-\d{6,}\/knowledge\/library\/[0-9a-f-]{36}$/i.test(descriptor.readingPath))
7717
+ if (descriptor && typeof descriptor.readingPath === "string" && /^\/(?:projects\/PRJ|tenants\/TEN)-\d{6,}\/knowledge\/library\/[0-9a-f-]{36}$/i.test(
7718
+ descriptor.readingPath
7719
+ ))
7534
7720
  details.readingPath = descriptor.readingPath;
7535
7721
  return new CliError(
7536
7722
  error.code,
@@ -7992,7 +8178,7 @@ function reviewLinks(resource, tool5, result2, input = {}) {
7992
8178
  }
7993
8179
  return {};
7994
8180
  }
7995
- if (tool5 === "cf_read_knowledge" && result2 && typeof result2 === "object" && "readingPath" in result2 && typeof result2.readingPath === "string" && /^\/projects\/PRJ-\d{6,}\/knowledge\/library\/[0-9a-f-]{36}$/i.test(result2.readingPath)) {
8181
+ if (tool5 === "cf_read_knowledge" && result2 && typeof result2 === "object" && "readingPath" in result2 && typeof result2.readingPath === "string" && knowledgePathMatchesResource(result2.readingPath, url.pathname)) {
7996
8182
  return { readingUrl: new URL(result2.readingPath, url.origin).href };
7997
8183
  }
7998
8184
  if (tool5 === "cf_submit_intelligence_candidate" && url.pathname === "/mcp/me" && result2 && typeof result2 === "object" && "businessCode" in result2 && typeof result2.businessCode === "string" && /^INT-[0-9]{6,}$/.test(result2.businessCode)) {
@@ -8020,6 +8206,13 @@ function reviewLinks(resource, tool5, result2, input = {}) {
8020
8206
  }
8021
8207
  return { workspaceUrl: url.origin + (tenant ? "/foundation" : "/me/identity") };
8022
8208
  }
8209
+ function knowledgePathMatchesResource(readingPath, resourcePath) {
8210
+ const resource = /^\/mcp\/((?:projects\/PRJ|tenants\/TEN)-\d{6,})$/.exec(resourcePath);
8211
+ const path = /^\/((?:projects\/PRJ|tenants\/TEN)-\d{6,})\/knowledge\/library\/[0-9a-f-]{36}$/i.exec(
8212
+ readingPath
8213
+ );
8214
+ return Boolean(resource && path && resource[1] === path[1]);
8215
+ }
8023
8216
 
8024
8217
  // packages/cli-client/src/operations.ts
8025
8218
  async function inspectNativeTool(client, name, timeout = 3e4) {
@@ -8819,13 +9012,24 @@ var commandTools = {
8819
9012
  "source read": "cf_get_opportunity_source",
8820
9013
  // 目录/正文与任务冻结 source read 分离,避免把当前知识替换为任务证据。
8821
9014
  "knowledge list": "cf_list_knowledge",
9015
+ "knowledge discover": "cf_discover_knowledge",
9016
+ "knowledge adopt": "cf_adopt_discovered_knowledge",
9017
+ "knowledge adoption-receipt": "cf_get_knowledge_adoption_receipt",
9018
+ "knowledge read-discovered": "cf_read_discovered_knowledge",
8822
9019
  "knowledge materials": "cf_list_materials",
9020
+ "knowledge topics": "cf_list_material_topics",
8823
9021
  "knowledge read": "cf_read_knowledge",
9022
+ "knowledge read-source": "cf_read_source",
8824
9023
  "knowledge select": "cf_select_knowledge",
8825
9024
  "knowledge collect": "cf_collect_materials",
8826
- "knowledge sync": "cf_sync_materials",
8827
9025
  "knowledge tenant-status": "cf_tenant_material_scan_status",
8828
- "knowledge tenant-advance": "cf_tenant_material_scan_advance",
9026
+ "knowledge reconcile": "cf_reconcile_materials",
9027
+ "event-exchanges list": "cf_list_event_exchanges",
9028
+ "event-exchanges configure": "cf_configure_event_exchange",
9029
+ "event-exchanges receipt": "cf_get_event_exchange_receipt",
9030
+ "event-exchanges outbox-list": "cf_list_event_outbox",
9031
+ "event-exchanges outbox-recover": "cf_recover_event_outbox",
9032
+ "event-exchanges outbox-receipt": "cf_get_event_outbox_recovery_receipt",
8829
9033
  "knowledge verify-start": "cf_material_verification_start",
8830
9034
  "knowledge verify-status": "cf_material_verification_status",
8831
9035
  "knowledge verify-advance": "cf_material_verification_advance",
@@ -9025,7 +9229,9 @@ function resolveBaseCommand(parsed) {
9025
9229
  function resolveCommand(parsed) {
9026
9230
  const removed = {
9027
9231
  doctor: "context",
9028
- "knowledge sync-all": "knowledge sync"
9232
+ "knowledge sync-all": "knowledge discover",
9233
+ "knowledge sync": "knowledge discover",
9234
+ "knowledge tenant-advance": "knowledge discover"
9029
9235
  };
9030
9236
  const replacement = removed[parsed.words.join(" ")];
9031
9237
  if (replacement)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@native-marketing/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {
package/release.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
- "sourceCommit": "351676c470fe22c510ee38fe9c3e6032de241407",
2
+ "sourceCommit": "10c5dcfba354af4dfed4a2faaffbb6ff6b743c62",
3
3
  "workingTreeDirty": false,
4
- "version": "0.2.0",
5
- "openapiTypesSha256": "ab00b08c6f94b2b39d7f4010de2335d70be26e7987e9db6dc57fa308426aecc4",
4
+ "version": "0.3.0",
5
+ "openapiTypesSha256": "1a86e24ce9e458e945e4df5e9c7423c9bf4253ac24b3f627f67ba38c92856a38",
6
6
  "localBuild": true
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- /** 知识工具只选择已授权项目内的来源;不允许输入租户、凭据或任意上游地址。 */
2
+ /** 知识工具只选择当前 OAuth Tenant/项目内的来源;不允许输入租户、凭据或任意上游地址。 */
3
3
  export declare const mcpKnowledgeListSchema: z.ZodObject<{
4
4
  q: z.ZodOptional<z.ZodString>;
5
5
  kind: z.ZodOptional<z.ZodEnum<{
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ export declare const eventBacklogObservationSchema: z.ZodObject<{
3
+ schemaVersion: z.ZodLiteral<1>;
4
+ observedAt: z.ZodString;
5
+ outbox: z.ZodObject<{
6
+ pendingCount: z.ZodNumber;
7
+ oldestPendingAt: z.ZodNullable<z.ZodString>;
8
+ oldestPendingAgeMs: z.ZodNullable<z.ZodNumber>;
9
+ oldestKnownPendingAt: z.ZodNullable<z.ZodString>;
10
+ unknownAgeCount: z.ZodNumber;
11
+ reasons: z.ZodArray<z.ZodObject<{
12
+ status: z.ZodString;
13
+ reasonCode: z.ZodNullable<z.ZodString>;
14
+ count: z.ZodNumber;
15
+ }, z.core.$strict>>;
16
+ reasonsTruncated: z.ZodBoolean;
17
+ }, z.core.$strict>;
18
+ unstaged: z.ZodObject<{
19
+ deliveryCount: z.ZodNumber;
20
+ oldestRecordedAt: z.ZodNullable<z.ZodString>;
21
+ }, z.core.$strict>;
22
+ inbox: z.ZodObject<{
23
+ pendingCount: z.ZodNumber;
24
+ oldestPendingAt: z.ZodNullable<z.ZodString>;
25
+ oldestPendingAgeMs: z.ZodNullable<z.ZodNumber>;
26
+ oldestKnownPendingAt: z.ZodNullable<z.ZodString>;
27
+ unknownAgeCount: z.ZodNumber;
28
+ reasons: z.ZodArray<z.ZodObject<{
29
+ status: z.ZodString;
30
+ reasonCode: z.ZodNullable<z.ZodString>;
31
+ count: z.ZodNumber;
32
+ }, z.core.$strict>>;
33
+ reasonsTruncated: z.ZodBoolean;
34
+ pendingBaselines: z.ZodNumber;
35
+ sourceGapState: z.ZodLiteral<"NOT_OBSERVED">;
36
+ }, z.core.$strict>;
37
+ quarantine: z.ZodObject<{
38
+ attributedRouteAttempts: z.ZodNumber;
39
+ coverage: z.ZodLiteral<"LOCAL_ROUTE_ATTEMPTS_ONLY">;
40
+ reasons: z.ZodArray<z.ZodObject<{
41
+ status: z.ZodString;
42
+ reasonCode: z.ZodNullable<z.ZodString>;
43
+ count: z.ZodNumber;
44
+ }, z.core.$strict>>;
45
+ reasonsTruncated: z.ZodBoolean;
46
+ }, z.core.$strict>;
47
+ }, z.core.$strict>;
@@ -0,0 +1,124 @@
1
+ import { z } from 'zod';
2
+ export declare const eventWorkerObservationSchema: z.ZodObject<{
3
+ schemaVersion: z.ZodLiteral<1>;
4
+ status: z.ZodEnum<{
5
+ CONNECTED: "CONNECTED";
6
+ DISABLED: "DISABLED";
7
+ RECONNECTING: "RECONNECTING";
8
+ STOPPED: "STOPPED";
9
+ }>;
10
+ connected: z.ZodBoolean;
11
+ at: z.ZodString;
12
+ revision: z.ZodOptional<z.ZodString>;
13
+ stale: z.ZodBoolean;
14
+ }, z.core.$strict>;
15
+ export declare const eventDeliveryPageQuerySchema: z.ZodObject<{
16
+ after: z.ZodDefault<z.ZodString>;
17
+ limit: z.ZodDefault<z.ZodNumber>;
18
+ }, z.core.$strict>;
19
+ export declare const eventDeliveryRecoveryResultSchema: z.ZodObject<{
20
+ source: z.ZodString;
21
+ id: z.ZodString;
22
+ deliveryid: z.ZodString;
23
+ schemaVersion: z.ZodLiteral<1>;
24
+ requestId: z.ZodString;
25
+ status: z.ZodLiteral<"REQUEUED">;
26
+ generation: z.ZodNumber;
27
+ attempt: z.ZodNumber;
28
+ previousReasonCode: z.ZodNullable<z.ZodString>;
29
+ }, z.core.$strict>;
30
+ export declare const eventDeliveryRecoveryReceiptSchema: z.ZodObject<{
31
+ schemaVersion: z.ZodLiteral<1>;
32
+ requestId: z.ZodString;
33
+ result: z.ZodNullable<z.ZodObject<{
34
+ source: z.ZodString;
35
+ id: z.ZodString;
36
+ deliveryid: z.ZodString;
37
+ schemaVersion: z.ZodLiteral<1>;
38
+ requestId: z.ZodString;
39
+ status: z.ZodLiteral<"REQUEUED">;
40
+ generation: z.ZodNumber;
41
+ attempt: z.ZodNumber;
42
+ previousReasonCode: z.ZodNullable<z.ZodString>;
43
+ }, z.core.$strict>>;
44
+ }, z.core.$strict>;
45
+ export declare const eventDeliveryPageSchema: z.ZodObject<{
46
+ schemaVersion: z.ZodLiteral<1>;
47
+ items: z.ZodArray<z.ZodObject<{
48
+ source: z.ZodString;
49
+ id: z.ZodString;
50
+ deliveryid: z.ZodString;
51
+ status: z.ZodEnum<{
52
+ HOLD: "HOLD";
53
+ PENDING: "PENDING";
54
+ PUBLISHED: "PUBLISHED";
55
+ UNKNOWN: "UNKNOWN";
56
+ }>;
57
+ generation: z.ZodNumber;
58
+ attempt: z.ZodNumber;
59
+ nextAttemptAt: z.ZodNumber;
60
+ reasonCode: z.ZodNullable<z.ZodString>;
61
+ queuedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
62
+ }, z.core.$strict>>;
63
+ nextAfter: z.ZodNullable<z.ZodString>;
64
+ counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
65
+ worker: z.ZodNullable<z.ZodObject<{
66
+ schemaVersion: z.ZodLiteral<1>;
67
+ status: z.ZodEnum<{
68
+ CONNECTED: "CONNECTED";
69
+ DISABLED: "DISABLED";
70
+ RECONNECTING: "RECONNECTING";
71
+ STOPPED: "STOPPED";
72
+ }>;
73
+ connected: z.ZodBoolean;
74
+ at: z.ZodString;
75
+ revision: z.ZodOptional<z.ZodString>;
76
+ stale: z.ZodBoolean;
77
+ }, z.core.$strict>>;
78
+ backlog: z.ZodOptional<z.ZodObject<{
79
+ schemaVersion: z.ZodLiteral<1>;
80
+ observedAt: z.ZodString;
81
+ outbox: z.ZodObject<{
82
+ pendingCount: z.ZodNumber;
83
+ oldestPendingAt: z.ZodNullable<z.ZodString>;
84
+ oldestPendingAgeMs: z.ZodNullable<z.ZodNumber>;
85
+ oldestKnownPendingAt: z.ZodNullable<z.ZodString>;
86
+ unknownAgeCount: z.ZodNumber;
87
+ reasons: z.ZodArray<z.ZodObject<{
88
+ status: z.ZodString;
89
+ reasonCode: z.ZodNullable<z.ZodString>;
90
+ count: z.ZodNumber;
91
+ }, z.core.$strict>>;
92
+ reasonsTruncated: z.ZodBoolean;
93
+ }, z.core.$strict>;
94
+ unstaged: z.ZodObject<{
95
+ deliveryCount: z.ZodNumber;
96
+ oldestRecordedAt: z.ZodNullable<z.ZodString>;
97
+ }, z.core.$strict>;
98
+ inbox: z.ZodObject<{
99
+ pendingCount: z.ZodNumber;
100
+ oldestPendingAt: z.ZodNullable<z.ZodString>;
101
+ oldestPendingAgeMs: z.ZodNullable<z.ZodNumber>;
102
+ oldestKnownPendingAt: z.ZodNullable<z.ZodString>;
103
+ unknownAgeCount: z.ZodNumber;
104
+ reasons: z.ZodArray<z.ZodObject<{
105
+ status: z.ZodString;
106
+ reasonCode: z.ZodNullable<z.ZodString>;
107
+ count: z.ZodNumber;
108
+ }, z.core.$strict>>;
109
+ reasonsTruncated: z.ZodBoolean;
110
+ pendingBaselines: z.ZodNumber;
111
+ sourceGapState: z.ZodLiteral<"NOT_OBSERVED">;
112
+ }, z.core.$strict>;
113
+ quarantine: z.ZodObject<{
114
+ attributedRouteAttempts: z.ZodNumber;
115
+ coverage: z.ZodLiteral<"LOCAL_ROUTE_ATTEMPTS_ONLY">;
116
+ reasons: z.ZodArray<z.ZodObject<{
117
+ status: z.ZodString;
118
+ reasonCode: z.ZodNullable<z.ZodString>;
119
+ count: z.ZodNumber;
120
+ }, z.core.$strict>>;
121
+ reasonsTruncated: z.ZodBoolean;
122
+ }, z.core.$strict>;
123
+ }, z.core.$strict>>;
124
+ }, z.core.$strict>;
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ export declare const eventExchangeSourceSchema: z.ZodObject<{
3
+ source: z.ZodString;
4
+ serviceRef: z.ZodString;
5
+ tenantRef: z.ZodString;
6
+ issuer: z.ZodString;
7
+ subject: z.ZodString;
8
+ }, z.core.$strict>;
9
+ export declare const eventExchangeTargetSchema: z.ZodObject<{
10
+ serviceRef: z.ZodString;
11
+ tenantRef: z.ZodString;
12
+ }, z.core.$strict>;
13
+ export declare const eventExchangeBrowserCommandSchema: z.ZodObject<{
14
+ schemaVersion: z.ZodLiteral<1>;
15
+ requestId: z.ZodString;
16
+ expectedRevision: z.ZodNullable<z.ZodNumber>;
17
+ source: z.ZodObject<{
18
+ source: z.ZodString;
19
+ serviceRef: z.ZodString;
20
+ tenantRef: z.ZodString;
21
+ issuer: z.ZodString;
22
+ subject: z.ZodString;
23
+ }, z.core.$strict>;
24
+ target: z.ZodObject<{
25
+ serviceRef: z.ZodString;
26
+ tenantRef: z.ZodString;
27
+ }, z.core.$strict>;
28
+ grant: z.ZodObject<{
29
+ grantRef: z.ZodString;
30
+ version: z.ZodNumber;
31
+ eventType: z.ZodString;
32
+ consumerRef: z.ZodString;
33
+ }, z.core.$strict>;
34
+ status: z.ZodEnum<{
35
+ ACTIVE: "ACTIVE";
36
+ REVOKED: "REVOKED";
37
+ }>;
38
+ }, z.core.$strict>;
39
+ export type EventExchangeBrowserCommand = z.infer<typeof eventExchangeBrowserCommandSchema>;
@@ -0,0 +1,110 @@
1
+ import { z } from 'zod';
2
+ export declare const eventExchangePageQuerySchema: z.ZodObject<{
3
+ after: z.ZodDefault<z.ZodString>;
4
+ limit: z.ZodDefault<z.ZodNumber>;
5
+ }, z.core.$strict>;
6
+ export declare const eventExchangeReceiptQuerySchema: z.ZodObject<{
7
+ requestId: z.ZodString;
8
+ }, z.core.$strict>;
9
+ export declare const knowledgeRefreshRevisionSchema: z.ZodObject<{
10
+ schemaVersion: z.ZodLiteral<1>;
11
+ revision: z.ZodString;
12
+ recordedAt: z.ZodNullable<z.ZodString>;
13
+ baselines: z.ZodDefault<z.ZodArray<z.ZodObject<{
14
+ connectionRef: z.ZodString;
15
+ source: z.ZodString;
16
+ baselineRef: z.ZodString;
17
+ watermark: z.ZodString;
18
+ sourceRevision: z.ZodString;
19
+ }, z.core.$strict>>>;
20
+ baselinesTruncated: z.ZodDefault<z.ZodBoolean>;
21
+ }, z.core.$strict>;
22
+ export declare const eventExchangeResultSchema: z.ZodObject<{
23
+ schemaVersion: z.ZodLiteral<1>;
24
+ connectionRef: z.ZodString;
25
+ revision: z.ZodNumber;
26
+ direction: z.ZodEnum<{
27
+ OUTBOUND: "OUTBOUND";
28
+ RECEIVE: "RECEIVE";
29
+ }>;
30
+ status: z.ZodEnum<{
31
+ ACTIVE: "ACTIVE";
32
+ REVOKED: "REVOKED";
33
+ }>;
34
+ grantRef: z.ZodString;
35
+ grantVersion: z.ZodNumber;
36
+ eventType: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strict>;
38
+ export declare const eventExchangeReceiptSchema: z.ZodObject<{
39
+ schemaVersion: z.ZodLiteral<1>;
40
+ requestId: z.ZodString;
41
+ result: z.ZodNullable<z.ZodObject<{
42
+ schemaVersion: z.ZodLiteral<1>;
43
+ connectionRef: z.ZodString;
44
+ revision: z.ZodNumber;
45
+ direction: z.ZodEnum<{
46
+ OUTBOUND: "OUTBOUND";
47
+ RECEIVE: "RECEIVE";
48
+ }>;
49
+ status: z.ZodEnum<{
50
+ ACTIVE: "ACTIVE";
51
+ REVOKED: "REVOKED";
52
+ }>;
53
+ grantRef: z.ZodString;
54
+ grantVersion: z.ZodNumber;
55
+ eventType: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strict>>;
57
+ }, z.core.$strict>;
58
+ export declare const eventExchangePageSchema: z.ZodObject<{
59
+ schemaVersion: z.ZodLiteral<1>;
60
+ localTenant: z.ZodOptional<z.ZodObject<{
61
+ serviceRef: z.ZodString;
62
+ tenantRef: z.ZodString;
63
+ }, z.core.$strict>>;
64
+ items: z.ZodArray<z.ZodObject<{
65
+ connectionRef: z.ZodString;
66
+ revision: z.ZodNumber;
67
+ direction: z.ZodEnum<{
68
+ OUTBOUND: "OUTBOUND";
69
+ RECEIVE: "RECEIVE";
70
+ }>;
71
+ status: z.ZodEnum<{
72
+ ACTIVE: "ACTIVE";
73
+ REVOKED: "REVOKED";
74
+ }>;
75
+ source: z.ZodOptional<z.ZodObject<{
76
+ source: z.ZodString;
77
+ serviceRef: z.ZodString;
78
+ tenantRef: z.ZodString;
79
+ issuer: z.ZodString;
80
+ subject: z.ZodString;
81
+ }, z.core.$strict>>;
82
+ target: z.ZodOptional<z.ZodObject<{
83
+ serviceRef: z.ZodString;
84
+ tenantRef: z.ZodString;
85
+ }, z.core.$strict>>;
86
+ grantsTruncated: z.ZodOptional<z.ZodBoolean>;
87
+ grants: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
+ eventType: z.ZodString;
89
+ grantRef: z.ZodString;
90
+ grantVersion: z.ZodNumber;
91
+ consumerRef: z.ZodOptional<z.ZodString>;
92
+ source: z.ZodOptional<z.ZodObject<{
93
+ source: z.ZodString;
94
+ serviceRef: z.ZodString;
95
+ tenantRef: z.ZodString;
96
+ issuer: z.ZodString;
97
+ subject: z.ZodString;
98
+ }, z.core.$strict>>;
99
+ target: z.ZodOptional<z.ZodObject<{
100
+ serviceRef: z.ZodString;
101
+ tenantRef: z.ZodString;
102
+ }, z.core.$strict>>;
103
+ status: z.ZodEnum<{
104
+ ACTIVE: "ACTIVE";
105
+ REVOKED: "REVOKED";
106
+ }>;
107
+ }, z.core.$strict>>>;
108
+ }, z.core.$strict>>;
109
+ nextAfter: z.ZodNullable<z.ZodString>;
110
+ }, z.core.$strict>;