synth-code 0.0.1__py3-none-macosx_15_0_arm64.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.
- synth_code/__init__.py +0 -0
- synth_code/account.py +551 -0
- synth_code/account_http.py +86 -0
- synth_code/account_refusal.py +80 -0
- synth_code/accounting.py +148 -0
- synth_code/activity_grouping.py +149 -0
- synth_code/agent_panels.py +127 -0
- synth_code/approvals.py +397 -0
- synth_code/blobs.py +31 -0
- synth_code/cli.py +734 -0
- synth_code/client.py +413 -0
- synth_code/composer_delivery.py +139 -0
- synth_code/conversation.py +949 -0
- synth_code/daemon.py +34 -0
- synth_code/edition.py +306 -0
- synth_code/enrollment.py +304 -0
- synth_code/file_edit_facts.py +10 -0
- synth_code/freeze.py +234 -0
- synth_code/grant.py +59 -0
- synth_code/history.py +140 -0
- synth_code/history_generated.py +219 -0
- synth_code/history_wire.py +166 -0
- synth_code/image_input.py +109 -0
- synth_code/image_preview.py +105 -0
- synth_code/legacy_history.py +161 -0
- synth_code/live_turns.py +171 -0
- synth_code/model_picker.py +311 -0
- synth_code/native/manifest.json +1 -0
- synth_code/native/synth-code-runtime +0 -0
- synth_code/native.py +95 -0
- synth_code/oauth.py +284 -0
- synth_code/operator.py +116 -0
- synth_code/pack_source.py +65 -0
- synth_code/panel_request.py +291 -0
- synth_code/panels.py +40 -0
- synth_code/plugin_host.py +459 -0
- synth_code/protocol.py +35 -0
- synth_code/provider.py +313 -0
- synth_code/provider_fault.py +173 -0
- synth_code/provider_frames.py +571 -0
- synth_code/recommendation.py +324 -0
- synth_code/report.py +72 -0
- synth_code/research_events.py +44 -0
- synth_code/research_trace.py +449 -0
- synth_code/rex_view.py +58 -0
- synth_code/runtime_refusal.py +108 -0
- synth_code/schema/budgets.json +17 -0
- synth_code/schema/history-v2.json +1002 -0
- synth_code/session.py +291 -0
- synth_code/shoal.py +564 -0
- synth_code/side_panel.py +309 -0
- synth_code/skills.py +269 -0
- synth_code/slash.py +425 -0
- synth_code/source_view.py +135 -0
- synth_code/starter.json +13 -0
- synth_code/stdio.py +75 -0
- synth_code/stream.py +142 -0
- synth_code/subscriptions.py +267 -0
- synth_code/synth_authority.py +362 -0
- synth_code/synth_extra.py +32 -0
- synth_code/terminal.py +817 -0
- synth_code/terminal_journal.py +284 -0
- synth_code/terminal_layout.py +643 -0
- synth_code/terminal_surfaces.py +470 -0
- synth_code/terminal_viewport.py +125 -0
- synth_code/tool_render.py +86 -0
- synth_code/transcript_frames.py +212 -0
- synth_code/transcript_placement.py +63 -0
- synth_code/transcript_rows.py +456 -0
- synth_code/transport.py +243 -0
- synth_code/v001_history.py +468 -0
- synth_code/view.py +854 -0
- synth_code/views/__init__.py +93 -0
- synth_code/views/charts.py +196 -0
- synth_code/views/curses_adapter.py +116 -0
- synth_code/views/engine.py +170 -0
- synth_code/views/model.py +226 -0
- synth_code/views/primitives.py +270 -0
- synth_code/views/tiling.py +124 -0
- synth_code-0.0.1.dist-info/METADATA +50 -0
- synth_code-0.0.1.dist-info/RECORD +110 -0
- synth_code-0.0.1.dist-info/WHEEL +5 -0
- synth_code-0.0.1.dist-info/entry_points.txt +6 -0
- synth_code-0.0.1.dist-info/licenses/temper/LICENSE-APACHE +190 -0
- synth_code-0.0.1.dist-info/licenses/temper/LICENSE-MIT +21 -0
- synth_code-0.0.1.dist-info/licenses/temper/SOURCE.json +433 -0
- synth_code-0.0.1.dist-info/top_level.txt +2 -0
- synth_code_plugins/_sdk/__init__.py +19 -0
- synth_code_plugins/_sdk/callback_wire.py +240 -0
- synth_code_plugins/_sdk/callbacks.py +317 -0
- synth_code_plugins/_sdk/compliance.py +51 -0
- synth_code_plugins/_sdk/contracts.py +236 -0
- synth_code_plugins/_sdk/discovery.py +75 -0
- synth_code_plugins/_sdk/job_binding.py +71 -0
- synth_code_plugins/_sdk/lifecycle.py +50 -0
- synth_code_plugins/_sdk/lifecycle_generated.py +15 -0
- synth_code_plugins/_sdk/manifest.py +269 -0
- synth_code_plugins/_sdk/pack.py +332 -0
- synth_code_plugins/_sdk/push.py +98 -0
- synth_code_plugins/_sdk/records.py +26 -0
- synth_code_plugins/_sdk/registry.py +491 -0
- synth_code_plugins/_sdk/schemas.py +210 -0
- synth_code_plugins/_sdk/sources.py +230 -0
- synth_code_plugins/_sdk/surfaces.py +54 -0
- synth_code_plugins/_sdk/tools.py +172 -0
- synth_code_plugins/_sdk/worker_memory.py +49 -0
- synth_code_plugins/core/SKILL.md +6 -0
- synth_code_plugins/core/__init__.py +21 -0
- synth_code_plugins/core/plugin.toml +44 -0
- synth_code_plugins/core/source.py +18 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""Resident-memory sampling for fixture callback workers on Linux and macOS."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import ctypes
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
MAX_WORKER_RESIDENT_BYTES = 256 * 1024 * 1024
|
|
11
|
+
|
|
12
|
+
# <sys/proc_info.h> struct proc_taskinfo: six uint64_t and twelve int32_t fields.
|
|
13
|
+
_PROC_PIDTASKINFO = 4
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class _ProcTaskInfo(ctypes.Structure):
|
|
17
|
+
_fields_ = [
|
|
18
|
+
("virtual_size", ctypes.c_uint64),
|
|
19
|
+
("resident_size", ctypes.c_uint64),
|
|
20
|
+
("task_totals", ctypes.c_uint64 * 4),
|
|
21
|
+
("task_counters", ctypes.c_int32 * 12),
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if sys.platform == "darwin":
|
|
26
|
+
_proc_pidinfo = ctypes.CDLL("/usr/lib/libproc.dylib").proc_pidinfo
|
|
27
|
+
_proc_pidinfo.argtypes = [
|
|
28
|
+
ctypes.c_int,
|
|
29
|
+
ctypes.c_int,
|
|
30
|
+
ctypes.c_uint64,
|
|
31
|
+
ctypes.c_void_p,
|
|
32
|
+
ctypes.c_int,
|
|
33
|
+
]
|
|
34
|
+
_proc_pidinfo.restype = ctypes.c_int
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def resident_bytes(pid: int) -> int | None:
|
|
38
|
+
if sys.platform == "darwin":
|
|
39
|
+
info = _ProcTaskInfo()
|
|
40
|
+
size = ctypes.sizeof(info)
|
|
41
|
+
returned = _proc_pidinfo(pid, _PROC_PIDTASKINFO, 0, ctypes.byref(info), size)
|
|
42
|
+
return info.resident_size if returned == size else None
|
|
43
|
+
if sys.platform == "linux":
|
|
44
|
+
try:
|
|
45
|
+
statm = Path(f"/proc/{pid}/statm").read_text(encoding="ascii").split()
|
|
46
|
+
except FileNotFoundError:
|
|
47
|
+
return None
|
|
48
|
+
return int(statm[1]) * os.sysconf("SC_PAGE_SIZE")
|
|
49
|
+
raise OSError(f"unsupported worker memory accounting on {sys.platform}")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Core run identity and status surfaces."""
|
|
2
|
+
|
|
3
|
+
from synth_code.views import Card, Pill
|
|
4
|
+
|
|
5
|
+
from synth_code_plugins._sdk.pack import load_pack
|
|
6
|
+
from synth_code_plugins._sdk.records import record, text
|
|
7
|
+
|
|
8
|
+
from .source import follow
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def present(view, fact, frame, selected):
|
|
12
|
+
status = frame.get("status", fact.get("status", "Unknown"))
|
|
13
|
+
label = fact.get("label", "Core")
|
|
14
|
+
if view == "core-pill":
|
|
15
|
+
return Pill(label, status)
|
|
16
|
+
return Card(label, (status,))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
PACK = load_pack(
|
|
20
|
+
__name__, {"core-state": record(label=text(), status=text(64))}, present, follow
|
|
21
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
id = "core"
|
|
2
|
+
version = "1.0.0"
|
|
3
|
+
synth_api = 1
|
|
4
|
+
activation = "always"
|
|
5
|
+
permissions = ["ui_slots"]
|
|
6
|
+
|
|
7
|
+
[entrypoints]
|
|
8
|
+
skill = "skill"
|
|
9
|
+
context = "context"
|
|
10
|
+
renderer = "present"
|
|
11
|
+
tool = "manage"
|
|
12
|
+
|
|
13
|
+
[[sources]]
|
|
14
|
+
id = "core"
|
|
15
|
+
dialect = "core-state"
|
|
16
|
+
dialect_version = 1
|
|
17
|
+
schema_ref = "core-state"
|
|
18
|
+
transport = "latest_value"
|
|
19
|
+
bounds = {max_payload_bytes = 32768}
|
|
20
|
+
|
|
21
|
+
[[panels]]
|
|
22
|
+
id = "core-panel"
|
|
23
|
+
sources = ["core"]
|
|
24
|
+
|
|
25
|
+
[[views]]
|
|
26
|
+
id = "core-pill"
|
|
27
|
+
panel = "core-panel"
|
|
28
|
+
density = "compact"
|
|
29
|
+
primitive = "pill"
|
|
30
|
+
|
|
31
|
+
[[views]]
|
|
32
|
+
id = "core-status"
|
|
33
|
+
panel = "core-panel"
|
|
34
|
+
density = "full"
|
|
35
|
+
primitive = "card"
|
|
36
|
+
|
|
37
|
+
[tool]
|
|
38
|
+
name = "core_manage"
|
|
39
|
+
|
|
40
|
+
[[tool.verbs]]
|
|
41
|
+
id = "status"
|
|
42
|
+
approval = "read"
|
|
43
|
+
input_schema_ref = "core-status-input"
|
|
44
|
+
output_schema_ref = "core-status-output"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Core state sourced from the authenticated engine snapshot and journal edges."""
|
|
2
|
+
|
|
3
|
+
from synth_code_plugins._sdk.push import native_changes
|
|
4
|
+
|
|
5
|
+
_KINDS = frozenset({"run.opened", "run.finished", "core.profile.active"})
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def follow(source, endpoint):
|
|
9
|
+
if endpoint is not None:
|
|
10
|
+
raise ValueError("Core uses the active gateway")
|
|
11
|
+
native_changes(
|
|
12
|
+
source,
|
|
13
|
+
lambda snapshot: {
|
|
14
|
+
"label": "Core",
|
|
15
|
+
"status": snapshot["phase"],
|
|
16
|
+
},
|
|
17
|
+
_KINDS,
|
|
18
|
+
)
|