dsh-feiyu-life 0.2.2 → 0.3.0
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.
- package/CHANGELOG.md +11 -0
- package/README.md +21 -0
- package/index.js +134 -4
- package/life.js +64 -31
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# 更新记录
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
照 `dsh-daily-schedule` 的思路,把「她有自己的日子」做成本地版:
|
|
6
|
+
|
|
7
|
+
- **每日剧本**:一天写一次,用 DSH 自己的模型按人设/课表/最近三天生成全天 00:00–24:00 的安排(在哪、做什么、穿什么、手机在不在手上);不合格或模型挂了自动退模板,保证一定有。
|
|
8
|
+
- **日子类型**:上课日 / 没课日 / 周末宅家 / 周末出门 / 假期 / 考试周,按校历和课表判。
|
|
9
|
+
- **注入升级**:今天是什么日子、此刻在做什么(带穿着)、早些时候、接下来、傍晚附明天,最后一段「说话方式」要求别念时间表。
|
|
10
|
+
- **`life_adjust` 工具**:她可以临时改今天的安排(赖床、出门、被叫走),改完下一轮注入就变。
|
|
11
|
+
- **落盘**:剧本存 `~/.dsh/feiyu-life-days/<date>.json`,同一天不变;模板不再抢在模型前面占位。
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
## 0.2.2
|
|
4
15
|
|
|
5
16
|
- 新增「工作区过滤」:配置 `工作区` 是目录数组(前缀匹配),留空 = 所有顶层会话。
|
package/README.md
CHANGED
|
@@ -45,6 +45,27 @@
|
|
|
45
45
|
所以同一分钟问两次答案一样,过了这一小时再问就不一样了 —— 跟你问真人"在干嘛"是一个道理。
|
|
46
46
|
三类偏离的概率都在设置页里,调成 0 就永远按表走。
|
|
47
47
|
|
|
48
|
+
## 每日剧本(0.3 起)
|
|
49
|
+
|
|
50
|
+
光有课表和作息,日子永远是同一个样子。所以现在**每天用模型写一份剧本**:
|
|
51
|
+
|
|
52
|
+
- 一天只调一次模型(当天第一次要用时写今天,傍晚写明天),写完全天 00:00–24:00 的分段:
|
|
53
|
+
在哪、做什么、穿什么、手机在不在手上;
|
|
54
|
+
- 按「日子类型」写(上课日 / 没课日 / 周末宅家 / 周末出门 / 假期 / 考试周),还会参考最近三天,避免天天一样;
|
|
55
|
+
- 模型挂了、返回不合法、超时 → **自动退回模板**,保证不会开天窗;
|
|
56
|
+
- 剧本落盘在 `~/.dsh/feiyu-life-days/<date>.json`,同一天不变,重启也不丢;
|
|
57
|
+
- 她可以用 `life_adjust` 临时改计划(赖床、出门、被叫走),改完下一轮注入跟着变。
|
|
58
|
+
|
|
59
|
+
注入长这样:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
(今天)11月9日 周一·上课日。肚子还坠着。
|
|
63
|
+
(此刻)老师当众点评我作业,脸有点烧,手机静音,身上是藏青卫衣。
|
|
64
|
+
(早些时候)回宿舍躺着,抱热水袋刷手机,然后专业课排版式,一个标题改到第三遍。
|
|
65
|
+
(接下来)17:30 取快递是买的画册,顺路吃了碗热面。
|
|
66
|
+
(说话)这些是你自己的日子,别当时间表念:不说"按日程/计划/安排",不报时间段、不列清单。
|
|
67
|
+
```
|
|
68
|
+
|
|
48
69
|
## 它不做什么
|
|
49
70
|
|
|
50
71
|
- **不调模型**:纯本地计算,一分钱不花。
|
package/index.js
CHANGED
|
@@ -12,13 +12,52 @@
|
|
|
12
12
|
// POST /dsh-feiyu-life/save 存配置(整份替换)
|
|
13
13
|
// GET /dsh-feiyu-life/preview 指定时间预览(?ts=毫秒时间戳)
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
16
|
+
import { 读配置, 存配置, 生成, CONFIG_PATH, 时区现在, 今日日历 } from './life.js'
|
|
17
|
+
import { 日程类型, 每日剧本, 剧本路径, 写剧本, 改剧本 } from './plan.js'
|
|
18
|
+
import { 用模型写一天 } from './gen.js'
|
|
16
19
|
|
|
17
20
|
export const name = 'feiyu-life'
|
|
18
|
-
export const inject = ['systemPrompt', 'agents', 'timer', 'webServer']
|
|
21
|
+
export const inject = ['systemPrompt', 'agents', 'timer', 'webServer', 'llm', 'tools']
|
|
19
22
|
|
|
20
23
|
const 路由前缀 = '/dsh-feiyu-life'
|
|
21
24
|
|
|
25
|
+
/** 经期第几天(0 = 不在) */
|
|
26
|
+
function 经期天(cfg, ymd) {
|
|
27
|
+
const q = cfg.经期 || {}
|
|
28
|
+
const 起 = /^\d{4}-\d{2}-\d{2}$/.test(String(q.起始 || '')) ? Date.parse(String(q.起始) + 'T00:00:00Z') : NaN
|
|
29
|
+
if (!Number.isFinite(起)) return 0
|
|
30
|
+
const 今 = Date.parse(ymd + 'T00:00:00Z')
|
|
31
|
+
if (!Number.isFinite(今)) return 0
|
|
32
|
+
const 天 = Math.floor((今 - 起) / 86400000)
|
|
33
|
+
const 周 = Math.max(1, Math.round(Number(q.周期) || 29))
|
|
34
|
+
const 长 = Math.max(1, Math.round(Number(q.天数) || 5))
|
|
35
|
+
return ((天 % 周) + 周) % 周 < 长 ? ((天 % 周) + 周) % 周 + 1 : 0
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** 写剧本时告诉模型的「身体/状态」 */
|
|
39
|
+
function 身体提示(cfg, t) {
|
|
40
|
+
const 经 = 经期天(cfg, t.ymd)
|
|
41
|
+
if (经 && 经 <= 3) return '经期头几天,腰酸、想吃甜的、没力气'
|
|
42
|
+
if (经) return '经期后段,肚子还坠着'
|
|
43
|
+
return ''
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** 最近三天剧本摘要,避免天天一样 */
|
|
47
|
+
function 最近摘要(cfg, t) {
|
|
48
|
+
const 行 = []
|
|
49
|
+
for (let i = 1; i <= 3; i++) {
|
|
50
|
+
const d = new Date(Date.parse(t.ymd + 'T00:00:00Z') - i * 86400000).toISOString().slice(0, 10)
|
|
51
|
+
try {
|
|
52
|
+
const j = JSON.parse(readFileSync(剧本路径(d), 'utf8'))
|
|
53
|
+
const 标题 = j.title || (j.type && j.type.名) || ''
|
|
54
|
+
const 段 = (j.items || []).slice(0, 3).map((x) => x.在).join('、')
|
|
55
|
+
行.push(`- ${d}:${标题}${段 ? '(' + 段 + '…)' : ''}`)
|
|
56
|
+
} catch { /* 没有就算了 */ }
|
|
57
|
+
}
|
|
58
|
+
return 行.join('\n')
|
|
59
|
+
}
|
|
60
|
+
|
|
22
61
|
export function apply(ctx) {
|
|
23
62
|
const mounted = new Map()
|
|
24
63
|
|
|
@@ -40,9 +79,15 @@ export function apply(ctx) {
|
|
|
40
79
|
})
|
|
41
80
|
}
|
|
42
81
|
|
|
82
|
+
const 钟点 = (分) => {
|
|
83
|
+
const v = ((Math.round(分) % 1440) + 1440) % 1440
|
|
84
|
+
return `${String(Math.floor(v / 60)).padStart(2, '0')}:${String(v % 60).padStart(2, '0')}`
|
|
85
|
+
}
|
|
86
|
+
|
|
43
87
|
const 挂 = (agent) => {
|
|
44
88
|
const cwd = String((agent && agent.session && agent.session.cwd) || '')
|
|
45
|
-
|
|
89
|
+
const 卸 = []
|
|
90
|
+
卸.push(agent.ctx.systemPrompt.context({
|
|
46
91
|
name: 'feiyu-life',
|
|
47
92
|
order: 880,
|
|
48
93
|
text: () => {
|
|
@@ -52,7 +97,90 @@ export function apply(ctx) {
|
|
|
52
97
|
return 生成(cfg).text
|
|
53
98
|
} catch (e) { return '' }
|
|
54
99
|
},
|
|
55
|
-
})
|
|
100
|
+
}))
|
|
101
|
+
// 她可以临时改主意:改今天的安排(改完下一轮注入就变)
|
|
102
|
+
try {
|
|
103
|
+
const off = agent.ctx.tools.register({
|
|
104
|
+
name: 'life_adjust',
|
|
105
|
+
description: '临时改今天的安排(赖床、出门、被叫走、加班)。只在你真的改主意时用;回复里别提到这个工具。',
|
|
106
|
+
parameters: {
|
|
107
|
+
type: 'object',
|
|
108
|
+
properties: {
|
|
109
|
+
在: { type: 'string', description: '改成在做什么(短句,例如:在便利店买布丁)' },
|
|
110
|
+
从: { type: 'string', description: '从几点开始(HH:MM,不填=现在)' },
|
|
111
|
+
时长分钟: { type: 'number', description: '持续多少分钟,默认 90' },
|
|
112
|
+
},
|
|
113
|
+
required: ['在'],
|
|
114
|
+
additionalProperties: false,
|
|
115
|
+
},
|
|
116
|
+
output: {
|
|
117
|
+
schema: { type: 'object', properties: { ok: { type: 'boolean' }, 说: { type: 'string' } }, additionalProperties: true },
|
|
118
|
+
render: (_a, v) => [{ type: 'text', text: String((v && v.说) || '') }],
|
|
119
|
+
},
|
|
120
|
+
async execute(参数 = {}) {
|
|
121
|
+
try {
|
|
122
|
+
const cfg = 读配置()
|
|
123
|
+
const t = 时区现在(new Date(), String(cfg.时区 || 'Asia/Shanghai'))
|
|
124
|
+
const 在 = String(参数.在 || '').trim().slice(0, 24)
|
|
125
|
+
if (!在) return { ok: false, 说: '没说要改成什么' }
|
|
126
|
+
let 起 = t.分
|
|
127
|
+
const m = /^(\d{1,2}):(\d{2})$/.exec(String(参数.从 || '').trim())
|
|
128
|
+
if (m) 起 = Number(m[1]) * 60 + Number(m[2])
|
|
129
|
+
const 时长 = Math.max(15, Math.min(360, Number(参数.时长分钟) || 90))
|
|
130
|
+
const d = 改剧本(t.ymd, 起, { 起, 止: Math.min(1440, 起 + 时长), 在, 手机: '在手', 穿: '' })
|
|
131
|
+
return d ? { ok: true, 说: `记下了:${钟点(起)} 起,${在}` } : { ok: false, 说: '今天还没有剧本,改不了' }
|
|
132
|
+
} catch (e) { return { ok: false, 说: '改失败:' + String((e && e.message) || e) } }
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
if (typeof off === 'function') 卸.push(off)
|
|
136
|
+
} catch (e) { /* 工具注册失败不影响注入 */ }
|
|
137
|
+
return () => { for (const f of 卸) { try { f() } catch {} } }
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// ── 每日剧本:一天写一次(模型写,失败退模板)──
|
|
141
|
+
const 在写 = new Set()
|
|
142
|
+
const 查模型用的会话 = () => {
|
|
143
|
+
try {
|
|
144
|
+
const roots = (typeof ctx.agents.roots === 'function' ? ctx.agents.roots() : ctx.agents.list()) || []
|
|
145
|
+
return roots[0]
|
|
146
|
+
} catch { return undefined }
|
|
147
|
+
}
|
|
148
|
+
const 确保剧本 = async (now) => {
|
|
149
|
+
const cfg = 读配置()
|
|
150
|
+
const tz = String(cfg.时区 || 'Asia/Shanghai')
|
|
151
|
+
for (const 偏移 of [0, 1]) {
|
|
152
|
+
const when = 偏移 === 0 ? now : new Date(now.getTime() + 86400000)
|
|
153
|
+
const t = 时区现在(when, tz)
|
|
154
|
+
if (existsSync(剧本路径(t.ymd))) continue
|
|
155
|
+
if (在写.has(t.ymd)) continue
|
|
156
|
+
在写.add(t.ymd)
|
|
157
|
+
;(async () => {
|
|
158
|
+
try {
|
|
159
|
+
const 日历 = 今日日历(cfg, t)
|
|
160
|
+
const 类型 = 日程类型(cfg, t, 日历)
|
|
161
|
+
const agent = 查模型用的会话()
|
|
162
|
+
let r = null
|
|
163
|
+
if (agent) {
|
|
164
|
+
r = await 用模型写一天(ctx, agent, {
|
|
165
|
+
cfg, date: t.ymd, 周: t.周, 类型, 日历,
|
|
166
|
+
课表: ((cfg.课表 || {})[t.周] || []).map((x) => [x[0], x[1], x[2]]),
|
|
167
|
+
身体: 身体提示(cfg, t),
|
|
168
|
+
最近: 最近摘要(cfg, t),
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
if (r) {
|
|
172
|
+
写剧本(t.ymd, { type: 类型, title: r.title, mood: r.mood, items: r.items, source: 'llm', model: r.model })
|
|
173
|
+
try { console.log('[feiyu-life] 剧本已生成(模型):' + t.ymd) } catch {}
|
|
174
|
+
} else {
|
|
175
|
+
const 兜底 = 每日剧本(cfg, t, 日历, {}, 类型)
|
|
176
|
+
写剧本(t.ymd, { type: 类型, title: 兜底.title || '', mood: '', items: 兜底.items, source: 'template' })
|
|
177
|
+
try { console.log('[feiyu-life] 剧本用模板兜底:' + t.ymd) } catch {}
|
|
178
|
+
}
|
|
179
|
+
} catch (e) {
|
|
180
|
+
try { console.log('[feiyu-life] 写剧本失败:' + String((e && e.message) || e)) } catch {}
|
|
181
|
+
} finally { 在写.delete(t.ymd) }
|
|
182
|
+
})()
|
|
183
|
+
}
|
|
56
184
|
}
|
|
57
185
|
|
|
58
186
|
const tick = () => {
|
|
@@ -77,6 +205,8 @@ export function apply(ctx) {
|
|
|
77
205
|
})
|
|
78
206
|
|
|
79
207
|
tick()
|
|
208
|
+
try { setTimeout(() => { 确保剧本(new Date()).catch(() => {}) }, 8000) } catch {}
|
|
209
|
+
try { ctx.effect(() => ctx.interval(() => { 确保剧本(new Date()).catch(() => {}) }, 20 * 60 * 1000)) } catch {}
|
|
80
210
|
|
|
81
211
|
// ── 设置页的三条接口 ────────────────────────────────────────────────
|
|
82
212
|
const 只认本人 = (handler) => async (req, res) => {
|
package/life.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// 层级优先级(高 → 低):特殊(考试周)→ 假期 → 学期;作息表:特殊 > 假期 > 晚起日 > 日常。
|
|
21
21
|
|
|
22
22
|
import { readFileSync, writeFileSync, mkdirSync, statSync, renameSync } from 'node:fs'
|
|
23
|
+
import { 日程类型, 每日剧本, 找此刻 } from './plan.js'
|
|
23
24
|
import { join, dirname } from 'node:path'
|
|
24
25
|
import { homedir } from 'node:os'
|
|
25
26
|
|
|
@@ -346,58 +347,90 @@ function 今日底色(经, 生病, 困, 好事) {
|
|
|
346
347
|
export function 生成(cfg, now = new Date()) {
|
|
347
348
|
const 空 = { text: '', 依据: [] }
|
|
348
349
|
if (!cfg || cfg.总开关 === false) return 空
|
|
349
|
-
const
|
|
350
|
+
const tz = String(cfg.时区 || 'Asia/Shanghai')
|
|
351
|
+
const t = 时区现在(now, tz)
|
|
350
352
|
const 日历 = 今日日历(cfg, t)
|
|
351
353
|
const 偏离 = 今日偏离(cfg, t, 日历.作息表)
|
|
352
|
-
const
|
|
354
|
+
const 类型 = 日程类型(cfg, t, 日历)
|
|
355
|
+
const 剧本 = 每日剧本(cfg, t, 日历, 偏离, 类型)
|
|
356
|
+
const 在 = 找此刻(剧本.items, t.分) || { 在: '闲着', 手机: '在手', 穿: '' }
|
|
353
357
|
|
|
354
358
|
const 依据 = []
|
|
355
359
|
依据.push(日历.特殊 ? `${日历.特殊.名}第 ${日历.第几天} 天`
|
|
356
360
|
: 日历.假期 ? `${日历.假期.名}第 ${日历.第几天} 天`
|
|
357
|
-
: (日历.节日 && 日历.节日.起) ? `${日历.节日.名}
|
|
361
|
+
: (日历.节日 && 日历.节日.起) ? `${日历.节日.名}放假`
|
|
358
362
|
: 日历.学期 ? `学期中(${日历.学期.名})`
|
|
359
363
|
: '不在校历里,按平常走')
|
|
360
|
-
依据.push(
|
|
361
|
-
依据.push(`此刻命中:${在.在}(手机${在.手机})`)
|
|
364
|
+
依据.push(`日子类型:${类型.名}|作息表:${日历.作息表}`)
|
|
365
|
+
依据.push(`此刻命中:${在.在}(手机${在.手机 || '在手'}${在.穿 ? ',穿' + 在.穿 : ''})`)
|
|
362
366
|
if (偏离.躺平) 依据.push('今天没按表走:躺平')
|
|
363
|
-
if (偏离.出门) 依据.push('今天没按表走:出门')
|
|
364
367
|
if (偏离.翘下午) 依据.push('今天没按表走:翘了下午的课')
|
|
365
368
|
|
|
366
|
-
|
|
367
|
-
if (!/睡/.test(在.在) && !偏离.躺平) 此刻行 += 小时变体(t, 在.在) + 临时动作(t)
|
|
368
|
-
此刻行 += '。'
|
|
369
|
-
|
|
369
|
+
// ── 今天这一行:日子类型 + 身上的状况 ──
|
|
370
370
|
const r = 摇(种子(t.ymd, 'sleep'))
|
|
371
371
|
const 睡点 = [60, 120, 150][Math.floor(r() * 3) % 3]
|
|
372
372
|
const 起 = 起床点(cfg, t, 日历)
|
|
373
373
|
const 困 = 起 - 睡点 < 360
|
|
374
374
|
const 经 = 经期第几天(cfg, t.ymd)
|
|
375
|
-
|
|
376
|
-
const 今天 = []
|
|
377
|
-
if (日历.节日 && !/睡/.test(在.在)) {
|
|
378
|
-
今天.push(日历.节日.起 ? `${日历.节日.名},放假` : `${日历.节日.名}`)
|
|
379
|
-
}
|
|
380
|
-
if (日历.假期 && 日历.第几天 >= 2 && 日历.第几天 <= 30) 今天.push(`${日历.假期.名}第${日历.第几天}天`)
|
|
381
|
-
if (日历.特殊 && 日历.第几天 === 1) 今天.push(`${日历.特殊.名}开始了`)
|
|
382
|
-
if (困 && t.分 < 15 * 60) {
|
|
383
|
-
const 说法 = 睡点 === 60 ? '一点' : 睡点 === 120 ? '两点' : '两点半'
|
|
384
|
-
今天.push(`昨晚${说法}才睡,有点懵`)
|
|
385
|
-
}
|
|
386
|
-
if (经) 今天.push(经 <= 3 ? '腰有点酸,想吃甜的' : '肚子还坠着')
|
|
387
375
|
const 着凉 = r() < 0.08 && [3, 4, 10, 11].includes(t.月)
|
|
388
|
-
if (着凉) 今天.push('嗓子有点紧,可能着凉了')
|
|
389
|
-
if (偏离.出门) 今天.push('出门了,带着相机')
|
|
390
376
|
const 小事们 = 今天的小事(cfg, t, !日历.放假)
|
|
391
|
-
|
|
377
|
+
|
|
378
|
+
const 状况 = []
|
|
379
|
+
if (困 && t.分 < 15 * 60) 状况.push(`昨晚${睡点 === 60 ? '一点' : 睡点 === 120 ? '两点' : '两点半'}才睡`)
|
|
380
|
+
if (经) 状况.push(经 <= 3 ? '腰有点酸' : '肚子还坠着')
|
|
381
|
+
if (着凉) 状况.push('嗓子有点紧')
|
|
382
|
+
for (const 文 of 小事们) 状况.push(文)
|
|
392
383
|
const 好事 = 小事们.some((x) => /夸|猫|寄的/.test(x))
|
|
393
384
|
const 底色 = 今日底色(经, 着凉, 困, 好事)
|
|
394
|
-
if (底色)
|
|
385
|
+
if (底色) 状况.push(底色)
|
|
386
|
+
|
|
387
|
+
const 行们 = []
|
|
388
|
+
行们.push(`(今天)${t.月}月${t.日}日 ${周名(t.周)}·${类型.名}${状况.length ? '。' + 状况.slice(0, 2).join(';') : '。'}。`)
|
|
389
|
+
|
|
390
|
+
// ── 此刻 ──
|
|
391
|
+
let 此刻行 = `(此刻)${在.在}`
|
|
392
|
+
if (在.手机 && 在.手机 !== '在手') 此刻行 += 手机说[在.手机] || ''
|
|
393
|
+
if (在.穿 && !/睡/.test(在.在)) 此刻行 += `,身上是${在.穿}`
|
|
394
|
+
if (!/睡/.test(在.在) && !偏离.躺平) 此刻行 += 小时变体(t, 在.在) + 临时动作(t)
|
|
395
|
+
行们.push(此刻行 + '。')
|
|
396
|
+
|
|
397
|
+
// ── 早些时候 / 接下来 ──
|
|
398
|
+
const 早 = 剧本.items.filter((x) => x.止 <= t.分 && x.止 > t.分 - 360 && !/睡/.test(x.在)).slice(-2)
|
|
399
|
+
if (早.length) 行们.push(`(早些时候)${早.map((x) => x.在).join(',然后')}。`)
|
|
400
|
+
const 后 = 剧本.items.filter((x) => x.起 > t.分 && !/睡/.test(x.在)).slice(0, 1)
|
|
401
|
+
if (后.length) 行们.push(`(接下来)${分钟说(后[0].起)} ${后[0].在}。`)
|
|
402
|
+
|
|
403
|
+
// ── 傍晚以后附上明天 ──
|
|
404
|
+
if (t.hh >= 18) {
|
|
405
|
+
const 明 = 时区现在(new Date(now.getTime() + 86400000), tz)
|
|
406
|
+
const 明日历 = 今日日历(cfg, 明)
|
|
407
|
+
const 明类型 = 日程类型(cfg, 明, 明日历)
|
|
408
|
+
const 明剧本 = 每日剧本(cfg, 明, 明日历, {}, 明类型)
|
|
409
|
+
const 第一醒 = 明剧本.items.find((x) => x.起 >= 6 * 60 && !/睡/.test(x.在))
|
|
410
|
+
行们.push(`(明天)${周名(明.周)}·${明类型.名}${第一醒 ? `,${分钟说(第一醒.起)} ${第一醒.在}` : ''}。`)
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// ── 怎么把这段带进聊天(借 daily-schedule 的思路)──
|
|
414
|
+
行们.push('(说话)这些是你自己的日子,别当时间表念:不说"按日程/计划/安排",不报时间段、不列清单;他问起就像闲聊挑一两件说,带点感受。')
|
|
415
|
+
return {
|
|
416
|
+
text: 行们.join('\n'),
|
|
417
|
+
依据,
|
|
418
|
+
此刻: 在,
|
|
419
|
+
日历,
|
|
420
|
+
偏离,
|
|
421
|
+
类型,
|
|
422
|
+
今天: 状况,
|
|
423
|
+
剧本,
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function 周名(n) {
|
|
428
|
+
return ['', '周一', '周二', '周三', '周四', '周五', '周六', '周日'][n] || ''
|
|
429
|
+
}
|
|
395
430
|
|
|
396
|
-
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
while (拼().length > 150 && 排.length > 2) 排.pop()
|
|
400
|
-
return { text: 拼(), 依据, 此刻: 在, 日历, 偏离, 今天: 排 }
|
|
431
|
+
function 分钟说(分) {
|
|
432
|
+
const m = ((Math.round(分) % 1440) + 1440) % 1440
|
|
433
|
+
return `${String(Math.floor(m / 60)).padStart(2, '0')}:${String(m % 60).padStart(2, '0')}`
|
|
401
434
|
}
|
|
402
435
|
|
|
403
436
|
let 缓存 = { at: 0, cfg: null }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-feiyu-life",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "大肥鱼的生活线(DSH 插件):每天用模型写一份全天剧本(在哪、做什么、穿什么),注入此刻/早些时候/接下来,带设置页。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Vansnc",
|
|
@@ -15,12 +15,11 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"dsh",
|
|
18
|
+
"dsh-plugin",
|
|
18
19
|
"deepseek-harness",
|
|
19
|
-
"plugin",
|
|
20
|
-
"agent",
|
|
21
20
|
"companion",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
21
|
+
"life",
|
|
22
|
+
"persona"
|
|
24
23
|
],
|
|
25
24
|
"engines": {
|
|
26
25
|
"node": ">=22"
|