dislop 0.9.1 → 1.0.1
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/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +7 -8
- package/.cursor-plugin/plugin.json +2 -3
- package/.pre-commit-hooks.yaml +5 -12
- package/PRODUCT.md +19 -63
- package/README.md +360 -252
- package/README.zh-CN.md +390 -240
- package/action.yml +30 -39
- package/bin/dislop-mcp.mjs +3 -4
- package/bin/dislop.mjs +4 -4594
- package/gemini-extension.json +2 -2
- package/llms-install.md +68 -0
- package/package.json +17 -63
- package/packs/common/artifact-qa/pack.json +5 -0
- package/packs/common/artifact-qa/prompts/rules.md +11 -0
- package/packs/common/artifact-qa/scripts/index.mjs +173 -0
- package/packs/common/slide-deck/pack.json +6 -0
- package/packs/common/slide-deck/prompts/rules.md +11 -0
- package/packs/common/slide-deck/scripts/index.mjs +62 -0
- package/packs/common/web-ui/pack.json +6 -0
- package/packs/common/web-ui/prompts/rules.md +11 -0
- package/packs/common/web-ui/scripts/index.mjs +80 -0
- package/packs/en/artifact-qa/pack.json +6 -0
- package/packs/en/artifact-qa/prompts/rules.md +14 -0
- package/packs/en/artifact-qa/scripts/index.mjs +90 -0
- package/packs/en/prose/pack.json +7 -0
- package/packs/en/prose/prompts/rules.md +26 -0
- package/packs/en/prose/scripts/index.mjs +290 -0
- package/packs/en/slide-deck/pack.json +7 -0
- package/packs/en/slide-deck/prompts/rules.md +17 -0
- package/packs/en/slide-deck/scripts/index.mjs +81 -0
- package/packs/en/web-ui/pack.json +7 -0
- package/packs/en/web-ui/prompts/rules.md +20 -0
- package/packs/en/web-ui/scripts/index.mjs +103 -0
- package/packs/zh/artifact-qa/pack.json +6 -0
- package/packs/zh/artifact-qa/prompts/rules.md +14 -0
- package/packs/zh/artifact-qa/scripts/index.mjs +89 -0
- package/packs/zh/prose/pack.json +7 -0
- package/packs/zh/prose/prompts/rules.md +26 -0
- package/packs/zh/prose/scripts/index.mjs +305 -0
- package/packs/zh/slide-deck/pack.json +7 -0
- package/packs/zh/slide-deck/prompts/rules.md +17 -0
- package/packs/zh/slide-deck/scripts/index.mjs +75 -0
- package/packs/zh/web-ui/pack.json +7 -0
- package/packs/zh/web-ui/prompts/rules.md +20 -0
- package/packs/zh/web-ui/scripts/index.mjs +98 -0
- package/plugin.json +5 -6
- package/server.json +2 -2
- package/skills/deslop-docs/SKILL.md +10 -8
- package/skills/deslop-slides-docx/SKILL.md +7 -8
- package/skills/deslop-verify/SKILL.md +7 -8
- package/skills/deslop-web-ui/SKILL.md +7 -8
- package/skills/dislop/SKILL.md +16 -28
- package/skills/dislop/references/essay.md +1 -1
- package/skills/dislop/references/essay.zh-CN.md +1 -1
- package/skills/dislop/references/office.md +1 -1
- package/skills/dislop/references/office.zh-CN.md +1 -1
- package/skills/dislop/references/web-ui.md +1 -1
- package/skills/dislop/references/web-ui.zh-CN.md +1 -1
- package/skills/dislop/references/work-docs.md +1 -1
- package/skills/dislop/references/work-docs.zh-CN.md +1 -1
- package/src/cli-main.mjs +210 -0
- package/src/commands/check-fix.mjs +169 -0
- package/src/commands/doctor.mjs +110 -0
- package/src/commands/init.mjs +49 -0
- package/src/commands/login.mjs +82 -0
- package/src/commands/model.mjs +130 -0
- package/src/commands/packs.mjs +44 -0
- package/src/commands/verify.mjs +133 -0
- package/src/commands/voice.mjs +84 -0
- package/src/kernel/config.mjs +232 -0
- package/src/kernel/document-model.mjs +1412 -0
- package/src/kernel/fact-gate.mjs +615 -0
- package/src/kernel/file-discovery.mjs +139 -0
- package/src/{binary-node.mjs → kernel/ooxml-binary.mjs} +532 -893
- package/src/kernel/pack-loader.mjs +715 -0
- package/src/kernel/patcher.mjs +341 -0
- package/src/kernel/pipeline.mjs +267 -0
- package/src/kernel/prompt-assembler.mjs +307 -0
- package/src/kernel/voice-profile.mjs +177 -0
- package/src/mcp/stdio-server.mjs +372 -0
- package/src/runners/auto-fix.mjs +59 -0
- package/src/runners/interactive-tty.mjs +461 -0
- package/src/runners/reporters.mjs +256 -0
- package/src/runtime/chunker.mjs +87 -0
- package/src/runtime/json-extract.mjs +144 -0
- package/src/runtime/privacy-gate.mjs +97 -0
- package/src/runtime/providers/anthropic.mjs +65 -0
- package/src/runtime/providers/cloud.mjs +136 -0
- package/src/runtime/providers/gemini.mjs +91 -0
- package/src/runtime/providers/local-model.mjs +139 -0
- package/src/runtime/providers/openai-compat.mjs +130 -0
- package/src/runtime/router.mjs +315 -0
- package/src/sdk/index.mjs +137 -0
- package/models/manifest.json +0 -90
- package/models/pocket-slop-v1.json +0 -1
- package/packs/business-brief/pack.json +0 -937
- package/packs/core/pack.json +0 -209
- package/packs/deck-and-ui/pack.json +0 -539
- package/packs/engineering-spec/pack.json +0 -144
- package/packs/executive-deck/pack.json +0 -98
- package/packs/literary-essay/pack.json +0 -344
- package/packs/regulated-comms/pack.json +0 -99
- package/patterns/ai-tic-rubric.json +0 -252
- package/patterns/banks/composite-fusion.json +0 -48
- package/patterns/banks/discourse-rhythm.json +0 -95
- package/patterns/banks/lexical-signals.json +0 -92
- package/patterns/banks/syntactic-frames.json +0 -52
- package/patterns/banks/visual-deck.json +0 -44
- package/patterns/dimensions/artifacts.json +0 -121
- package/patterns/dimensions/discourse.json +0 -438
- package/patterns/dimensions/lexical.json +0 -198
- package/patterns/dimensions/rhythm.json +0 -258
- package/patterns/dimensions/syntactic.json +0 -285
- package/patterns/dimensions/visual-and-deck.json +0 -530
- package/patterns/taxonomy.json +0 -112
- package/src/core.mjs +0 -5497
- package/src/dislop/review-picker.vim +0 -114
- package/src/local-model.mjs +0 -997
- package/src/pattern-engine.mjs +0 -1003
- package/src/pocket-model.mjs +0 -729
- package/src/review-apply.mjs +0 -151
- package/src/review-client.mjs +0 -1073
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
" Open an isolated scratch buffer. Draft content is data, never Ex commands.
|
|
2
|
-
set encoding=utf-8 nomodeline noswapfile nobackup noundofile
|
|
3
|
-
setlocal buftype=nofile bufhidden=wipe nospell wrap linebreak
|
|
4
|
-
set laststatus=0 noruler noshowmode
|
|
5
|
-
let s:items = json_decode(join(readfile($DISLOP_PICKER_DIR . '/items.json'), "\n"))
|
|
6
|
-
let s:current = 0
|
|
7
|
-
let s:accepted = {}
|
|
8
|
-
let s:rejected = {}
|
|
9
|
-
|
|
10
|
-
highlight DislopTitle term=bold cterm=bold gui=bold
|
|
11
|
-
if &background ==# 'light'
|
|
12
|
-
highlight DislopRemoved term=underline cterm=bold ctermfg=DarkRed guifg=#9c2434 gui=bold
|
|
13
|
-
highlight DislopAdded term=bold cterm=bold ctermfg=DarkGreen guifg=#176438 gui=bold
|
|
14
|
-
highlight DislopLabel term=bold cterm=bold ctermfg=DarkCyan guifg=#225d74 gui=bold
|
|
15
|
-
else
|
|
16
|
-
highlight DislopRemoved term=underline cterm=bold ctermfg=LightRed guifg=#ff9090 gui=bold
|
|
17
|
-
highlight DislopAdded term=bold cterm=bold ctermfg=LightGreen guifg=#91db9a gui=bold
|
|
18
|
-
highlight DislopLabel term=bold cterm=bold ctermfg=LightCyan guifg=#8dd8e8 gui=bold
|
|
19
|
-
endif
|
|
20
|
-
|
|
21
|
-
function! s:Section(lines, label, text) abort
|
|
22
|
-
if empty(a:text) | return | endif
|
|
23
|
-
call add(a:lines, a:label)
|
|
24
|
-
call matchaddpos('DislopLabel', [len(a:lines)])
|
|
25
|
-
call extend(a:lines, split(a:text, '\r\?\n', 1) + [''])
|
|
26
|
-
endfunction
|
|
27
|
-
|
|
28
|
-
function! s:Diff(lines, sign, group, item, text) abort
|
|
29
|
-
let parts = split(a:text, '\r\?\n', 1)
|
|
30
|
-
let positions = []
|
|
31
|
-
for i in range(len(parts))
|
|
32
|
-
let prefix = i == 0 ? a:item.prefix : ''
|
|
33
|
-
let suffix = i == len(parts) - 1 ? a:item.suffix : ''
|
|
34
|
-
call add(a:lines, a:sign . ' ' . prefix . parts[i] . suffix)
|
|
35
|
-
let row = len(a:lines)
|
|
36
|
-
call add(positions, [row, 1, 1])
|
|
37
|
-
if !empty(parts[i])
|
|
38
|
-
" Vim match columns count bytes, including the gutter and any UTF-8 context.
|
|
39
|
-
call add(positions, [row, 3 + strlen(prefix), strlen(parts[i])])
|
|
40
|
-
endif
|
|
41
|
-
endfor
|
|
42
|
-
" Older Vim versions accept at most eight positions per match.
|
|
43
|
-
for i in range(0, len(positions) - 1, 8)
|
|
44
|
-
call matchaddpos(a:group, positions[i : i + 7])
|
|
45
|
-
endfor
|
|
46
|
-
endfunction
|
|
47
|
-
|
|
48
|
-
function! s:Render() abort
|
|
49
|
-
let item = s:items[s:current]
|
|
50
|
-
let id = string(item.id)
|
|
51
|
-
let state = !has_key(item, 'after') ? 'advice' : has_key(s:accepted, id) ? 'accepted' : has_key(s:rejected, id) ? 'rejected' : 'undecided'
|
|
52
|
-
let zh = $DISLOP_PICKER_LANG ==# 'zh'
|
|
53
|
-
if zh
|
|
54
|
-
let labels = {'advice': '建议', 'accepted': '已采纳', 'rejected': '已跳过', 'undecided': '待选择'}
|
|
55
|
-
let title = printf('第 %d / %d 条 [%s] 已采纳 %d 条', item.id, len(s:items), labels[state], len(s:accepted))
|
|
56
|
-
let keys = 'j/k 或方向键:切换 y/n:采纳或跳过 回车:写入已选修改 q:放弃退出'
|
|
57
|
-
else
|
|
58
|
-
let title = printf('Review %d of %d [%s] %d accepted', item.id, len(s:items), state, len(s:accepted))
|
|
59
|
-
let keys = 'j/k or arrows: move y/n: accept/reject Enter: apply accepted q: cancel'
|
|
60
|
-
endif
|
|
61
|
-
call clearmatches()
|
|
62
|
-
let lines = [title, keys, '']
|
|
63
|
-
call matchaddpos('DislopTitle', [[1, 1, stridx(title, ' ')]])
|
|
64
|
-
let groups = {'accepted': 'DislopAdded', 'rejected': 'DislopRemoved', 'undecided': 'DislopTitle', 'advice': 'DislopLabel'}
|
|
65
|
-
let badge = matchstr(title, '\[[^]]*\]')
|
|
66
|
-
call matchaddpos(groups[state], [[1, stridx(title, badge) + 1, strlen(badge)]])
|
|
67
|
-
call s:Section(lines, zh ? '原因' : 'Why', item.why)
|
|
68
|
-
if has_key(item, 'after')
|
|
69
|
-
call s:Diff(lines, '-', 'DislopRemoved', item, item.before)
|
|
70
|
-
call s:Diff(lines, '+', 'DislopAdded', item, item.after)
|
|
71
|
-
else
|
|
72
|
-
call s:Section(lines, zh ? '原文' : 'Original', item.quote)
|
|
73
|
-
call s:Section(lines, zh ? '建议' : 'Advice', item.advice)
|
|
74
|
-
endif
|
|
75
|
-
setlocal modifiable
|
|
76
|
-
silent %delete _
|
|
77
|
-
call setline(1, lines)
|
|
78
|
-
setlocal nomodifiable nomodified
|
|
79
|
-
normal! gg
|
|
80
|
-
endfunction
|
|
81
|
-
|
|
82
|
-
function! s:Move(step) abort
|
|
83
|
-
let s:current = max([0, min([len(s:items)-1, s:current + a:step])])
|
|
84
|
-
call s:Render()
|
|
85
|
-
endfunction
|
|
86
|
-
|
|
87
|
-
function! s:Decide(accept) abort
|
|
88
|
-
let item = s:items[s:current]
|
|
89
|
-
if has_key(item, 'after')
|
|
90
|
-
let id = string(item.id)
|
|
91
|
-
let keep = a:accept ? s:accepted : s:rejected
|
|
92
|
-
let drop = a:accept ? s:rejected : s:accepted
|
|
93
|
-
let keep[id] = item.id
|
|
94
|
-
if has_key(drop, id) | call remove(drop, id) | endif
|
|
95
|
-
endif
|
|
96
|
-
call s:Move(1)
|
|
97
|
-
endfunction
|
|
98
|
-
|
|
99
|
-
function! s:Finish() abort
|
|
100
|
-
if writefile([json_encode(values(s:accepted))], $DISLOP_PICKER_DIR . '/selected') != 0
|
|
101
|
-
cquit
|
|
102
|
-
endif
|
|
103
|
-
qall!
|
|
104
|
-
endfunction
|
|
105
|
-
|
|
106
|
-
nnoremap <silent><buffer> j :call <SID>Move(1)<CR>
|
|
107
|
-
nnoremap <silent><buffer> k :call <SID>Move(-1)<CR>
|
|
108
|
-
nmap <buffer> <Down> j
|
|
109
|
-
nmap <buffer> <Up> k
|
|
110
|
-
nnoremap <silent><buffer> y :call <SID>Decide(1)<CR>
|
|
111
|
-
nnoremap <silent><buffer> n :call <SID>Decide(0)<CR>
|
|
112
|
-
nnoremap <silent><buffer> <CR> :call <SID>Finish()<CR>
|
|
113
|
-
nnoremap <silent><buffer> q :qall!<CR>
|
|
114
|
-
call s:Render()
|