Skip to content

Commit aee670e

Browse files
committed
adapt sdk to current daemon ipc surfaces
1 parent c5c7271 commit aee670e

16 files changed

Lines changed: 3661 additions & 177 deletions

README.ja.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# CCCC SDK 0.4.x — CCCC 公式クライアント SDK
1+
# CCCC SDK — CCCC 公式クライアント SDK
22

33
[English](README.md) | [中文](README.zh-CN.md) | **日本語**
44

5-
> ステータス:**CCCC 0.4.x 向けに安定提供**。RC ビルドもプレビュー用途で継続提供します
5+
> ステータス:現在の **CCCC Daemon IPC v1** 系列に合わせて継続保守しています。必要に応じて RC/プレビューも提供します
66
77
CCCC SDK は CCCC プラットフォーム向けの **クライアント SDK** です。
88

@@ -25,7 +25,7 @@ SDK と CCCC Web が同じ `CCCC_HOME` を参照していれば、書き込み
2525
主な用途:
2626
- リアルタイム更新が必要な Web/IDE プラグイン(`events_stream`
2727
- Working Group を監視して自動応答する bot/service
28-
- group / actors / shared context をプログラムから管理する社内ツール
28+
- group / actors / shared context / capability ポリシー / Group Space をプログラムから管理する社内ツール
2929

3030
言語別の詳細:
3131
- Python SDK: `python/README.md`
@@ -85,11 +85,7 @@ python python/examples/auto_ack_attention.py --group g_xxx --actor user
8585

8686
## バージョニングと互換性
8787

88-
SDK は **CCCC 0.4.x** に major/minor を合わせ、パッチ/RC の進行は SDK 側で管理します:
89-
- 安定版例:`cccc-sdk==0.4.0``cccc==0.4.x`
90-
- RC プレビュー例:`cccc-sdk==0.4.1rc1` でも `cccc==0.4.x` と互換な場合があります
91-
92-
互換性は “契約/能力” で保証し、バージョン文字列の厳密一致には依存しません:
88+
言語ごとのパッケージは個別の公開 cadence を取れます。互換性は “契約/能力” で保証し、バージョン文字列の厳密一致には依存しません:
9389
- IPC バージョン(`ipc_v`
9490
- capability discovery(`capabilities`
9591
- op probing(`unknown_op` を検出)
@@ -98,7 +94,7 @@ SDK は **CCCC 0.4.x** に major/minor を合わせ、パッチ/RC の進行は
9894

9995
## Specs(contracts)
10096

101-
0.4.x 期間は、契約文書の “唯一の真源” は CCCC 本体リポジトリ側に置きます(daemon 実装と同期させるため)。
97+
現在の CCCC daemon 系列では、契約文書の “唯一の真源” は CCCC 本体リポジトリ側に置きます(daemon 実装と同期させるため)。
10298
このリポジトリでは `spec/` にミラーを置き、以下で同期できます:
10399

104100
```bash

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# CCCC SDK 0.4.x — Official Client SDKs for CCCC
1+
# CCCC SDK — Official Client SDKs for CCCC
22

33
**English** | [中文](README.zh-CN.md) | [日本語](README.ja.md)
44

5-
> Status: **stable for CCCC 0.4.x**. RC builds remain available for preview testing.
5+
> Status: maintained against the current **CCCC Daemon IPC v1** line. Preview/RC builds remain available when needed.
66
77
CCCC SDK provides **client SDKs** for building applications on top of the CCCC platform.
88

@@ -25,7 +25,7 @@ If SDK clients and CCCC Web use the same `CCCC_HOME`, all writes are shared imme
2525
Typical use cases:
2626
- Reactive UI / IDE plugins that need real-time updates (`events_stream`)
2727
- Bots/services that watch groups and respond automatically
28-
- Internal tools that create/manage groups, actors, and shared context programmatically
28+
- Internal tools that create/manage groups, actors, shared context, capability policy, and Group Space programmatically
2929

3030
For language-specific details:
3131
- Python SDK: `python/README.md`
@@ -85,11 +85,7 @@ python python/examples/auto_ack_attention.py --group g_xxx --actor user
8585

8686
## Versioning and compatibility
8787

88-
SDK versions track **CCCC major/minor** (`0.4.x`), while patch/RC cadence is SDK-owned:
89-
- Stable: `cccc-sdk==0.4.0` with `cccc==0.4.x`
90-
- RC preview: `cccc-sdk==0.4.1rc1` can still be compatible with `cccc==0.4.x`
91-
92-
Compatibility is enforced by **contracts**, not by strict version string matching:
88+
Language packages can publish on different cadences. Compatibility is enforced by **contracts**, not by strict version string matching:
9389
- IPC version (`ipc_v`)
9490
- capability discovery (`capabilities`)
9591
- operation probing (reject `unknown_op`)
@@ -98,7 +94,7 @@ See `python/examples/compat_check.py`.
9894

9995
## Specs (contracts)
10096

101-
For CCCC v0.4.x, the canonical contract documents live in the main CCCC repo (so spec and daemon evolve together).
97+
For the current CCCC daemon line, the canonical contract documents live in the main CCCC repo (so spec and daemon evolve together).
10298
This repo keeps a mirror under `spec/`:
10399

104100
```bash

README.zh-CN.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# CCCC SDK 0.4.x — CCCC 官方客户端 SDK
1+
# CCCC SDK — CCCC 官方客户端 SDK
22

33
[English](README.md) | **中文** | [日本語](README.ja.md)
44

5-
> 状态:**已稳定支持 CCCC 0.4.x**。同时保留 RC 构建用于预览测试
5+
> 状态:面向当前 **CCCC Daemon IPC v1** 主线持续维护;必要时仍会提供 RC/预览构建
66
77
CCCC SDK 是一套用于 CCCC 平台的**客户端 SDK**
88

@@ -25,7 +25,7 @@ CCCC SDK 是一套用于 CCCC 平台的**客户端 SDK**。
2525
典型场景:
2626
- 需要实时更新的 Web/IDE 插件(`events_stream`
2727
- 监听工作组并自动响应的 bot/service
28-
- 以编程方式创建/管理 group、actors、共享 context 的内部工具
28+
- 以编程方式创建/管理 group、actors、共享 context、capability 策略与 Group Space 的内部工具
2929

3030
语言细分文档:
3131
- Python SDK:`python/README.md`
@@ -85,11 +85,7 @@ python python/examples/auto_ack_attention.py --group g_xxx --actor user
8585

8686
## 版本策略与兼容性
8787

88-
SDK 的 major/minor 对齐 **CCCC 0.4.x**,但补丁/RC 节奏由 SDK 自身维护:
89-
- 稳定版示例:`cccc-sdk==0.4.0` 搭配 `cccc==0.4.x`
90-
- RC 预览示例:`cccc-sdk==0.4.1rc1` 也可能兼容 `cccc==0.4.x`
91-
92-
我们保证兼容性的手段是“契约/能力”,而不是字符串版本号硬匹配:
88+
不同语言包可以按各自节奏发布。我们保证兼容性的手段是“契约/能力”,而不是字符串版本号硬匹配:
9389
- IPC 版本(`ipc_v`
9490
- capability discovery(`capabilities`
9591
- op probing(拒绝 `unknown_op`
@@ -98,7 +94,7 @@ SDK 的 major/minor 对齐 **CCCC 0.4.x**,但补丁/RC 节奏由 SDK 自身维
9894

9995
## 合约文档(contracts)
10096

101-
在 0.4.x 期间,合约文档的“唯一真源”在 CCCC 主仓库(保证 spec 与 daemon 同步演进)。
97+
当前 CCCC daemon 主线上,合约文档的“唯一真源”在 CCCC 主仓库(保证 spec 与 daemon 同步演进)。
10298
本仓库的 `spec/` 是镜像,可用脚本刷新:
10399

104100
```bash

python/README.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ It requires a running CCCC daemon. The SDK does **not** ship a daemon.
1212

1313
## Versioning
1414

15-
This SDK tracks **CCCC major/minor** (`0.4.x`), while patch/RC cadence is SDK-owned:
16-
- Stable example: `cccc-sdk==0.4.0` with `cccc==0.4.x`
17-
- RC preview example: `cccc-sdk==0.4.1rc1` with `cccc==0.4.x`
15+
Compatibility is determined by Daemon IPC v1 contracts and operation probing, not by strict string matching of package versions. Different language packages may publish on different cadences.
1816

1917
## Daemon endpoint discovery
2018

@@ -85,10 +83,10 @@ Auto-ACK attention messages (as a recipient):
8583
python examples/auto_ack_attention.py --group g_xxx --actor user
8684
```
8785

88-
Add a note to shared context:
86+
Add a coordination note to shared context:
8987

9088
```bash
91-
python examples/context_add_note.py --group g_xxx --content "remember to do X"
89+
python examples/context_add_note.py --group g_xxx --kind decision --content "Promote this path"
9290
```
9391

9492
Cross-group send:
@@ -99,7 +97,7 @@ python examples/send_cross_group.py --src g_src --dst g_dst --text "hello from s
9997

10098
## Actor Profiles (global reusable runtime presets)
10199

102-
`cccc` 0.4.x supports global Actor Profiles so you can reuse runtime/runner/command/env across groups.
100+
`cccc` supports global Actor Profiles so you can reuse runtime/runner/command/env across groups.
103101

104102
```python
105103
from cccc_sdk import CCCCClient
@@ -118,6 +116,10 @@ profile = c.actor_profile_upsert(
118116
"command": ["codex", "exec"],
119117
"submit": "enter",
120118
"env": {"CODEX_MODEL": "gpt-5"},
119+
"capability_defaults": {
120+
"autoload_capabilities": ["pack:space"],
121+
"default_scope": "actor",
122+
},
121123
}
122124
)
123125
profile_id = str((profile.get("profile") or {}).get("id") or "")
@@ -128,3 +130,33 @@ c.actor_add(group_id="g_xxx", actor_id="reviewer", profile_id=profile_id)
128130
# profile secrets (write-only values)
129131
c.actor_profile_secret_update(profile_id=profile_id, set={"OPENAI_API_KEY": "..."})
130132
```
133+
134+
## Current high-value surfaces
135+
136+
```python
137+
from cccc_sdk import CCCCClient
138+
139+
c = CCCCClient()
140+
141+
# Capability exposure for one caller scope
142+
caps = c.capability_state(group_id="g_xxx", actor_id="foreman")
143+
144+
# Capability policy / allowlist overlay
145+
policy = c.capability_allowlist_get()
146+
preview = c.capability_allowlist_validate(
147+
mode="patch",
148+
patch={"defaults": {"source_level": {"skillsmp_remote": "indexed"}}},
149+
)
150+
151+
# Group Space / Notebook status
152+
space = c.group_space_status(group_id="g_xxx")
153+
154+
# Context v3: add a compact shared decision or handoff
155+
c.context_sync(
156+
group_id="g_xxx",
157+
by="user",
158+
ops=[{"op": "coordination.note.add", "kind": "decision", "summary": "Use the simpler path"}],
159+
)
160+
```
161+
162+
If you need an op that does not have a dedicated helper yet, use `call()` / `call_raw()`.

python/examples/context_add_note.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@
77

88

99
def main() -> int:
10-
ap = argparse.ArgumentParser(description="Add a note to group context via context_sync.")
10+
ap = argparse.ArgumentParser(description="Add a coordination note to group context via context_sync.")
1111
ap.add_argument("--group", required=True, help="group_id")
12-
ap.add_argument("--content", required=True, help="note content")
12+
ap.add_argument("--content", required=True, help="note summary")
13+
ap.add_argument("--kind", choices=("decision", "handoff"), default="decision", help="coordination note kind")
1314
ap.add_argument("--by", default="system", help="principal id used for the context.sync ledger signal")
1415
args = ap.parse_args()
1516

1617
c = CCCCClient()
17-
res = c.context_sync(group_id=args.group, by=args.by, ops=[{"op": "note.add", "content": args.content}])
18+
res = c.context_sync(
19+
group_id=args.group,
20+
by=args.by,
21+
ops=[{"op": "coordination.note.add", "kind": args.kind, "summary": args.content}],
22+
)
1823
print(json.dumps(res, ensure_ascii=False))
1924
return 0
2025

2126

2227
if __name__ == "__main__":
2328
raise SystemExit(main())
24-

0 commit comments

Comments
 (0)