Python stable API
Every name in witwin_server.api, the stable Python API for Plugins, generated from the server code.
from witwin_server.api import <name> reaches every name below. Signature changes fail server/tests/test_stable_api_snapshot.py; the snapshot is server/tests/snapshots/stable_api.json. How the layers fit together: Python API.
215 names.
Plugin context and lifecycle#
| Name | Kind | What it is | Public members |
|---|---|---|---|
ContributingPlugin(plugin_id, root, runs_in_process) | class | The Plugin whose manifest is being read. | |
ContributionHandlers | class | Process-wide table of contributes keys served by a system Plugin. | listing, load, provide |
Disposable(args, kwargs) | class | dispose | |
DisposableStore() | class | Owns disposables and releases them in reverse registration order. | add, append, dispose, disposed, extend |
FunctionDisposable(callback) | class | Disposable backed by a single callback. | dispose |
PluginContext(plugin_id, path, api, tool_policy=…, tool_namespaces=…, system=…) | class | complete_walkthrough, console, dispose, on_startup, scene, startup_hooks, track, viewport | |
Registry(kind, stamp=…, on_change=…) | class | Keyed, Plugin-owned, shadowing registry. | clear, get, items, keys, owned_by, owner, register, set_owner, unregister, values |
StartupEvent(server, tools=…, shared=…) | class | What a startup step receives. | |
track_disposable(disposable) | function | Attach a registration handle to the active plugin-load store, if any. |
Project files#
| Name | Kind | What it is | Public members |
|---|---|---|---|
ProjectFs(root=…) | class | Read and write Project files by Project path. | delete, exists, ignore_next_change, is_dir, is_file, list, mkdir, read_bytes, read_text, relative, rename, resolve, root, watch, write_bytes, write_text |
ProjectPathError(code, message, path=…) | class | A path that is not a Project path. | |
resolve_project_path(root, path, strict=…, allow_root=…, allow_hidden=…, allow_runtime=…) | function | The resolved file for Project path path under root. |
Logging#
| Name | Kind | What it is | Public members |
|---|---|---|---|
add_log_handler(handler) | function | Attach handler to the witwin logger; dispose the result to detach it. | |
get_logger(module_name=…) | function | Get a logger for a specific module. | |
take_recent_log_records() | function | Return the records logged since the last call, oldest first, and forget them. |
Agent Tools#
| Name | Kind | What it is | Public members |
|---|---|---|---|
AGENT_HIDDEN_TAG | value | ||
CallerIdentity(authority_id, user_id, caller_kind, client_id, project_id, …) | class | has_scope | |
ConfirmationError | class | A challenge or grant is missing, invalid, expired, or already consumed. | |
Tool(name, description, input_schema, output_schema, run, …) | class | call, freeze_authorization, implementation_hash, is_concurrency_safe, to_schema, validate_input | |
ToolError(message, code=…, detail=…) | class | Generic tool failure carrying a structured code/detail. | |
ToolInvoker(server) | class | call, list_tools, renew_challenge | |
ToolRegistry() | class | clear, get, list, names, register, restore, revision, snapshot, to_schema_list, transaction, unregister | |
close_names(name, candidates, limit=…) | function | Candidates that look like name: close spellings first, then substring hits. | |
execution_denial(identity, operation, data) | function | denial for an RPC method or HTTP route; operation is a key of PATH_GUARDED_MESSAGES. | |
execution_http_refusal(server, request, msg_type, data) | function | 403 JSONResponse when an HTTP write must be refused, else None. | |
get_tool_registry() | function | ||
profile_owner(profile_id) | function | The Plugin that registered profile_id, or None for core and unknown ids. | |
profile_tools(profile_id) | function | The allowlist of a profile, or () when the profile is unknown. | |
rank_tools(registry, query, limit=…) | function | Return [{name, score}] for the top limit tools by meaning similarity to query. | |
request_identity(server, request) | function | Identity for one HTTP request from its assertion header; None if absent. | |
surface_run_progress(executor, store, event) | function | Mirror a surfaced run's lifecycle onto Notifications.progress (RFC-009 C). | |
tool(name, description, input_schema, output_schema=…, side_effects=…, …) | function | Decorator turning a function into a Tool (does not auto-register). | |
tool_ranker_is_warm() | function | True once the index is built, i.e. |
Scene#
| Name | Kind | What it is | Public members |
|---|---|---|---|
ObjectFactory | class | Factory for creating scene objects with predefined configurations. | create_camera, create_cube, create_cylinder, create_empty, create_light, create_sphere |
Scene(scene_id=…, role=…, source_object_id=…, name=…, capabilities=…, stage=…) | class | Scene containing all objects and their relationships. | add_object, allocate_id, begin_batch, build_children_order, by_type, clear, collapse_refs, create_entity, end_batch, expand_refs, from_dict, get_object, get_object_by_name, off, on, parameters, remove_component, remove_object, reorder_sibling, request_trace, resolve_dep, scene_refs, set_parent, to_dict, update_transform, update_visibility |
SceneObject(id=…, name=…, parent_id=…, mesh_type=…, mesh_path=…, …) | class | Enhanced scene object with dictionary-style component access. | add_component, allow_add_components, disable_transform, entity_type, from_dict, from_object_dict, get_all_components, get_component, has_component, locked, mesh_type, name, remove_component, system, tag, to_dict, to_object_dict, update, visible |
SceneStream | class | Static forwarders to the provider studio.scene registers. | provide |
switch_current_scene(server, scene_id, as_holder=…) | function | Save, unload and load scene_id; refused while another task lock holder uses the Scene. | |
task_lock_for(server) | function | The server's task lock, created on first use. |
Components and fields#
| Name | Kind | What it is | Public members |
|---|---|---|---|
CLAY_COLOR | value | ||
Component(kwargs) | class | Base class for all components using PyTorch tensors. | add_callback, click_button, facets, from_dict, from_properties_dict, get_definition, get_referenced_component, get_widget_config, is_group_enabled, name, on_value_change, owner, remove_callback, scene, set_field, set_group_enabled, set_widget_config, start, to_dict, to_properties_dict, update |
ComponentFacet(component, id, owner, display_name, fields, …) | class | One registered facet. | asset_order, asset_path, to_dict |
ComponentFieldInfo(name, display_name, field_type, default, readonly=…, …) | class | One field of a registered component type, as ComponentsApi.catalog lists it. | |
ComponentFieldType | class | Field types supported by the component system. | |
ComponentRegistry | class | Global registry for all components. | create_instance, get, get_all, get_base_classes, get_definitions, get_subclasses, is_subclass_of, plugin_owners |
ComponentTypeInfo(name, display_name, category, plugin_id, abstract, …) | class | One registered component type, as ComponentsApi.catalog lists it. | to_dict |
ComponentsApi(plugin_id, track) | class | Plugin-scoped component registration (ctx.components). | add_facet, catalog, facets, register |
FREQUENCY_UNITS | value | ||
Field(default_value, metadata) | class | Field descriptor for component fields with metadata. | |
Figure(_owner=…, _field_name=…) | class | Matplotlib-style figure object for building plots. | area, bar, batch, batch2d, boxplot, clear, contour, errorbar, hist, imshow, legend, line, pie, polar, radar, scatter, set_plot_data, stem, surface, table, text, title, to_dict, to_plot_data, update, xlabel, xscale, xticks, ylabel, yscale, yticks |
GizmoContext(component) | class | Context for drawing gizmos in on_draw_gizmos() method. | draw_arrow, draw_box, draw_circle, draw_cone, draw_frustum, draw_line, draw_mesh, draw_sphere, gizmos |
LightComponent | class | Light component for illumination. | |
MaterialComponent(kwargs) | class | Render appearance; the asset path optionally overrides the inline values. | asset_field_values, from_properties_dict, load_material_asset_dict, set_field, to_dict, to_dict_for_frontend, to_material_asset_dict, to_properties_dict |
MeshComponent(mesh_type=…, kwargs) | class | Mesh component for geometry. | create_cube, create_cylinder, create_sphere, drjit_faces, drjit_vertices, face_count, from_dict, from_properties_dict, get_bounds, get_drjit_data, get_faces_numpy, get_mesh_data, get_normals_numpy, get_uvs_numpy, get_vertices_numpy, is_empty, load_from_file, load_mesh_data, set_generated_mesh_source_runtime, set_generated_mesh_source_scene_binary, set_mesh_data, set_project_mesh_source, to_dict, to_properties_dict, vertex_count |
PBR_TEXTURE_FIELDS | value | ||
PlatformGeometryComponent | class | Lossless platform geometry (kind + per-kind parameters). | |
PlotData(plot_type, data, title=…, xlabel=…, ylabel=…, …) | class | Container for a single plot's data. | to_dict |
RenderSpec(geometry, material=…, passes=…) | class | A declarative render description pushed via api.viewport.set_render_spec. | to_dict |
ScalarGridResourcePublisher(kwargs) | class | Mixin/base for components that publish 3D scalar grids as binary assets. | export_volume_data, from_properties_dict, load_from_file, set_complex_volume_data, set_volume_data, start, to_dict, to_properties_dict |
ScriptGeometryComponent(kwargs) | class | Bodies generated by a Project model file; parameters are bindable fields. | bodies, copy_to_project, from_properties_dict, param_names, param_values, quiet, regenerate, schema, set_field, set_schema, set_status, start |
ScriptGeometryHooks | class | What the component calls; studio.modeling installs the real one. | approve_and_regenerate, copy_component_to_project, request |
Series(x=…, y=…, label=…, color=…, kwargs) | class | Type-safe series data container, replacing dict. | to_dict |
SkinnedMeshComponent(kwargs) | class | Skinned mesh component with bone-based vertex deformation. | bone_ids, compute_skinned_vertices, compute_skinned_vertices_numpy, from_dict, from_properties_dict, get_drjit_data, get_mesh_data, get_skinning_data, inverse_bind_matrices_tensor, on_value_change, root_bone_id, set_skinning_data, start, to_dict, to_properties_dict |
StructureMetaComponent | class | Stable Core identity plus priority, visibility, tags, and metadata. | metadata |
TransformComponent(kwargs) | class | Transform component with position, rotation, and scale. | get_quaternion, get_transformation_matrix, set_parent, set_quaternion, to_dict |
WidgetRegistry | class | Registry for widget type selection rules. | resolve_widget |
bool_field(default=…, common_params) | function | Create a boolean field (checkbox). | |
button(display_name=…, description=…, icon=…, style=…, command=…, …) | function | Decorator to mark a method as a button. | |
color_field(default=…, common_params) | function | Create a color field (RGBA color picker). | |
component(name=…, display_name=…, category=…, abstract=…) | function | Decorator for registering components. | |
component_facets(component) | function | Facets registered on the component named component, in registration order. | |
component_field(component_type, common_params) | function | Create a component reference field. | |
data_source_ref_field(default=…, default_channel=…, mode=…, kind=…, auto_subscribe=…, …) | function | Create a data source reference field. | |
define_group(group_def) | function | Register a group definition during component class definition. | |
design_spec_entries(spec) | function | DESIGN_SPEC schema entries plus the widget a parameter field of the same kind gets. | |
figure(common_params) | function | Declare a Figure for matplotlib-style plotting. | |
float_field(default=…, min=…, max=…, step=…, units=…, …) | function | Create a float field. | |
foldout_group(name, display_name=…, collapsed=…, description=…) | function | Create a foldout (collapsible) group definition. | |
image_field(common_params) | function | Create an image preview field. | |
int_field(default=…, min=…, max=…, step=…, common_params) | function | Create an integer field. | |
list_field(element_field, default=…, common_params) | function | Create a list field containing elements of a specific type. | |
ray_batch_geometry(segment_count, binary=…, positions=…, colors_type=…, colors_gain=…, …) | function | A flat batch of N line segments rendered as ONE LineSegments draw call. | |
ray_batch_material(line_width=…, additive=…) | function | Material for :func:ray_batch_geometry. | |
serialize_value(value, field_meta=…) | function | Serialize a value for WebSocket transmission. | |
set_script_geometry_hooks(hooks) | function | Install the regeneration service's hooks (None restores the inert default). | |
string_field(default=…, options=…, enum_toggle=…, widget=…, asset_kind=…, …) | function | Create a string field. | |
tab_group(name, tabs, display_name=…, description=…, sync_field=…, tab_conditions=…) | function | Create a tab group definition. | |
vector2_field(default=…, min=…, max=…, step=…, units=…, …) | function | Create a Vector2 field (2D vector). | |
vector3_field(default=…, min=…, max=…, step=…, units=…, …) | function | Create a Vector3 field (3D vector). | |
vector4_field(default=…, min=…, max=…, step=…, units=…, …) | function | Create a Vector4 field (4D vector). |
Binary assets#
| Name | Kind | What it is | Public members |
|---|---|---|---|
BinaryAssetService(persistence=…) | class | cache_bytes, cache_info, cache_size, clear, get_bytes, register_bytes, resolve_file |
Binary frames#
| Name | Kind | What it is | Public members |
|---|---|---|---|
WtbMessage(type, v=…, meta=…, buffers=…, offsets=…) | class | A decoded binary payload. | buffer, bytes_of |
wtb_decode(data, buffers=…) | function | Read one WTB1 payload into a WtbMessage. | |
wtb_encode(type, buffers=…, meta=…, v=…) | function | Encode one WTB1 payload. | |
wtb_peek_type(data) | function | Subtype of a payload without materialising buffers (None if unknown). |
Timeline#
| Name | Kind | What it is | Public members |
|---|---|---|---|
normalize_data_channel_descriptor(channel) | function | ||
normalize_data_source_descriptor(descriptor, channels=…) | function | Normalize a data source descriptor to the frontend wire shape. | |
source_from_stream_descriptor(stream, source_id=…, default_channel=…) | function | Build a stream-backed DataSourceDescriptor from a StreamDescriptor. |
Solvers and Scene references#
| Name | Kind | What it is | Public members |
|---|---|---|---|
make_scene_ref(scene, scene_snapshots=…, ref_dir=…, at_time=…) | function | Build the solver-facing scene reference payload. |
Solver-platform bridge#
| Name | Kind | What it is | Public members |
|---|---|---|---|
FieldViz | class | Consistent 2D/3D scalar-field display onto the studio surfaces. | show_2d, show_3d |
GeometryMap | class | Bidirectional map between platform geometry and studio geometry. | fill_component, to_platform, to_studio |
MaterialMap | class | Scalar core.PhysicalMaterial <-> unified Material component fields. | fill_component, to_platform, to_studio |
StructureMap | class | core.Structure <-> studio SceneObject (geometry + material + transform + meta). | to_platform, to_studio |
TransformMap | class | Quaternion [w,x,y,z] <-> studio Euler ZXY (radians). | euler_to_quat, quat_to_euler |
hydrate_project_meshes(studio_scene, project_root, strict=…) | function | Restore persisted project_mesh payloads using Studio's real loader. | |
register_platform_adapter(domain, adapter) | function | Make platform_scene.load / platform_scene.export dispatch domain to adapter. |
Project and Scene helpers#
| Name | Kind | What it is | Public members |
|---|---|---|---|
file_importer(extension) | function | The function Studio runs for a file of extension dropped on the viewport. | |
get_world_transform(obj) | function | obj's 4x4 world matrix (numpy float), parents' Transforms included. | |
hydrate_skinned_meshes(scene, project) | function | Load the skin (vertices, weights, bones) of every skinned GLB mesh in scene. | |
loaded_plugins() | function | The Plugins whose contributions are registered now (LoadedPlugin: manifest, path). | |
open_project_scene(project, scene_id) | function | Open <project>/scenes/<scene_id>.wtscene as Studio opens it, without a server. | |
plugin_roots(project_dir) | function | {plugin_id: root folder} of the Plugins a ProjectServer for project_dir would load. | |
project_dir() | function | The opened Project's root folder. | |
runtime_dir() | function | The opened Project's hidden runtime folder (<project>/.witwin). | |
save_project_scene(project, scene, scene_id=…, name=…) | function | Write scene to <project>/scenes/<scene_id>.wtscene as Studio's save does. |
User feedback and Library#
| Name | Kind | What it is | Public members |
|---|---|---|---|
Console | class | Static Console API; forwards to the provider studio.console registers. | clear, create_output_channel, error, get_history, log, provide, register_command, unregister_command, unregister_plugin_channels, unregister_plugin_commands, warn |
Library(server) | class | Handler for library management with static API. | categories, category, create_from_library, get_library_data, item_ids, register, register_category, register_item, setup_routes, unregister_category, unregister_item |
Notifications(server) | class | Handler for system notifications. | clear, clear_task, error, get_notifications, get_unread_count, info, is_cancelled, progress, register_cancel_callback, register_process, register_task, request_cancel, success, warn, warning |
install_turn_notices(server, turns, label_for) | function | Record turn ends (TurnManager finish listener) and Run ends (run event listener). | |
record_approval(server, turn_id, session_id, call_id, tool_name) | function | A Tool call waits for approval. |
Panels#
| Name | Kind | What it is | Public members |
|---|---|---|---|
Panel | class | A dockable schema panel. | on_menu_click |
Settings | class | A Settings-page entry (a schema panel with placement = "settings"). | |
WebviewController(panel_id=…) | class | Base class for a webview panel's Python side. | complete_walkthrough, global_state, on_close, on_message, on_open, plugin_id, post_message, reload, scene, scene_id, server, set_server, state, workspace_state |
panel(id, display_name=…, icon=…, menu_path=…, placement=…, …) | function | Decorator for registering panels. | |
settings(id, display_name=…, category_path=…, icon=…, group=…) | function | Decorator for registering plugin settings. | |
webview_panel(id, title=…, icon=…, menu_path=…, entry=…, …) | function | Register a :class:WebviewController subclass as a webview panel. |
RPC#
| Name | Kind | What it is | Public members |
|---|---|---|---|
PluginRpc(plugin_id, tracker=…, target=…, system=…, server=…) | class | ctx.rpc for plugins. | forget, include, publish, register, register_domain, topic, topic_head |
RpcContext(hub, connection, request_id, spec, cancel_token=…, _chunk_n=…) | class | What an RPC method receives as ctx: the caller, cancel state and the hub. | call_client, cancelled, client_id, emit, pick_client, publish, raise_if_cancelled, server, stream_client |
RpcError(code, message, retryable=…, data=…) | class | Raise from a handler to reply with a typed error instead of internal. | code, from_wire |
WireModel | class | Base for every params / result / chunk / event model. | |
hub_for(server) | function | The server's hub, created on first use. | |
rpc(name, scope, lock=…, stream=…, export=…, …) | function | Declare a core RPC method. | |
scene_operation_lock(server) | function | The per-project scene operation lock (app/websocket.py shares it), created on first use. | |
topic(name, mode, events, capacity=…, export=…, target=…) | function | Declare a topic and the event models it may carry. |
Agent hooks#
| Name | Kind | What it is | Public members |
|---|---|---|---|
AgentModel | class | Static facade over studio.agent's model relay; forwards to the provider. | complete, provide |
RequestScope(exclusive=…, denied=…, schemas=…, retrieval_text=…, reason=…) | class | What a plugin request policy wants for this request (§5.6). | |
ToolArgumentRejected(message, code=…, detail=…) | class | Raised by an argument policy to refuse a call; the model sees the message. | |
get_agent_hooks() | function | The process-wide hook registry. |
Agent Sessions#
| Name | Kind | What it is | Public members |
|---|---|---|---|
DEFAULT_PLAN_POLICY | value | ||
OperationConflict(operation_id) | class | ||
PLAN_POLICIES | value | ||
ProjectSessionStore(path) | class | SQLite Session authority for one ProjectServer. | add_listener, append, append_trace, checkpoint_get, create, delete, descendants, fork, get, last_plan_messages, list, list_children, list_started, proposals_before, rename, replace, set_archived, trace_get, trace_list, traces, update_metadata, usage_totals |
RESUMABLE_TURN_REQUEST | value | ||
RevisionConflict(session_id, expected, current) | class | ||
STORE_ONLY_KEYS | value | ||
SessionNotFound(session_id) | class | ||
TraceRecorder(turn_id, session_id, attempt=…) | class | build, live, note, observe | |
stored_copy(message) | function | message as the store will return it: keys sorted at every level. | |
write_trace(server, recorder, status, error) | function |
Other#
| Name | Kind | What it is | Public members |
|---|---|---|---|
AssetInputRef | class | ||
CancellationToken(request_id) | class | dispose, is_cancelled, is_set, on_cancelled, reason, throw_if_cancelled, wait_cancelled | |
ClientRef(id, transport=…) | class | Opaque client identity used by handlers and transport adapters. | |
ComputeClient(server_url, attachment_token, compute_server_id, timeout=…, connect=…, …) | class | Synchronous authenticated client used from RunQueue worker threads. | execute, interrupt, restart, update_callback_target |
ComputeContractModel | class | Strict snake_case model shared by host and provider adapters. | |
ContentHash(args, kwargs) | function | Runtime representation of an annotated type. | |
DetachedProcess(pid, create_time, started, exit_path) | class | A waiter process started by :func:spawn. | exit_code, from_json, kill_tree, running, to_json |
FileImporters | class | Static registry; every method is safe from any thread. | get, listing, on_changed, register, unregister, unregister_plugin |
Handler(server) | class | Base class for the server's domain Handlers. | broadcast, on_disconnect, on_shutdown, on_startup, scene, setup_routes, verbose |
HmacObjectGrantService(base_url, secret, default_ttl=…, maximum_ttl=…, clock=…) | class | Issue and verify method/key/hash/size-bound signed object URLs. | issue, verify, verify_request |
HostedRefusal(what) | class | Raised where code would start on a hosted ProjectServer. | |
ImmutableInputRef | value | ||
InterpolationType | class | Interpolation mode between keyframes. | |
LocalObjectStore(root) | class | Immutable filesystem-backed object store rooted at one directory. | get, put, put_stream, stat |
MAX_LOCAL_OBJECT_BYTES | value | ||
MaterializedInputRef | class | One immutable Project reference plus its short-lived download grant. | validate_grant_binding |
MeshAssets | class | Static forwarders to the provider studio.assets registers. | provide |
OperationCancelled | class | Raised when a cancellable operation observes a cancelled token. | |
POINT_CLOUD_FORMAT | value | ||
ParametersApi(plugin_id, api) | class | Read and edit the current Scene's parameters through scene ops (ctx.parameters). | delete, get, list, rename, set, set_values |
PatchError(message, code) | class | A patch that cannot be parsed or does not apply; code says which. | |
ProjectMaterializedRun | class | Project-owned portion of a RunSpec returned after grant authorization. | validate_bounded_payload |
RenderResourceRef(asset_id, uri, kind, format, byte_length, …) | class | to_dict | |
ResultRef | class | ||
SNAPSHOT_ENVIRONMENT_FILES | value | ||
SceneClock | class | Static forwarders to the provider studio.timeline registers. | provide |
SceneInputRef | class | ||
SceneWriteRejected(scene_id, operation, mode) | class | An authored write was refused because the Scene is not in edit mode. | |
SnapshotManifest(files, created_at, base_snapshot_id=…) | class | from_json, hashes, snapshot_id, to_json, total_bytes | |
TerminalRunCallback | class | Metadata-only terminal Run callback sent to ProjectServer. | validate_result_run |
TimelineManager(scene) | class | Manages animation playback and recording for a scene. | apply_to_scene, batch_clip_updates, build_mesh_cache, build_mesh_cache_message, clear, clear_mesh_cache, current_frame, duration, estimate_mesh_cache_vertices, fps, from_dict, get_animated_state_at, get_full_state_at, get_mesh_at_time, get_object_state_at, get_playback_range, get_track_info, move_keyframe, move_keyframes, off, on, pause, play, record_keyframe, record_keyframes, remove_keyframe, remove_object_tracks, set_recording, set_time, stop, tick, to_dict, total_frames |
VOLUME_FLOAT32_FORMAT | value | ||
VersionMismatch(scene_id, expected, received) | class | A client sent a stale state_version for a Scene's time state. | |
apply_hunks(original, hunks, rel_path) | function | original with hunks (from parse_unified_patch) applied. | |
authored_scene_payload(scene) | function | Return a serialization copy with tracked fields owned by their tracks. | |
build_snapshot_manifest(root, previous=…, previous_stats=…, base_snapshot_id=…) | function | Hash the Project. | |
builtin_skills_dir() | function | Skills shipped with witwin (witwin/witwin/skills). | |
content_hash_of(payload) | function | ||
current_script_mesh_dir() | function | The active run's folder (resolved), or None outside a script run. | |
default_db_path() | function | Path to the AI-native SQLite DB (.witwin/ai_native.db). | |
extend_object_payload(extender) | function | Call extender(scene, obj, data) on every object payload the server builds. | |
fetch_snapshot_files(root, manifest, paths, download_urls, download) | function | Download paths atomically: each file lands under a temp name, is verified, then renamed. | |
files_changed(paths, root=…) | function | Announce that paths under root changed. | |
get_cancellation_registry() | function | ||
global_skills_dir() | function | User-global skills dir (~/.witwin/skills). | |
keeping_files(keeper) | function | Make keeper receive note_file_change calls while the block runs. | |
load_scene_ref(scene_ref, scene=…) | function | What a solver's solve(ctx, scene, config) receives. | |
local_skill_paths() | function | Explicit local Skill paths; never infer sibling or current-directory sources. | |
note_file_change(path) | function | Let the active keeper copy path before a Tool changes or deletes it. | |
on_field_written(listener) | function | Call listener(scene, object_id, target, before, after) after update_component wrote a field. | |
on_files_changed(listener) | function | Call listener(paths, root) after every files_changed. | |
parse_unified_patch(patch) | function | One {"oldPath", "path", "hunks"} per file in patch. | |
plugin_index_text(loader=…) | function | The plugin index for the turn context: one line per active Plugin; "" when none. | |
project_installed_skills_dir() | function | Project-selected installed Skill packages under disposable runtime state. | |
project_skills_dir() | function | Visible, user-owned Project Skills dir (<project>/skills). | |
provide_tool_scope(scope) | function | Make scope(server, turn_id, session_id, tool, args) wrap writing Agent Tool calls. | |
push_snapshot(root, manifest, missing, upload) | function | Upload blobs the store lacks. | |
refuse_when_hosted(what) | function | Raise HostedRefusal on a hosted ProjectServer; do nothing elsewhere. | |
satisfies(version, range_spec) | function | Return True if version satisfies the (AND-ed) range_spec. | |
script_mesh_dir(folder) | function | Accept create_mesh files from folder while the block runs (one script run). | |
secret_env_get(name) | function | A sealed secret, else the environment variable (tests, unsealed hosts). | |
secret_env_lookup() | function | The environment with the sealed secrets on top, for env.get(...) readers. | |
select_snapshot(manifest, patterns, with_environment=…) | function | The part of manifest a Run stages in; no patterns means the whole Project. | |
server_version | value | ||
short_id(prefix, n=…) | function | Tier-2 id {prefix}_{n Crockford base32 chars} (dev_docs/ID_DESIGN.md §6). | |
spawn_detached(argv, cwd, env, stdout, stderr, exit_path) | function | Start argv outside the server's process tree. |
Test helpers: witwin_server.api.testing#
| Name | Kind | What it is |
|---|---|---|
testing.SceneTimeService(on_clear_runtime=…) | class | Single authority for per-scene mode/time and L1 write gates. |
testing.activate_system_plugins(project=…) | function | Activate Studio's system Plugins (studio.*) as a ProjectServer does; idempotent. |
testing.agent_hooks(plugin_id) | function | An empty, private set of Agent hooks for one test. |
testing.build_project_mesh_cache(project, asset) | function | Build the mesh cache of a Project mesh asset (asset + .wtimport), as import does. |
testing.component_types() | function | Every registered Component type, by name (copy). |
testing.library_item_ids() | function | Ids of every Library item registered so far, with or without a running server. |
testing.load_plugin(root, activate=…, force_enabled=…) | function | Load the Plugin at root with Studio's real loader; unload it on exit. |
testing.read_manifest(path) | function | Parse a witwin.toml the way the loader does; returns its PluginManifest. |
testing.select_tools(tools, user_text, history=…, context=…, policy=…, …) | function | Pick the Tools the model sees for one turn. |