citekit resolve — Complete API Reference
Converts a semantic node ID into a physical clip, slice, or virtual address.
Usage
bash
# Python
python -m citekit.cli resolve <node_id> [--resource <resource_id>] [--virtual]
# JavaScript
citekit resolve <node_id> [--resource <resource_id>] [--virtual]Node ID Formats
- Dot notation:
resource_id.node_id(preferred) - Separate flags:
--resource <resource_id>withnode_idas the argument
Options
--resource (-res)
Explicitly specify the resource ID (if not using dot notation).
- Format:
resource_id - Example:
bash
# Python
python -m citekit.cli resolve --resource lecture_01 chapter_1.intro
# JavaScript
citekit resolve --resource lecture_01 chapter_1.intro--virtual
Enable virtual resolution mode (metadata-only, no extraction).
- Behavior: Skips file extraction and returns only the URI address and metadata.
- Use Case: Faster for serverless apps or when the agent only needs the citation text, not the media.
- Example:
bash
# Python
python -m citekit.cli resolve lecture_01.chapter_1 --virtual
# JavaScript
citekit resolve lecture_01.chapter_1 --virtualResolution Workflow
Physical Resolution (Default)
- Map Lookup: Loads the JSON map from
.resource_maps/<resource_id>.json - Node Finder: Recursively searches the hierarchical nodes for the target
node_id - Location Extraction: Gets the node's
locationfield (pages, timestamps, bbox, etc.) - Resolver Selection: Spawns the appropriate worker based on modality:
- Video: FFmpeg time-slice extraction
- Audio: FFmpeg segment extraction
- Document: PyMuPDF page extraction
- Image: PIL bbox crop
- Text: Native line extraction
- Surgical Extraction: Slices only the exact segment (not the entire file)
- Deduplication: Checks if output file already exists (skips re-extraction if identical)
- Evidence Return: Returns absolute file path and the URI address
Virtual Resolution
- Map Lookup: Loads the JSON map
- Node Finder: Searches for the target node
- Address Building: Constructs a URI (e.g.,
video://lecture_01#t=145-285) - Immediate Return: Returns address + metadata without touching disk or external tools
Examples
Basic resolution (physical extraction):
bash
# Python
python -m citekit.cli resolve lecture_01.intro
# JavaScript
citekit resolve lecture_01.introOutput:
[RESOLVING] Node: intro
[SUCCESS] Output: .citekit_output/lecture_01_intro.mp4
Modality: video
Address: video://lecture_01#t=0-60Using separate resource flag:
bash
# Python
python -m citekit.cli resolve chapter_1.definition --resource lecture_01
# JavaScript
citekit resolve chapter_1.definition --resource lecture_01Output:
[RESOLVING] Node: chapter_1.definition
[SUCCESS] Output: .citekit_output/lecture_01_chapter_1_definition.pdf
Modality: document
Address: doc://lecture_01#pages=12-15Virtual resolution (no extraction):
bash
# Python
python -m citekit.cli resolve lecture_01.intro --virtual
# JavaScript
citekit resolve lecture_01.intro --virtualOutput:
[RESOLVING] Node: intro
[SUCCESS] Virtual resolution successful.
Modality: video
Address: video://lecture_01#t=0-60Return Format
Physical Resolution Success
[SUCCESS] Output: .citekit_output/lecture_01_intro.mp4
Modality: video
Address: video://lecture_01#t=145-285Virtual Resolution Success
[SUCCESS] Virtual resolution successful.
Modality: video
Address: video://lecture_01#t=145-285Error Codes & Handling
Missing Resource ID (Exit Code 1)
[!] Resource ID missing. Use --resource or rid.nid format.Node Not Found (Exit Code 1)
[ERROR] Node 'nonexistent_node' not found in resource 'lecture_01'.Resolver/Extraction Failure (Exit Code 1)
[ERROR] {resolver error message}citekit inspect
View node metadata without resolving or extracting any files.
Usage
bash
python -m citekit.cli inspect <resource_id>.<node_id>
# or
python -m citekit.cli inspect <node_id> --resource <resource_id>Output Example
[INFO] Node: chapter_1.intro
Resource: lecture_01 (video)
Title: Introduction and Logistics
Type: section
Location: modality='video' start=145.5 end=285.0 pages=None lines=None bbox=None virtual_address=None
Summary: Covers course overview, expectations, and key learning objectivesErrors
Missing Resource ID (Exit Code 1):
[!] Resource ID missing. Use --resource or rid.nid format.Node Not Found (Exit Code 1):
[ERROR] Node 'invalid' not found in resource 'lecture_01'.Resource Not Found (Exit Code 1):
[ERROR] No map found for resource 'missing_id'. Expected at: .resource_maps/missing_id.jsonData Model (Location)
typescript
// Video / Audio
location: {
modality: "video" | "audio",
start: number; // seconds (float)
end: number; // seconds (float)
}
// Document (PDF, etc.)
location: {
modality: "document",
pages: number[]; // list of page numbers (1-indexed)
}
// Image
location: {
modality: "image",
bbox?: [number, number, number, number]; // [x1, y1, x2, y2] (0-1 normalized corners)
}
// Text
location: {
modality: "text",
lines: [number, number]; // [start_line, end_line] (1-indexed)
}
// Virtual
location: {
modality: "virtual",
virtual_address?: string;
}