daybook-suite 3.0.0rc1__tar.gz
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.
- daybook_suite-3.0.0rc1/LICENSE +39 -0
- daybook_suite-3.0.0rc1/PKG-INFO +81 -0
- daybook_suite-3.0.0rc1/README.md +64 -0
- daybook_suite-3.0.0rc1/pyproject.toml +40 -0
- daybook_suite-3.0.0rc1/setup.cfg +4 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/__init__.py +9 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/cli.py +125 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/CLA.md +167 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/LICENSE +39 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/LICENSING.md +71 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/README.en.md +223 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/README.md +113 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook.bas +25 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook.c +42 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook.conf +48 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook.f +25 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook.py +521 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook.sh +49 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook_append.py +115 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook_hook.py +191 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook_record.py +99 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/daybook_session_hook.py +271 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/safeio.py +157 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/sample/README.md +35 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/sample//345/215/217/344/275/234/345/215/267.txt +24 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/sample//347/231/276/347/247/221/345/215/267.txt +29 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/sample//350/257/255/346/261/207/345/215/267.txt +26 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/sentinel-daemon.sh +8 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/sentinel.sh +39 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload/volume_format_spec.md +110 -0
- daybook_suite-3.0.0rc1/src/daybook_suite/payload//347/211/210/346/234/254.txt +5 -0
- daybook_suite-3.0.0rc1/src/daybook_suite.egg-info/PKG-INFO +81 -0
- daybook_suite-3.0.0rc1/src/daybook_suite.egg-info/SOURCES.txt +34 -0
- daybook_suite-3.0.0rc1/src/daybook_suite.egg-info/dependency_links.txt +1 -0
- daybook_suite-3.0.0rc1/src/daybook_suite.egg-info/entry_points.txt +2 -0
- daybook_suite-3.0.0rc1/src/daybook_suite.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 手艺人老宋 <songliansheng@vip.sina.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
DAYBOOK · 白箱记忆体范式
|
|
26
|
+
- 纯文本,人机可查
|
|
27
|
+
- 白箱,黑箱对照
|
|
28
|
+
- 条目体系清楚易管理
|
|
29
|
+
- 单机查询快
|
|
30
|
+
- 绝对本地
|
|
31
|
+
- 超大容量而文件小
|
|
32
|
+
- 不用维护
|
|
33
|
+
- 跨平台,跨 AI
|
|
34
|
+
- 跨年代
|
|
35
|
+
- 跨计算机年代
|
|
36
|
+
- 移动端可读
|
|
37
|
+
- 记忆不依赖引擎存活
|
|
38
|
+
- 海量可通读
|
|
39
|
+
- 明档可见
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: daybook-suite
|
|
3
|
+
Version: 3.0.0rc1
|
|
4
|
+
Summary: DAYBOOK 起居注:纯文本、零依赖、只增不改的长期记忆账本(pip 发行版)
|
|
5
|
+
Author-email: 手艺人老宋 <songliansheng@vip.sina.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://daybooksuite.com
|
|
8
|
+
Project-URL: Repository, https://github.com/songliansheng1972/daybook-suite
|
|
9
|
+
Keywords: daybook,append-only,plain-text,long-term-memory,llm-memory,journal,zero-dependency
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Topic :: Office/Business
|
|
13
|
+
Requires-Python: >=3.8
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# DAYBOOK 起居注
|
|
19
|
+
|
|
20
|
+
**纯文本 · 零依赖 · 只增不改**的长期记忆账本。一个人一本账,卷为纯文本,索引可随时重算。
|
|
21
|
+
|
|
22
|
+
> ⚠ 本发行版为**预发布 `3.0.0rc1`**(发布通道演练件)。安装需加 `--pre`:
|
|
23
|
+
> `pip install --pre daybook-suite`
|
|
24
|
+
|
|
25
|
+
## 安装
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install --pre daybook-suite
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
装完即可用(`daybook` 命令):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
daybook index # 生成/刷新索引
|
|
35
|
+
daybook query 类=实验 时间=2026-10 # 按字段精确查条目原文
|
|
36
|
+
daybook backup # 手动备份
|
|
37
|
+
daybook watch 30 # 监视各卷,变动即重算索引 + 自动备份
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 你的数据放在哪(重要)
|
|
41
|
+
|
|
42
|
+
第一次运行会在**运行目录**就位 `daybook.conf` 与 `sample/`(示例三卷),
|
|
43
|
+
账本、索引、备份**全部落在该目录**,不会写进 Python 安装目录。
|
|
44
|
+
|
|
45
|
+
运行目录的挑选次序:
|
|
46
|
+
|
|
47
|
+
1. `--home=/path`(当次指定)
|
|
48
|
+
2. 环境变量 `DAYBOOK_HOME`
|
|
49
|
+
3. **当前目录**(仅当它已含 `daybook.conf` —— 即"用我自己那本账")
|
|
50
|
+
4. 默认 `~/.daybook`(首次自动创建)
|
|
51
|
+
|
|
52
|
+
代码本体留在包内并以软链接入,`pip install -U` 升级代码时**不会动你的账本**。
|
|
53
|
+
要用自己的账本:把 `daybook.conf` 里的 `[卷]` 路径改成你自己的纯文本卷即可(相对该目录或绝对路径都行)。
|
|
54
|
+
|
|
55
|
+
## 八件要紧的事
|
|
56
|
+
|
|
57
|
+
1. **纯文本** —— 卷是纯文本,任何编辑器、任何年代都能打开。
|
|
58
|
+
2. **零依赖** —— 只用 Python 标准库,不装任何第三方包。
|
|
59
|
+
3. **只增不改** —— 追加写,旧的条目不删不改(append-only 纪律)。
|
|
60
|
+
4. **够快** —— 索引随取随算,日常规模下即时完成。
|
|
61
|
+
5. **多写者安全** —— 带锁写入,多人/多进程同时记不会互相踩。
|
|
62
|
+
6. **图是引用** —— 结构以引用表达,不复制正文。
|
|
63
|
+
7. **可挂长期记忆** —— 可作为 AI 智能体的可读长期记忆底座。
|
|
64
|
+
8. **跨年代** —— 不依赖特定工具链,十年后仍读得出。
|
|
65
|
+
|
|
66
|
+
## 三件套
|
|
67
|
+
|
|
68
|
+
| 件 | 名 | 作用 | 许可 |
|
|
69
|
+
|---|---|---|---|
|
|
70
|
+
| `daybook-suite` | 起居注 | 账本本体:索引 / 查询 / 备份 / 监视 | MIT |
|
|
71
|
+
| `daybook-mcp` | 璇玑 | MCP 接口(resources / tools / prompts) | MIT |
|
|
72
|
+
| `daybook-orch` | 司南 | 智能体编排中心 | AGPL-3.0-or-later |
|
|
73
|
+
|
|
74
|
+
本包是**起居注**一件;另两件另行发布。整装 zip 见 GitHub Release。
|
|
75
|
+
|
|
76
|
+
## 许可
|
|
77
|
+
|
|
78
|
+
MIT License · Copyright (c) 2026 手艺人老宋 <songliansheng@vip.sina.com>
|
|
79
|
+
|
|
80
|
+
- 官网:<https://daybooksuite.com>
|
|
81
|
+
- 仓库:<https://github.com/songliansheng1972/daybook-suite>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# DAYBOOK 起居注
|
|
2
|
+
|
|
3
|
+
**纯文本 · 零依赖 · 只增不改**的长期记忆账本。一个人一本账,卷为纯文本,索引可随时重算。
|
|
4
|
+
|
|
5
|
+
> ⚠ 本发行版为**预发布 `3.0.0rc1`**(发布通道演练件)。安装需加 `--pre`:
|
|
6
|
+
> `pip install --pre daybook-suite`
|
|
7
|
+
|
|
8
|
+
## 安装
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install --pre daybook-suite
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
装完即可用(`daybook` 命令):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
daybook index # 生成/刷新索引
|
|
18
|
+
daybook query 类=实验 时间=2026-10 # 按字段精确查条目原文
|
|
19
|
+
daybook backup # 手动备份
|
|
20
|
+
daybook watch 30 # 监视各卷,变动即重算索引 + 自动备份
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 你的数据放在哪(重要)
|
|
24
|
+
|
|
25
|
+
第一次运行会在**运行目录**就位 `daybook.conf` 与 `sample/`(示例三卷),
|
|
26
|
+
账本、索引、备份**全部落在该目录**,不会写进 Python 安装目录。
|
|
27
|
+
|
|
28
|
+
运行目录的挑选次序:
|
|
29
|
+
|
|
30
|
+
1. `--home=/path`(当次指定)
|
|
31
|
+
2. 环境变量 `DAYBOOK_HOME`
|
|
32
|
+
3. **当前目录**(仅当它已含 `daybook.conf` —— 即"用我自己那本账")
|
|
33
|
+
4. 默认 `~/.daybook`(首次自动创建)
|
|
34
|
+
|
|
35
|
+
代码本体留在包内并以软链接入,`pip install -U` 升级代码时**不会动你的账本**。
|
|
36
|
+
要用自己的账本:把 `daybook.conf` 里的 `[卷]` 路径改成你自己的纯文本卷即可(相对该目录或绝对路径都行)。
|
|
37
|
+
|
|
38
|
+
## 八件要紧的事
|
|
39
|
+
|
|
40
|
+
1. **纯文本** —— 卷是纯文本,任何编辑器、任何年代都能打开。
|
|
41
|
+
2. **零依赖** —— 只用 Python 标准库,不装任何第三方包。
|
|
42
|
+
3. **只增不改** —— 追加写,旧的条目不删不改(append-only 纪律)。
|
|
43
|
+
4. **够快** —— 索引随取随算,日常规模下即时完成。
|
|
44
|
+
5. **多写者安全** —— 带锁写入,多人/多进程同时记不会互相踩。
|
|
45
|
+
6. **图是引用** —— 结构以引用表达,不复制正文。
|
|
46
|
+
7. **可挂长期记忆** —— 可作为 AI 智能体的可读长期记忆底座。
|
|
47
|
+
8. **跨年代** —— 不依赖特定工具链,十年后仍读得出。
|
|
48
|
+
|
|
49
|
+
## 三件套
|
|
50
|
+
|
|
51
|
+
| 件 | 名 | 作用 | 许可 |
|
|
52
|
+
|---|---|---|---|
|
|
53
|
+
| `daybook-suite` | 起居注 | 账本本体:索引 / 查询 / 备份 / 监视 | MIT |
|
|
54
|
+
| `daybook-mcp` | 璇玑 | MCP 接口(resources / tools / prompts) | MIT |
|
|
55
|
+
| `daybook-orch` | 司南 | 智能体编排中心 | AGPL-3.0-or-later |
|
|
56
|
+
|
|
57
|
+
本包是**起居注**一件;另两件另行发布。整装 zip 见 GitHub Release。
|
|
58
|
+
|
|
59
|
+
## 许可
|
|
60
|
+
|
|
61
|
+
MIT License · Copyright (c) 2026 手艺人老宋 <songliansheng@vip.sina.com>
|
|
62
|
+
|
|
63
|
+
- 官网:<https://daybooksuite.com>
|
|
64
|
+
- 仓库:<https://github.com/songliansheng1972/daybook-suite>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "daybook-suite"
|
|
7
|
+
version = "3.0.0rc1"
|
|
8
|
+
description = "DAYBOOK 起居注:纯文本、零依赖、只增不改的长期记忆账本(pip 发行版)"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "手艺人老宋", email = "songliansheng@vip.sina.com" }]
|
|
14
|
+
keywords = [
|
|
15
|
+
"daybook",
|
|
16
|
+
"append-only",
|
|
17
|
+
"plain-text",
|
|
18
|
+
"long-term-memory",
|
|
19
|
+
"llm-memory",
|
|
20
|
+
"journal",
|
|
21
|
+
"zero-dependency",
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
"Topic :: Office/Business",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://daybooksuite.com"
|
|
31
|
+
Repository = "https://github.com/songliansheng1972/daybook-suite"
|
|
32
|
+
|
|
33
|
+
[project.scripts]
|
|
34
|
+
daybook = "daybook_suite.cli:main"
|
|
35
|
+
|
|
36
|
+
[tool.setuptools.packages.find]
|
|
37
|
+
where = ["src"]
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.package-data]
|
|
40
|
+
daybook_suite = ["payload/*", "payload/sample/*"]
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"""daybook-suite · 薄入口(pip 发行版)
|
|
2
|
+
|
|
3
|
+
设计缘由(为什么要这一层壳)
|
|
4
|
+
----------------------------
|
|
5
|
+
`daybook.py` 以 `HERE = 自身所在目录` 锚定 `daybook.conf` 与「账本根」(索引、备份都落在 root 下)。
|
|
6
|
+
在「解压即用」的整装包里这很干净;但一旦 pip 装进 site-packages 就出问题:
|
|
7
|
+
- `daybook.conf` 不在脚本旁 ⇒ `load_conf()` 无兜底,直接报错;
|
|
8
|
+
- 即便把 conf 随包装进去,账本也会写进**程序安装目录** —— 用户无处记账。
|
|
9
|
+
|
|
10
|
+
故本壳把「代码目录」与「运行目录」分开:
|
|
11
|
+
- 代码目录 = 包内 `payload/`(随 pip 升级自动生效)
|
|
12
|
+
- 运行目录 = 见 `resolve_home()`
|
|
13
|
+
- 首次在运行目录就位:`daybook.conf` 与 `sample/` 各复制一份,每个产品 `.py` 建一条
|
|
14
|
+
**软链**指回 `payload/`
|
|
15
|
+
- 随后 `runpy` 跑「运行目录里的 `daybook.py`」⇒ `HERE` = 运行目录
|
|
16
|
+
⇒ conf / 账本 / 索引 / 备份**全部落在用户自己的目录**里
|
|
17
|
+
|
|
18
|
+
前提(已实测):`os.path.abspath` **不解析软链**,所以经软链执行时 `HERE` 会等于软链所在目录。
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
import os
|
|
22
|
+
import runpy
|
|
23
|
+
import shutil
|
|
24
|
+
import sys
|
|
25
|
+
|
|
26
|
+
__all__ = ["main", "resolve_home"]
|
|
27
|
+
|
|
28
|
+
_CONF = "daybook.conf"
|
|
29
|
+
_SAMPLE = "sample"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def payload_dir():
|
|
33
|
+
"""包内产品件目录。"""
|
|
34
|
+
return os.path.join(os.path.dirname(os.path.abspath(__file__)), "payload")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def resolve_home(argv):
|
|
38
|
+
"""挑运行目录,并把 `--home` 从参数里摘掉。
|
|
39
|
+
|
|
40
|
+
优先次序:`--home=X` > 环境变量 `DAYBOOK_HOME` > **当前目录**(仅当它已含 `daybook.conf`)
|
|
41
|
+
> `~/.daybook`
|
|
42
|
+
"""
|
|
43
|
+
rest = []
|
|
44
|
+
home = None
|
|
45
|
+
i = 0
|
|
46
|
+
while i < len(argv):
|
|
47
|
+
a = argv[i]
|
|
48
|
+
if a == "--home":
|
|
49
|
+
i += 1
|
|
50
|
+
if i < len(argv):
|
|
51
|
+
home = argv[i]
|
|
52
|
+
elif a.startswith("--home="):
|
|
53
|
+
home = a.split("=", 1)[1]
|
|
54
|
+
else:
|
|
55
|
+
rest.append(a)
|
|
56
|
+
i += 1
|
|
57
|
+
if home:
|
|
58
|
+
return os.path.abspath(os.path.expanduser(home)), rest
|
|
59
|
+
env = os.environ.get("DAYBOOK_HOME", "").strip()
|
|
60
|
+
if env:
|
|
61
|
+
return os.path.abspath(os.path.expanduser(env)), rest
|
|
62
|
+
if os.path.isfile(os.path.join(os.getcwd(), _CONF)):
|
|
63
|
+
return os.getcwd(), rest
|
|
64
|
+
return os.path.join(os.path.expanduser("~"), ".daybook"), rest
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _ensure_home(home, payload):
|
|
68
|
+
"""在运行目录就位:conf / sample 仅在缺失时铺;产品 .py 一律用软链指回 payload。"""
|
|
69
|
+
os.makedirs(home, exist_ok=True)
|
|
70
|
+
fresh = not os.path.exists(os.path.join(home, _CONF))
|
|
71
|
+
if fresh:
|
|
72
|
+
shutil.copyfile(os.path.join(payload, _CONF), os.path.join(home, _CONF))
|
|
73
|
+
sample_dst = os.path.join(home, _SAMPLE)
|
|
74
|
+
if fresh and not os.path.exists(sample_dst):
|
|
75
|
+
shutil.copytree(os.path.join(payload, _SAMPLE), sample_dst)
|
|
76
|
+
made = []
|
|
77
|
+
for name in sorted(os.listdir(payload)):
|
|
78
|
+
if not name.endswith(".py"):
|
|
79
|
+
continue
|
|
80
|
+
link = os.path.join(home, name)
|
|
81
|
+
target = os.path.join(payload, name)
|
|
82
|
+
if os.path.islink(link):
|
|
83
|
+
if os.path.realpath(link) != os.path.realpath(target):
|
|
84
|
+
os.remove(link)
|
|
85
|
+
os.symlink(target, link)
|
|
86
|
+
made.append(name)
|
|
87
|
+
continue
|
|
88
|
+
if os.path.exists(link):
|
|
89
|
+
continue # 用户自留的实体文件:不动
|
|
90
|
+
os.symlink(target, link)
|
|
91
|
+
made.append(name)
|
|
92
|
+
return made, fresh
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def main(argv=None):
|
|
96
|
+
argv = list(sys.argv[1:] if argv is None else argv)
|
|
97
|
+
payload = payload_dir()
|
|
98
|
+
home, rest = resolve_home(argv)
|
|
99
|
+
made, fresh = _ensure_home(home, payload)
|
|
100
|
+
runner = os.path.join(home, "daybook.py")
|
|
101
|
+
if not os.path.exists(runner):
|
|
102
|
+
sys.stderr.write("daybook: 运行目录内缺 daybook.py:%s\n" % runner)
|
|
103
|
+
return 2
|
|
104
|
+
sys.path.insert(0, home)
|
|
105
|
+
sys.path.insert(0, payload)
|
|
106
|
+
if made or fresh:
|
|
107
|
+
sys.stderr.write(
|
|
108
|
+
"daybook: 运行目录 = %s%s(%s)\n"
|
|
109
|
+
% (
|
|
110
|
+
home,
|
|
111
|
+
",已初始化" if fresh else "",
|
|
112
|
+
"新建链接 %d 条" % len(made) if made else "无需新建链接",
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
sys.argv = [runner] + rest
|
|
116
|
+
try:
|
|
117
|
+
runpy.run_path(runner, run_name="__main__")
|
|
118
|
+
except SystemExit as exc:
|
|
119
|
+
code = exc.code
|
|
120
|
+
return code if isinstance(code, int) else (0 if code is None else 1)
|
|
121
|
+
return 0
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
if __name__ == "__main__":
|
|
125
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# 贡献者许可协议 · Contributor License Agreement (CLA)
|
|
2
|
+
|
|
3
|
+
> **来源与适配**:本协议**据 Apache 软件基金会《个人贡献者许可协议》v2.2**
|
|
4
|
+
> (Apache Individual Contributor License Agreement,"ICLA";原文 <https://www.apache.org/licenses/icla.pdf>)改写,
|
|
5
|
+
> **仅将接收方由「Apache 软件基金会」改为「daybook-suite 项目」**(由其版权持有人**手艺人老宋**代表),
|
|
6
|
+
> 并删除原文中**不适用于本项目**的「非营利(nonprofit)」表述;**其余条款未改**。
|
|
7
|
+
>
|
|
8
|
+
> **本页英文正文为唯一操作性文本(operative text)**;文末「中文要点」仅供理解,**不构成协议条款**。
|
|
9
|
+
>
|
|
10
|
+
> ⚠️ 本协议由程序员据公开模板改编,**未经律师审阅**;据以签署前,请自行取得法律意见。
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Thank you for your interest in the **daybook-suite** project (the "Project"),
|
|
15
|
+
represented by its copyright holder. To clarify the intellectual property license
|
|
16
|
+
granted with Contributions from any person or entity, the Project must have on file
|
|
17
|
+
a signed Contributor License Agreement ("CLA") from each Contributor, indicating
|
|
18
|
+
agreement with the license terms below. This agreement is for your protection as a
|
|
19
|
+
Contributor as well as the protection of the Project and its users. It does not
|
|
20
|
+
change your rights to use your own Contributions for any other purpose.
|
|
21
|
+
|
|
22
|
+
Please complete and sign this Agreement, and then email a signed copy to the address
|
|
23
|
+
listed in `LICENSING.md` §六(贡献). Read this document carefully before signing and
|
|
24
|
+
keep a copy for your records.
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Full name: _____________________________________________________
|
|
28
|
+
* if you do not enter a public name your full name will be public
|
|
29
|
+
|
|
30
|
+
check this box only if you entered names with your family name first
|
|
31
|
+
|
|
32
|
+
*Public name: ____________________________________________________
|
|
33
|
+
your public name might not include honorific, suffix, or middle name
|
|
34
|
+
|
|
35
|
+
Residence Address: ________________________________________________
|
|
36
|
+
|
|
37
|
+
_________________________________________________
|
|
38
|
+
|
|
39
|
+
Country: _________________________________________________
|
|
40
|
+
|
|
41
|
+
* E-Mail: ______________________________________________________
|
|
42
|
+
|
|
43
|
+
* (optional) preferred id(s): ____________________________________
|
|
44
|
+
|
|
45
|
+
* (optional) notify project: ______________________________________
|
|
46
|
+
|
|
47
|
+
* The starred fields above will become part of your public profile.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
You accept and agree to the following terms and conditions for Your Contributions
|
|
51
|
+
(present and future) that you submit to the Project. In return, the Project shall not
|
|
52
|
+
use Your Contributions in a way that is contrary to the public benefit. Except for the
|
|
53
|
+
license granted herein to the Project and recipients of software distributed by the
|
|
54
|
+
Project, You reserve all right, title, and interest in and to Your Contributions.
|
|
55
|
+
|
|
56
|
+
## 1. Definitions.
|
|
57
|
+
|
|
58
|
+
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the
|
|
59
|
+
copyright owner that is making this Agreement with the Project. For legal entities,
|
|
60
|
+
the entity making a Contribution and all other entities that control, are
|
|
61
|
+
controlled by, or are under common control with that entity are considered to be a
|
|
62
|
+
single Contributor. For the purposes of this definition, "control" means (i) the
|
|
63
|
+
power, direct or indirect, to cause the direction or management of such entity,
|
|
64
|
+
whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more
|
|
65
|
+
of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
66
|
+
|
|
67
|
+
"Contribution" shall mean any original work of authorship, including any
|
|
68
|
+
modifications or additions to an existing work, that is intentionally submitted by
|
|
69
|
+
You to the Project for inclusion in, or documentation of, any of the products
|
|
70
|
+
owned or managed by the Project (the "Work"). For the purposes of this definition,
|
|
71
|
+
"submitted" means any form of electronic, verbal, or written communication sent to
|
|
72
|
+
the Project or its representatives, including but not limited to communication on
|
|
73
|
+
electronic mailing lists, source code control systems, and issue tracking systems
|
|
74
|
+
that are managed by, or on behalf of, the Project for the purpose of discussing and
|
|
75
|
+
improving the Work, but excluding communication that is conspicuously marked or
|
|
76
|
+
otherwise designated in writing by You as "Not a Contribution."
|
|
77
|
+
|
|
78
|
+
## 2. Grant of Copyright License.
|
|
79
|
+
|
|
80
|
+
Subject to the terms and conditions of this Agreement, You hereby grant to the
|
|
81
|
+
Project and to recipients of software distributed by the Project a perpetual,
|
|
82
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
83
|
+
reproduce, prepare derivative works of, publicly display, publicly perform,
|
|
84
|
+
sublicense, and distribute Your Contributions and such derivative works.
|
|
85
|
+
|
|
86
|
+
## 3. Grant of Patent License.
|
|
87
|
+
|
|
88
|
+
Subject to the terms and conditions of this Agreement, You hereby grant to the
|
|
89
|
+
Project and to recipients of software distributed by the Project a perpetual,
|
|
90
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
|
|
91
|
+
this section) patent license to make, have made, use, offer to sell, sell, import,
|
|
92
|
+
and otherwise transfer the Work, where such license applies only to those patent
|
|
93
|
+
claims licensable by You that are necessarily infringed by Your Contribution(s)
|
|
94
|
+
alone or by combination of Your Contribution(s) with the Work to which such
|
|
95
|
+
Contribution(s) was submitted. If any entity institutes patent litigation against
|
|
96
|
+
You or any other entity (including a cross-claim or counterclaim in a lawsuit)
|
|
97
|
+
alleging that your Contribution, or the Work to which you have contributed,
|
|
98
|
+
constitutes direct or contributory patent infringement, then any patent licenses
|
|
99
|
+
granted to that entity under this Agreement for that Contribution or Work shall
|
|
100
|
+
terminate as of the date such litigation is filed.
|
|
101
|
+
|
|
102
|
+
## 4.
|
|
103
|
+
|
|
104
|
+
You represent that you are legally entitled to grant the above license. If your
|
|
105
|
+
employer(s) has rights to intellectual property that you create that includes your
|
|
106
|
+
Contributions, you represent that you have received permission to make
|
|
107
|
+
Contributions on behalf of that employer, that your employer has waived such rights
|
|
108
|
+
for your Contributions to the Project, or that your employer has executed a
|
|
109
|
+
separate Corporate CLA with the Project.
|
|
110
|
+
|
|
111
|
+
## 5.
|
|
112
|
+
|
|
113
|
+
You represent that each of Your Contributions is Your original creation (see
|
|
114
|
+
section 7 for submissions on behalf of others). You represent that Your Contribution
|
|
115
|
+
submissions include complete details of any third-party license or other restriction
|
|
116
|
+
(including, but not limited to, related patents and trademarks) of which you are
|
|
117
|
+
personally aware and which are associated with any part of Your Contributions.
|
|
118
|
+
|
|
119
|
+
## 6.
|
|
120
|
+
|
|
121
|
+
You are not expected to provide support for Your Contributions, except to the extent
|
|
122
|
+
You desire to provide support. You may provide support for free, for a fee, or not
|
|
123
|
+
at all. Unless required by applicable law or agreed to in writing, You provide Your
|
|
124
|
+
Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
125
|
+
either express or implied, including, without limitation, any warranties or
|
|
126
|
+
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
|
|
127
|
+
PURPOSE.
|
|
128
|
+
|
|
129
|
+
## 7.
|
|
130
|
+
|
|
131
|
+
Should You wish to submit work that is not Your original creation, You may submit it
|
|
132
|
+
to the Project separately from any Contribution, identifying the complete details of
|
|
133
|
+
its source and of any license or other restriction (including, but not limited to,
|
|
134
|
+
related patents, trademarks, and license agreements) of which you are personally
|
|
135
|
+
aware, and conspicuously marking the work as "Submitted on behalf of a third-party:
|
|
136
|
+
[named here]".
|
|
137
|
+
|
|
138
|
+
## 8.
|
|
139
|
+
|
|
140
|
+
You agree to notify the Project of any facts or circumstances of which you become
|
|
141
|
+
aware that would make these representations inaccurate in any respect.
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Please sign: __________________________________ Date: ________________
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
This is a legal contract containing Personally Identifiable Information. The Project
|
|
148
|
+
will use the information you provide only to administer this Agreement and to keep a
|
|
149
|
+
record of the rights granted; it will not be shared beyond that purpose.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 中文要点(**非协议条款** · 仅供理解;与英文正文有歧义时,**以英文为准**)
|
|
154
|
+
|
|
155
|
+
- **版权不转让**:您对自己贡献的著作权**仍归您**;本协议只**授予许可**,不改您对自有作品的任何其他权利。
|
|
156
|
+
- **§2 版权许可(关键)**:授予本项目**永久的、全球的、非独占的、免费、不可撤销**的版权许可,且**含「再授权(sublicense)」权**。
|
|
157
|
+
**⇒ 这正是本仓得以做「AGPL-3.0-or-later + 商业许可」双许可的法理支点**:没有它,日后无权重授商业许可。
|
|
158
|
+
- **§3 专利许可**:同时授予与您贡献相关的专利许可;若有人(含反诉)就相关贡献发起专利诉讼,该专利许可即终止。
|
|
159
|
+
- **§4–§5 声明与保证**:保证贡献系**自创**、且**有权授予**;若雇主对您产出有权利,须已获许可、已弃权或另签《实体 CLA》。
|
|
160
|
+
- **§6 无担保**:贡献按**「现状(AS IS)」**提供,不附任何明示/默示担保。
|
|
161
|
+
- **§7 非自创作品**:若提交**非**自创作品,须**单独**提交、注明来源与相关许可,并显著标注。
|
|
162
|
+
- **§8**:如知悉使上述声明失实之事实,须**及时通知**本项目。
|
|
163
|
+
- **签署**:填上表、手签,回邮至 `LICENSING.md` §六 所列邮箱。
|
|
164
|
+
|
|
165
|
+
> **为何必须有 CLA**:本仓为「**AGPL-3.0-or-later,或另购商业许可**」双许可。
|
|
166
|
+
> **一旦合入一份未签协议的贡献,整仓即变为「人人共有」**——此后签发商业许可须**逐一找回**每位贡献者,实际等于**商业路作废**,且**不可逆**。
|
|
167
|
+
> 故本协议**不是手续,是商业路的存续前提**。
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 手艺人老宋 <songliansheng@vip.sina.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
DAYBOOK · 白箱记忆体范式
|
|
26
|
+
- 纯文本,人机可查
|
|
27
|
+
- 白箱,黑箱对照
|
|
28
|
+
- 条目体系清楚易管理
|
|
29
|
+
- 单机查询快
|
|
30
|
+
- 绝对本地
|
|
31
|
+
- 超大容量而文件小
|
|
32
|
+
- 不用维护
|
|
33
|
+
- 跨平台,跨 AI
|
|
34
|
+
- 跨年代
|
|
35
|
+
- 跨计算机年代
|
|
36
|
+
- 移动端可读
|
|
37
|
+
- 记忆不依赖引擎存活
|
|
38
|
+
- 海量可通读
|
|
39
|
+
- 明档可见
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# LICENSING · daybook 三件之授权分层
|
|
2
|
+
|
|
3
|
+
本仓(及 daybook-suite 三包)**不采用单一许可**——按**件**分层,理由见下。
|
|
4
|
+
|
|
5
|
+
## 一、分层
|
|
6
|
+
|
|
7
|
+
| 层 | 件 | 许可 |
|
|
8
|
+
| -------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
9
|
+
| 基座(账) | daybook.py・daybook_append.py・safeio.py・daybook_record.py・daybook_session_hook.py・daybook_hook.py・daybook.{sh,c,bas,f,conf}・sentinel*.sh | **MIT** |
|
|
10
|
+
| 共享原语层 | agent_registry.py・cross_ref.py | **MIT** |
|
|
11
|
+
| 璇玑(MCP) | mcp\_{server,tools,resources,prompts,subscribe,transport}.py | **MIT** |
|
|
12
|
+
| 司南(ORCH) | orchestrator.py・agent_lock.py・agent_heartbeat.py・agent_message.py・task_volume.py・orchestration\_{routing,roles}.conf | **AGPL-3.0-or-later**,或**另购商业许可** |
|
|
13
|
+
|
|
14
|
+
⇒ **起居注(账)与璇玑(MCP)= 全开源(MIT)**;**司南(ORCH)= 双许可**。
|
|
15
|
+
|
|
16
|
+
## 二、为什么按「件」不按「包」
|
|
17
|
+
|
|
18
|
+
三包是**同一批件的不同装配**:`safeio.py`/`daybook_append.py` 三包皆有,
|
|
19
|
+
`agent_registry.py`/`cross_ref.py` 两卫星皆有。**同一件不能挂两种许可**——
|
|
20
|
+
故若按包切,共享件会把 AGPL 漏进璇玑包,把「全开源」染掉。
|
|
21
|
+
|
|
22
|
+
## 三、司南之双许可(AGPL 或 商业)
|
|
23
|
+
|
|
24
|
+
- **社区路**:按 **AGPL-3.0-or-later** 使用——**含商用**:企业内部自用(含内部网络供员工用)**免费且合法**;**网络条款**:若把司南作为网络服务**对外**提供,须向用户提供对应源码。
|
|
25
|
+
- **商业路**:**不愿履行 AGPL 义务者**,可购买**商业许可**(免除 copyleft 义务)。联系:手艺人老宋 <songliansheng@vip.sina.com>。
|
|
26
|
+
- **一句话**:**想闭源嵌入 / 想对外 SaaS 而不开源 / 要官方支持 ⇒ 买商业许可。**
|
|
27
|
+
★**不是**「商用就必买」——**内部商用自用本就免费**。
|
|
28
|
+
|
|
29
|
+
## 四、账之形 与 器之码:分层
|
|
30
|
+
|
|
31
|
+
- **账之形**(卷之格式·见 `volume_format_spec.md`):**授权宽**——任何人可读、可写、可在其上建任何东西;只不许改形。
|
|
32
|
+
- **器之码**(本仓代码):**按上表分层**。
|
|
33
|
+
- ⇒ 二者层次不同,**勿混**:「账可自由用」不等于「代码可自由用」。
|
|
34
|
+
|
|
35
|
+
## 五、商标
|
|
36
|
+
|
|
37
|
+
「daybook」「起居注」「璇玑」「司南」为**署名标识**;码可开源,**名不可乱用**——
|
|
38
|
+
不得以之名作「官方/兼容」背书。商标注册进行中。
|
|
39
|
+
|
|
40
|
+
## 六、贡献
|
|
41
|
+
|
|
42
|
+
外部贡献须先签 **CLA**(否则我方无权对含他人版权之代码再授商业许可)。
|
|
43
|
+
文本见 **`CLA.md`**(据 Apache ICLA v2.2 改写·接收方改本项目·含「再授权」条款)。
|
|
44
|
+
签署后**回邮**至 **<songliansheng@vip.sina.com>**(邮件主题请注明 `CLA`)。
|
|
45
|
+
|
|
46
|
+
## 七、价格与下载(**便利费·非许可费**)
|
|
47
|
+
|
|
48
|
+
- **$10.99 下载** = 买**整装包**的便利(一键装/签名更新/构建托管)。**源码永远公开·可免费自取**——任何人可自建。
|
|
49
|
+
- 三件套**可自由使用与修改,含商用内部使用**(遵 MIT/AGPL)。
|
|
50
|
+
- **$10.99 ≠ 商业许可价**:前者是 C 端便利费,后者是 B2B 合同。
|
|
51
|
+
- 此举**可自称开源**;若改成「商用一律收费」,则须弃 AGPL、改源开放——**不可再称开源**。
|
|
52
|
+
|
|
53
|
+
## 八、主权保留(**我们永不让渡的一格**)
|
|
54
|
+
|
|
55
|
+
**码可开源,名不可开源。** 本仓保留**唯一一项主权**——即「**名**」:
|
|
56
|
+
|
|
57
|
+
1. **名(商标)**:「daybook」「起居注」「璇玑」「司南」为署名标识。任何人可自由使用本仓代码,**但不得以之名作「官方/兼容/认证」之背书**;未获书面许可,不得用于衍生产品之命名、分发与推广。
|
|
58
|
+
2. **认证(谁算官方)**:「官方 daybook/官方兼容」之**认定权,唯我方行使**。第三方分叉须**另立其名**。
|
|
59
|
+
3. **双许可之发行权**:商业许可(AGPL 豁免)**唯版权持有人可签发**——故须 CLA(见 §六)。
|
|
60
|
+
|
|
61
|
+
> **一句**:**别人可以拿走我们的「码」,拿不走我们的「名」。**
|
|
62
|
+
> **可行使性**:商标可诉/CLA 可签/认证可拒发——**皆落在可执行处**,不是空话。
|
|
63
|
+
|
|
64
|
+
⚠️ **两条纪律**:
|
|
65
|
+
|
|
66
|
+
- **不写「最终解释权归本司」**——该语在中国法下(《合同违法行为监督处理办法》第十一条)于格式条款中**一般认定无效**,是**假主权**。要的是可行使的**真主权**。
|
|
67
|
+
- **认证不越界**:认证只管「谁可称官方」,**不管别人自造之账合不合规**——后者归《账形定义》,**开放**。
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
版权:Copyright (c) 2026 手艺人老宋 <songliansheng@vip.sina.com> | 许可文本全文见各包 `LICENSE`
|