dinkster-api 0.0.2__py3-none-any.whl
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.
- dinkster_api/__init__.py +9 -0
- dinkster_api/py.typed +0 -0
- dinkster_api/v1.py +935 -0
- dinkster_api-0.0.2.dist-info/METADATA +16 -0
- dinkster_api-0.0.2.dist-info/RECORD +238 -0
- dinkster_api-0.0.2.dist-info/WHEEL +4 -0
- dinkster_api-0.0.2.dist-info/entry_points.txt +2 -0
- dinkster_assets/__init__.py +337 -0
- dinkster_assets/acquire.py +226 -0
- dinkster_assets/acquisition_plan.py +145 -0
- dinkster_assets/audio.py +119 -0
- dinkster_assets/catalog.py +156 -0
- dinkster_assets/component_manifest.py +110 -0
- dinkster_assets/declared.py +218 -0
- dinkster_assets/fetch.py +495 -0
- dinkster_assets/guess.py +136 -0
- dinkster_assets/identity.py +72 -0
- dinkster_assets/integrity.py +310 -0
- dinkster_assets/json_metadata.py +41 -0
- dinkster_assets/kind.py +52 -0
- dinkster_assets/latent_format.py +346 -0
- dinkster_assets/library.py +816 -0
- dinkster_assets/media.py +1385 -0
- dinkster_assets/migrations/env.py +38 -0
- dinkster_assets/migrations/script.py.mako +28 -0
- dinkster_assets/migrations/versions/0001_asset_records_create_asset_record_catalog.py +109 -0
- dinkster_assets/migrations/versions/0002_asset_observations.py +36 -0
- dinkster_assets/model.py +242 -0
- dinkster_assets/mounts.py +1278 -0
- dinkster_assets/need.py +168 -0
- dinkster_assets/pack_assets.py +217 -0
- dinkster_assets/probe.py +118 -0
- dinkster_assets/provenance.py +254 -0
- dinkster_assets/public_acquisition.py +424 -0
- dinkster_assets/py.typed +0 -0
- dinkster_assets/records.py +899 -0
- dinkster_assets/resolution.py +778 -0
- dinkster_assets/resolver_index.py +364 -0
- dinkster_assets/resolver_subscription.py +1149 -0
- dinkster_assets/save_target.py +139 -0
- dinkster_assets/schema.py +73 -0
- dinkster_assets/selections.py +256 -0
- dinkster_assets/transport.py +243 -0
- dinkster_assets/value.py +258 -0
- dinkster_assets/vault.py +276 -0
- dinkster_assets/writer.py +765 -0
- dinkster_caches/__init__.py +19 -0
- dinkster_caches/cas.py +310 -0
- dinkster_caches/disk.py +330 -0
- dinkster_caches/layered.py +150 -0
- dinkster_caches/memory.py +208 -0
- dinkster_caches/py.typed +0 -0
- dinkster_caches/wire.py +346 -0
- dinkster_image_document/__init__.py +39 -0
- dinkster_image_document/blend.py +264 -0
- dinkster_image_document/compat.py +211 -0
- dinkster_image_document/document.py +374 -0
- dinkster_image_document/format.py +569 -0
- dinkster_image_document/interchange.py +572 -0
- dinkster_image_document/py.typed +1 -0
- dinkster_image_document/render.py +455 -0
- dinkster_inference_wire/__init__.py +141 -0
- dinkster_inference_wire/camera_wire.py +127 -0
- dinkster_inference_wire/conditioning.py +752 -0
- dinkster_inference_wire/conditioning_wire.py +1143 -0
- dinkster_inference_wire/devices.py +285 -0
- dinkster_inference_wire/generation.py +446 -0
- dinkster_inference_wire/hook_values.py +168 -0
- dinkster_inference_wire/ic_lora_parameters.py +69 -0
- dinkster_inference_wire/latents.py +244 -0
- dinkster_inference_wire/media_wire.py +169 -0
- dinkster_inference_wire/openai_generation.py +1035 -0
- dinkster_inference_wire/pose_keypoint.py +83 -0
- dinkster_inference_wire/process.py +33 -0
- dinkster_inference_wire/py.typed +0 -0
- dinkster_inference_wire/registry.py +116 -0
- dinkster_inference_wire/sam3_wire.py +68 -0
- dinkster_inference_wire/sampling_wire.py +279 -0
- dinkster_inference_wire/sources.py +399 -0
- dinkster_inference_wire/spaces.py +344 -0
- dinkster_inference_wire/sparse.py +372 -0
- dinkster_inference_wire/splat_wire.py +23 -0
- dinkster_inference_wire/types.py +256 -0
- dinkster_inference_wire/vision_wire.py +53 -0
- dinkster_inference_wire/voxel_wire.py +72 -0
- dinkster_inference_wire/wan_wire.py +93 -0
- dinkster_inference_wire/weights.py +219 -0
- dinkster_memory/__init__.py +92 -0
- dinkster_memory/accelerator.py +96 -0
- dinkster_memory/budgets.py +96 -0
- dinkster_memory/details.py +91 -0
- dinkster_memory/governor.py +554 -0
- dinkster_memory/leases.py +176 -0
- dinkster_memory/py.typed +0 -0
- dinkster_memory/release.py +131 -0
- dinkster_memory/reported.py +101 -0
- dinkster_memory/reservations.py +101 -0
- dinkster_memory/resident.py +600 -0
- dinkster_memory/system.py +614 -0
- dinkster_memory/tenants.py +67 -0
- dinkster_protocol/__init__.py +1008 -0
- dinkster_protocol/attention.py +652 -0
- dinkster_protocol/extension_contribution_kinds.json +21 -0
- dinkster_protocol/extension_contribution_kinds.py +43 -0
- dinkster_protocol/extensions.py +742 -0
- dinkster_protocol/frontend_modules.py +145 -0
- dinkster_protocol/multigpu.py +107 -0
- dinkster_protocol/pack_surfaces.py +489 -0
- dinkster_protocol/payload.py +63 -0
- dinkster_protocol/preview.py +86 -0
- dinkster_protocol/py.typed +0 -0
- dinkster_protocol/result_algebra.py +380 -0
- dinkster_protocol/result_document.py +244 -0
- dinkster_protocol/run_control.py +96 -0
- dinkster_protocol/training.py +399 -0
- dinkster_protocol/workgroup.py +1014 -0
- dinkster_registry/__init__.py +135 -0
- dinkster_registry/admission.py +372 -0
- dinkster_registry/artifact.py +128 -0
- dinkster_registry/composition.py +152 -0
- dinkster_registry/grants.py +206 -0
- dinkster_registry/install.py +1017 -0
- dinkster_registry/model.py +414 -0
- dinkster_registry/principals.py +494 -0
- dinkster_registry/py.typed +0 -0
- dinkster_schema/__init__.py +347 -0
- dinkster_schema/capture.py +240 -0
- dinkster_schema/coerce.py +186 -0
- dinkster_schema/comfy_alias.py +496 -0
- dinkster_schema/comfy_group.py +768 -0
- dinkster_schema/elaborate.py +676 -0
- dinkster_schema/execution.py +24 -0
- dinkster_schema/expansion.py +123 -0
- dinkster_schema/log.py +206 -0
- dinkster_schema/media.py +77 -0
- dinkster_schema/model.py +2920 -0
- dinkster_schema/names.py +25 -0
- dinkster_schema/node.py +137 -0
- dinkster_schema/output_descriptors.py +63 -0
- dinkster_schema/py.typed +0 -0
- dinkster_schema/replace.py +1853 -0
- dinkster_schema/reporting.py +441 -0
- dinkster_schema/solve.py +178 -0
- dinkster_schema/wire.py +1876 -0
- dinkster_values/__init__.py +625 -0
- dinkster_values/_media_array.py +7 -0
- dinkster_values/absent.py +77 -0
- dinkster_values/asset_folders.py +64 -0
- dinkster_values/assets.py +106 -0
- dinkster_values/audio_codec.py +594 -0
- dinkster_values/audio_lazy.py +871 -0
- dinkster_values/builtin_types.py +181 -0
- dinkster_values/curve.py +260 -0
- dinkster_values/detection_codec.py +286 -0
- dinkster_values/image_codec.py +691 -0
- dinkster_values/image_components.py +219 -0
- dinkster_values/latent_codec.py +514 -0
- dinkster_values/limits.py +52 -0
- dinkster_values/lists.py +216 -0
- dinkster_values/media_containers.py +70 -0
- dinkster_values/model.py +417 -0
- dinkster_values/model3d_codec.py +167 -0
- dinkster_values/names.py +168 -0
- dinkster_values/pins.py +77 -0
- dinkster_values/py.typed +0 -0
- dinkster_values/registry.py +1105 -0
- dinkster_values/resident.py +210 -0
- dinkster_values/resources.py +210 -0
- dinkster_values/splat_codec.py +477 -0
- dinkster_values/storage.py +133 -0
- dinkster_values/streams.py +241 -0
- dinkster_values/svg_codec.py +120 -0
- dinkster_values/timeline_video.py +68 -0
- dinkster_values/tuples.py +61 -0
- dinkster_values/video_codec.py +897 -0
- dinkster_values/video_document.py +315 -0
- dinkster_values/video_edits.py +253 -0
- dinkster_values/video_probe.py +221 -0
- dinkster_video/__init__.py +58 -0
- dinkster_video/document.py +352 -0
- dinkster_video/formats.py +722 -0
- dinkster_video/image_math.py +175 -0
- dinkster_video/preview/dinkster-pack.toml +36 -0
- dinkster_video/preview/src/dinkster_video_preview/__init__.py +84 -0
- dinkster_video/preview/src/dinkster_video_preview/preview.js +45 -0
- dinkster_video/py.typed +1 -0
- dinkster_video/runtime.py +1561 -0
- dinkster_video/timeline.py +576 -0
- dinkster_video/timeline_runtime.py +305 -0
- dinkster_video_preview/__init__.py +84 -0
- dinkster_video_preview/preview.js +45 -0
- dinkster_workers/__init__.py +207 -0
- dinkster_workers/_doctor_probe.py +359 -0
- dinkster_workers/accelerator.py +156 -0
- dinkster_workers/aimdo_bootstrap.py +81 -0
- dinkster_workers/backend_env.py +1485 -0
- dinkster_workers/blobs.py +402 -0
- dinkster_workers/boundary.py +1918 -0
- dinkster_workers/catalog.py +182 -0
- dinkster_workers/devices.py +164 -0
- dinkster_workers/diagnostics.py +64 -0
- dinkster_workers/dispatch.py +298 -0
- dinkster_workers/doctor.py +1382 -0
- dinkster_workers/egress.py +344 -0
- dinkster_workers/error_hints.py +175 -0
- dinkster_workers/execution.py +160 -0
- dinkster_workers/governed.py +123 -0
- dinkster_workers/headroom.py +156 -0
- dinkster_workers/host.py +3116 -0
- dinkster_workers/in_process.py +1325 -0
- dinkster_workers/interpreter.py +84 -0
- dinkster_workers/isolated.py +862 -0
- dinkster_workers/launch.py +72 -0
- dinkster_workers/manifest.py +3332 -0
- dinkster_workers/media.py +196 -0
- dinkster_workers/pack_environment.py +473 -0
- dinkster_workers/pack_lock.py +359 -0
- dinkster_workers/placement.py +215 -0
- dinkster_workers/preview_artifacts.py +233 -0
- dinkster_workers/produced_assets.py +218 -0
- dinkster_workers/provision.py +597 -0
- dinkster_workers/py.typed +0 -0
- dinkster_workers/relay.py +762 -0
- dinkster_workers/remote.py +921 -0
- dinkster_workers/resume.py +490 -0
- dinkster_workers/routing.py +134 -0
- dinkster_workers/run_control.py +275 -0
- dinkster_workers/sandbox.py +798 -0
- dinkster_workers/saved_artifacts.py +275 -0
- dinkster_workers/service.py +593 -0
- dinkster_workers/session.py +2605 -0
- dinkster_workers/single_job_multi_gpu.py +7 -0
- dinkster_workers/staging.py +230 -0
- dinkster_workers/transport.py +161 -0
- dinkster_workers/workgroup.py +729 -0
- dinkster_workers/workgroup_compose.py +135 -0
- dinkster_workers/workgroup_config.py +196 -0
- dinkster_workers/workgroup_session.py +340 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Immutable folder preference, never filesystem authority or a host path."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from collections.abc import Generator, Mapping
|
|
7
|
+
from contextlib import contextmanager
|
|
8
|
+
from contextvars import ContextVar
|
|
9
|
+
from dataclasses import dataclass
|
|
10
|
+
from typing import cast
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class AssetFolderContext:
|
|
15
|
+
mounts: tuple[str, ...]
|
|
16
|
+
output_mount: str | None = None
|
|
17
|
+
|
|
18
|
+
def __post_init__(self) -> None:
|
|
19
|
+
mounts = cast(object, self.mounts)
|
|
20
|
+
if not isinstance(mounts, tuple) or any(
|
|
21
|
+
not isinstance(item, str) or re.fullmatch(r"[a-z0-9][a-z0-9-]*", item) is None
|
|
22
|
+
for item in cast(tuple[object, ...], mounts)
|
|
23
|
+
):
|
|
24
|
+
raise ValueError("asset folder mounts must be a tuple of mount ids")
|
|
25
|
+
if len(set(self.mounts)) != len(self.mounts):
|
|
26
|
+
raise ValueError("asset folder mount ids must be unique")
|
|
27
|
+
if self.output_mount is not None and self.output_mount not in self.mounts:
|
|
28
|
+
raise ValueError("asset folder output must belong to its mounts")
|
|
29
|
+
|
|
30
|
+
def to_wire(self) -> dict[str, object]:
|
|
31
|
+
return {"mounts": list(self.mounts), "outputMount": self.output_mount}
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_wire(cls, raw: object) -> AssetFolderContext:
|
|
35
|
+
if not isinstance(raw, Mapping):
|
|
36
|
+
raise ValueError("asset folders must contain mounts and outputMount")
|
|
37
|
+
wire = cast(Mapping[object, object], raw)
|
|
38
|
+
if set(wire) != {"mounts", "outputMount"}:
|
|
39
|
+
raise ValueError("asset folders must contain mounts and outputMount")
|
|
40
|
+
mounts = wire["mounts"]
|
|
41
|
+
output = wire["outputMount"]
|
|
42
|
+
if not isinstance(mounts, list) or any(
|
|
43
|
+
not isinstance(item, str) for item in cast(list[object], mounts)
|
|
44
|
+
):
|
|
45
|
+
raise ValueError("asset folder mounts must be a list of mount ids")
|
|
46
|
+
if output is not None and not isinstance(output, str):
|
|
47
|
+
raise ValueError("asset folder output must be a mount id or null")
|
|
48
|
+
return cls(tuple(cast(list[str], mounts)), output)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
_asset_folders: ContextVar[AssetFolderContext | None] = ContextVar("asset_folders", default=None)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def current_asset_folders() -> AssetFolderContext | None:
|
|
55
|
+
return _asset_folders.get()
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@contextmanager
|
|
59
|
+
def use_asset_folders(context: AssetFolderContext | None) -> Generator[None]:
|
|
60
|
+
token = _asset_folders.set(context)
|
|
61
|
+
try:
|
|
62
|
+
yield
|
|
63
|
+
finally:
|
|
64
|
+
_asset_folders.reset(token)
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""The ``asset<T>`` type-id constructor (typed assets, joint contract
|
|
2
|
+
2026-07-26).
|
|
3
|
+
|
|
4
|
+
The closed runtime type-id grammar is
|
|
5
|
+
``atom | list<id> | asset<id> | stream<id>``. An ``asset<T>`` value is the SAME
|
|
6
|
+
envelope shape as the untyped ``dinkster.asset`` atom - an AssetRef wrapped
|
|
7
|
+
by the base asset codec, fingerprinted by its content digest - stamped
|
|
8
|
+
with the parametric id so the type system knows what the asset decodes
|
|
9
|
+
to. Bare ``dinkster.asset`` remains the untyped atom for assets with no
|
|
10
|
+
single decode target (checkpoint-style multi-output loads).
|
|
11
|
+
|
|
12
|
+
The canonical grammar lives here (values own the type-id namespace),
|
|
13
|
+
using the constructor parsers owned by lists.py, assets.py, and streams.py;
|
|
14
|
+
dinkster-schema imports them so expression-level types and runtime type ids can
|
|
15
|
+
never drift apart.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
from .builtin_types import ASSET_TYPE
|
|
21
|
+
from .lists import parse_list_type_id
|
|
22
|
+
from .streams import parse_stream_type_id
|
|
23
|
+
from .tuples import parse_tuple_type_id
|
|
24
|
+
|
|
25
|
+
ASSET_TYPE_PREFIX = "asset<"
|
|
26
|
+
ASSET_TYPE_SUFFIX = ">"
|
|
27
|
+
|
|
28
|
+
ASSET_BASE_TYPE = ASSET_TYPE
|
|
29
|
+
"""The registered atom whose TypeSpec backs every ``asset<...>`` id.
|
|
30
|
+
|
|
31
|
+
Defined here rather than in dinkster-assets (which depends on this package)
|
|
32
|
+
so TypeRegistry can resolve parametric asset ids without importing
|
|
33
|
+
upward; dinkster-assets imports this constant as its ASSET_TYPE."""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def asset_type_id(element_type_id: str) -> str:
|
|
37
|
+
"""The canonical type id of an asset that decodes to ``element_type_id``."""
|
|
38
|
+
return f"{ASSET_TYPE_PREFIX}{element_type_id}{ASSET_TYPE_SUFFIX}"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def parse_asset_type_id(type_id: str) -> str | None:
|
|
42
|
+
"""The decode-target type id if ``type_id`` is a canonical asset id,
|
|
43
|
+
else None. The single canonical parser - nothing else string-matches
|
|
44
|
+
asset ids."""
|
|
45
|
+
if (
|
|
46
|
+
type_id.startswith(ASSET_TYPE_PREFIX)
|
|
47
|
+
and type_id.endswith(ASSET_TYPE_SUFFIX)
|
|
48
|
+
and len(type_id) > len(ASSET_TYPE_PREFIX) + len(ASSET_TYPE_SUFFIX)
|
|
49
|
+
):
|
|
50
|
+
return type_id[len(ASSET_TYPE_PREFIX) : -len(ASSET_TYPE_SUFFIX)]
|
|
51
|
+
return None
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def runtime_type_atom(type_id: str) -> str | None:
|
|
55
|
+
"""The concrete atom inside a runtime type id, or None when malformed.
|
|
56
|
+
|
|
57
|
+
THE strict validator of the whole closed grammar
|
|
58
|
+
(``atom | list<id> | asset<id> | stream<id>``): peels ``list<...>``,
|
|
59
|
+
``asset<...>`` and ``stream<...>`` layers recursively and returns the
|
|
60
|
+
innermost atom only when it is a real atom - non-empty, no angle brackets.
|
|
61
|
+
Every malformed spelling (unbalanced brackets, empty payloads, trailing
|
|
62
|
+
garbage like ``list<a>>``) fails the final atom check, because the
|
|
63
|
+
prefix/suffix parsers strip exactly one balanced constructor layer.
|
|
64
|
+
Consumers with a registry at hand then check the atom is registered;
|
|
65
|
+
this function alone checks shape."""
|
|
66
|
+
atom = type_id
|
|
67
|
+
while True:
|
|
68
|
+
inner = parse_list_type_id(atom)
|
|
69
|
+
if inner == "*":
|
|
70
|
+
return None
|
|
71
|
+
if inner is None:
|
|
72
|
+
inner = parse_asset_type_id(atom)
|
|
73
|
+
if inner is None:
|
|
74
|
+
inner = parse_stream_type_id(atom)
|
|
75
|
+
if inner is None:
|
|
76
|
+
break
|
|
77
|
+
atom = inner
|
|
78
|
+
if not atom or "<" in atom or ">" in atom:
|
|
79
|
+
return None
|
|
80
|
+
return atom
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def runtime_type_atoms(type_id: str) -> tuple[str, ...] | None:
|
|
84
|
+
"""All leaf atoms in a valid structured type, in first-position order."""
|
|
85
|
+
pending = [type_id]
|
|
86
|
+
atoms: dict[str, None] = {}
|
|
87
|
+
while pending:
|
|
88
|
+
current = pending.pop()
|
|
89
|
+
positions = parse_tuple_type_id(current)
|
|
90
|
+
if positions is not None:
|
|
91
|
+
pending.extend(reversed(positions))
|
|
92
|
+
continue
|
|
93
|
+
inner = parse_list_type_id(current)
|
|
94
|
+
if inner == "*":
|
|
95
|
+
continue
|
|
96
|
+
if inner is None:
|
|
97
|
+
inner = parse_asset_type_id(current)
|
|
98
|
+
if inner is None:
|
|
99
|
+
inner = parse_stream_type_id(current)
|
|
100
|
+
if inner is not None:
|
|
101
|
+
pending.append(inner)
|
|
102
|
+
elif not current or any(char in current for char in "<>,"):
|
|
103
|
+
return None
|
|
104
|
+
else:
|
|
105
|
+
atoms.setdefault(current, None)
|
|
106
|
+
return tuple(atoms)
|