@phosphorco/bb-cross-references 0.1.1 → 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/CONTRACT.md +158 -0
- package/README.md +29 -0
- package/dist/bb.js +403 -58
- package/dist/index.js +358 -56
- package/dist/react.js +328 -56
- package/dist/testing.js +18 -1
- package/dist/types/bb.d.ts +509 -1
- package/dist/types/evidence-v2.d.ts +1080 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/lookup.d.ts +10 -0
- package/dist/types/recognition.d.ts +29 -0
- package/dist/types/testing.d.ts +11 -0
- package/package.json +4 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -532,3 +532,7 @@ export type GetProjectionRpcOutput = GetProjectionResponse;
|
|
|
532
532
|
export type ListBacklinksRpcOutput = ListBacklinksResponse;
|
|
533
533
|
export type ListForwardReferencesRpcOutput = ListForwardReferencesResponse;
|
|
534
534
|
export type AttachmentSnapshot = ReferenceSnapshot;
|
|
535
|
+
export { recognitionIdentity, recognitionIdentityRecord, RECOGNITION_CODEC_VERSION, MAX_RECOGNITION_IDENTITY_BYTES, type VerifiedRecognitionThread } from './recognition.js';
|
|
536
|
+
export { verifiedFileIdentity, verifiedFileIdentityRecord, VerifiedFileTargetSchema, type VerifiedFileTarget } from './recognition.js';
|
|
537
|
+
export * from './evidence-v2.js';
|
|
538
|
+
export * from './lookup.js';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Pure identity codec. Verification is supplied by the consumer, never inferred
|
|
2
|
+
* from recognition attribution. kind and authored location are not identity. */
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { type SourceIdentity } from '@phosphorco/bb-context-recognition';
|
|
5
|
+
import { type ResourceIdentity } from './canonical.js';
|
|
6
|
+
export declare const RECOGNITION_CODEC_VERSION = 1;
|
|
7
|
+
export declare const MAX_RECOGNITION_IDENTITY_BYTES = 16384;
|
|
8
|
+
export type VerifiedRecognitionThread = {
|
|
9
|
+
id: string;
|
|
10
|
+
projectId: string;
|
|
11
|
+
deletedAt?: number | null;
|
|
12
|
+
};
|
|
13
|
+
export declare function recognitionIdentity(source: SourceIdentity, verified?: VerifiedRecognitionThread): ResourceIdentity;
|
|
14
|
+
export declare function recognitionIdentityRecord(source: SourceIdentity): string;
|
|
15
|
+
/** Verified installation-local file codec. Lexical paths are canonical slash
|
|
16
|
+
* segments; filesystem verification stays in the consumer. No Unicode/case or
|
|
17
|
+
* symlink alias rewriting: realpath establishes containment, never identity. */
|
|
18
|
+
export declare const VerifiedFileTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
19
|
+
kind: z.ZodLiteral<"workspace">;
|
|
20
|
+
environmentId: z.ZodString;
|
|
21
|
+
path: z.ZodString;
|
|
22
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
23
|
+
kind: z.ZodLiteral<"thread-storage">;
|
|
24
|
+
threadId: z.ZodString;
|
|
25
|
+
path: z.ZodString;
|
|
26
|
+
}, z.core.$strict>], "kind">;
|
|
27
|
+
export type VerifiedFileTarget = z.infer<typeof VerifiedFileTargetSchema>;
|
|
28
|
+
export declare function verifiedFileIdentity(value: VerifiedFileTarget): ResourceIdentity;
|
|
29
|
+
export declare function verifiedFileIdentityRecord(value: VerifiedFileTarget): string;
|
package/dist/types/testing.d.ts
CHANGED
|
@@ -12,3 +12,14 @@ export declare function runCrossReferencesConformance(options: {
|
|
|
12
12
|
/** Use an isolated fixture source with a fresh revision and at least one target. */
|
|
13
13
|
command: ApplyProjectionInput;
|
|
14
14
|
}): Promise<CrossReferencesConformanceResult>;
|
|
15
|
+
/** Read-only V2 conformance through the adopter's real transport/handlers.
|
|
16
|
+
* The caller owns fixture preparation; this kit never enqueues or writes. */
|
|
17
|
+
export declare function runCrossReferencesV2Conformance(options: {
|
|
18
|
+
sdk: CrossReferencesSdk;
|
|
19
|
+
pluginId?: string;
|
|
20
|
+
input: import('./evidence-v2.js').ListMentionsInputV2;
|
|
21
|
+
lookup: import('./evidence-v2.js').ResolveLookupInputV2;
|
|
22
|
+
assertPage: (page: Extract<import('./evidence-v2.js').ListMentionsOutputV2, {
|
|
23
|
+
status: 'page';
|
|
24
|
+
}>) => void | Promise<void>;
|
|
25
|
+
}): Promise<CrossReferencesConformanceResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phosphorco/bb-cross-references",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Shared Cross References v1 codecs, explicit clients, and reference controls.",
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"zod": "4.6.7",
|
|
51
|
-
"@noble/hashes": "1.8.0"
|
|
51
|
+
"@noble/hashes": "1.8.0",
|
|
52
|
+
"@phosphorco/bb-context-recognition": "0.5.0"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"@get-bb/plugin-sdk": ">=0.5.29 <0.6 || ^0.6.29",
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
"@types/jsdom": "21.1.7"
|
|
80
81
|
},
|
|
81
82
|
"scripts": {
|
|
82
|
-
"build": "bun tools/build.mjs --entry \"src/index.ts\" --target browser --entry \"src/bb.ts\" --target browser --entry \"src/react.tsx\" --target browser --entry \"src/testing.ts\" --target browser --external \"zod\" --external \"@noble/hashes/*\" --external \"react\" --external \"react/*\" --external \"react-dom\" --external \"react-dom/*\" --external \"@get-bb/plugin-sdk\" --external \"@get-bb/plugin-sdk/*\" && tsc --project tsconfig.declarations.json && cp src/references.css dist/references.css",
|
|
83
|
+
"build": "bun tools/build.mjs --entry \"src/index.ts\" --target browser --entry \"src/bb.ts\" --target browser --entry \"src/react.tsx\" --target browser --entry \"src/testing.ts\" --target browser --external \"zod\" --external \"@phosphorco/bb-context-recognition\" --external \"@noble/hashes/*\" --external \"react\" --external \"react/*\" --external \"react-dom\" --external \"react-dom/*\" --external \"@get-bb/plugin-sdk\" --external \"@get-bb/plugin-sdk/*\" && tsc --project tsconfig.declarations.json && cp src/references.css dist/references.css",
|
|
83
84
|
"test": "bun test test",
|
|
84
85
|
"typecheck": "tsc --noEmit"
|
|
85
86
|
}
|