@aiyiran/myclaw 1.1.201 → 1.1.203

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.
Files changed (40) hide show
  1. package/assets/myclaw-artifacts.js +316 -9
  2. package/assets/myclaw-inject.js +110 -9
  3. package/create_agent.js +15 -11
  4. package/index.js +8 -0
  5. package/package.json +1 -1
  6. package/publish.sh +6 -1
  7. package/server/sync_workspace.py +12 -5
  8. package/skills/yiran-playground-template-use/SKILL.md +5 -4
  9. package/skills/yiran-playground-template-use/prompts/single-html-handoff.txt +23 -0
  10. package/skills/yiran-playground-template-use/scripts/deploy_to_workspace.py +62 -10
  11. package/skills/yiran-playground-template-use/scripts/start_tui_handoff.py +22 -4
  12. package/skills/yiran-course-template-pipeline/README.md +0 -132
  13. package/skills/yiran-course-template-pipeline/SKILL.md +0 -74
  14. package/skills/yiran-course-template-pipeline/assets/a100-teacher.example.html +0 -66
  15. package/skills/yiran-course-template-pipeline/assets/student-template.html +0 -77
  16. package/skills/yiran-course-template-pipeline/assets/teacher-portrait-demo.html +0 -105
  17. package/skills/yiran-course-template-pipeline/assets/teacher-task-view.html +0 -110
  18. package/skills/yiran-course-template-pipeline/prompts//350/257/204/344/273/267/347/202/271/345/255/220.md +0 -107
  19. package/skills/yiran-course-template-pipeline/prompts//351/230/266/346/256/2651-demo/347/224/237/346/210/220.md +0 -121
  20. package/skills/yiran-course-template-pipeline/prompts//351/230/266/346/256/2652-student/347/224/237/346/210/220.md +0 -115
  21. package/skills/yiran-course-template-pipeline/prompts//351/230/266/346/256/2653-teacher/347/224/237/346/210/220.md +0 -144
  22. package/skills/yiran-course-template-pipeline/prompts//351/230/266/346/256/2654-/346/211/223/345/214/205/350/220/275/347/233/230.md +0 -130
  23. package/skills/yiran-course-template-pipeline/references/student-example.json +0 -38
  24. package/skills/yiran-course-template-pipeline/references/student-fields.md +0 -195
  25. package/skills/yiran-course-template-pipeline/references/student-scaffold.json +0 -34
  26. package/skills/yiran-course-template-pipeline/references/teacher-fields.md +0 -271
  27. package/skills/yiran-course-template-pipeline/references/teacher-scaffold.json +0 -25
  28. package/skills/yiran-course-template-pipeline/scripts/build_template_index.py +0 -150
  29. package/skills/yiran-course-template-pipeline/scripts/build_template_views.py +0 -132
  30. package/skills/yiran-course-template-pipeline/scripts/identify_template.py +0 -174
  31. package/skills/yiran-course-template-pipeline/scripts/migrate_templates.py +0 -104
  32. package/skills/yiran-course-template-pipeline/scripts/move_template_task.py +0 -107
  33. package/skills/yiran-course-template-pipeline/scripts/publish_template.py +0 -131
  34. package/skills/yiran-course-template-pipeline/scripts/release_template.py +0 -84
  35. package/skills/yiran-course-template-pipeline/scripts/render_student_page.py +0 -66
  36. package/skills/yiran-course-template-pipeline/scripts/render_teacher_view.py +0 -108
  37. package/skills/yiran-course-template-pipeline/template-index.json +0 -671
  38. package/skills/yiran-course-template-pipeline/template-index.md +0 -246
  39. package/skills/yiran-course-template-pipeline//344/270/232/345/212/241/350/203/214/346/231/257.md +0 -81
  40. package/skills/yiran-course-template-pipeline//345/272/237/345/274/203/rewrite_html_refs.py +0 -102
@@ -1,108 +0,0 @@
1
- #!/usr/bin/env python3
2
- import json
3
- import html
4
- import sys
5
- from pathlib import Path
6
-
7
-
8
- def esc(value):
9
- return html.escape(str(value if value is not None else ""))
10
-
11
-
12
- def render_tags(items):
13
- return ''.join(f'<span class="tag">{esc(item)}</span>' for item in items)
14
-
15
-
16
- def render_list(items):
17
- return ''.join(f'<div class="list-item">{esc(item)}</div>' for item in items)
18
-
19
-
20
- def render_issues(items):
21
- blocks = []
22
- for item in items:
23
- card = item.get('卡点', '') if isinstance(item, dict) else ''
24
- solution = item.get('解决方案', '') if isinstance(item, dict) else ''
25
- blocks.append('<div class="list-item issue">' f'<strong>卡点</strong>{esc(card)}' f'<strong>解决方案</strong>{esc(solution)}' '</div>')
26
- return ''.join(blocks)
27
-
28
-
29
- def guess_preview_file(input_path: Path):
30
- folder = input_path.parent
31
- for name in ['__demo__.html', 'example.html', 'index.html', 'preview.html']:
32
- candidate = folder / name
33
- if candidate.exists() and candidate.name != input_path.name:
34
- return candidate.name
35
- return ''
36
-
37
-
38
- def render_html(data, preview_file=''):
39
- title = f"{data.get('任务类别', '')}{data.get('任务编号', '')} · {data.get('任务名称', '')}".strip(' ·')
40
- iframe_html = f'<div class="preview-card"><div class="preview-head"><h2>作品预览</h2></div><iframe src="{esc(preview_file)}" title="作品预览"></iframe></div>' if preview_file else '<div class="preview-card empty"><div class="preview-head"><h2>作品预览</h2></div><div class="empty-box">当前文件夹下没有找到 example.html / index.html / preview.html</div></div>'
41
- return f'''<!DOCTYPE html>
42
- <html lang="zh-CN">
43
- <head>
44
- <meta charset="UTF-8" />
45
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
46
- <title>{esc(title or '教师任务查看页')}</title>
47
- <style>
48
- * {{ box-sizing: border-box; }}
49
- body {{ margin: 0; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f7fb; color: #24324a; }}
50
- .page {{ max-width: 1400px; margin: 0 auto; padding: 20px; }}
51
- .hero {{ background: linear-gradient(135deg,#5f82ff 0%,#8c74ff 100%); color: #fff; border-radius: 24px; padding: 22px 24px; box-shadow: 0 16px 36px rgba(92,108,192,.22); }}
52
- .hero h1 {{ margin: 0; font-size: 28px; }}
53
- .hero p {{ margin: 8px 0 0; opacity: .92; font-size: 14px; }}
54
- .layout {{ margin-top: 18px; display: grid; grid-template-columns: 360px minmax(0,1fr); gap: 16px; align-items: start; }}
55
- .sidebar {{ display: grid; gap: 16px; }}
56
- .card, .preview-card {{ background: #fff; border: 1px solid #e7eefc; border-radius: 20px; padding: 18px; box-shadow: 0 10px 24px rgba(100,122,166,.08); }}
57
- .card h2, .preview-head h2 {{ margin: 0 0 12px; font-size: 18px; color: #314a96; }}
58
- .meta-grid {{ display: grid; grid-template-columns: 1fr; gap: 10px; }}
59
- .meta-item {{ background: #f8faff; border: 1px solid #e7eefc; border-radius: 14px; padding: 12px; }}
60
- .meta-item .label {{ font-size: 12px; color: #7a89ad; margin-bottom: 6px; }}
61
- .meta-item .value {{ font-size: 14px; color: #24324a; font-weight: 700; }}
62
- .tags {{ display: flex; flex-wrap: wrap; gap: 8px; }}
63
- .tag {{ display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; background: #edf2ff; color: #4c65c3; font-size: 13px; font-weight: 700; }}
64
- .list {{ display: grid; gap: 10px; }}
65
- .list-item {{ background: #f8faff; border: 1px solid #e7eefc; border-radius: 14px; padding: 12px; line-height: 1.7; font-size: 14px; color: #60708b; }}
66
- .issue {{ border-left: 4px solid #8c74ff; background: #faf8ff; }}
67
- .issue strong {{ color: #314a96; display: block; margin: 6px 0; }}
68
- iframe {{ width: 100%; height: 900px; border: 1px solid #dfe7fb; border-radius: 16px; background: #fff; display: block; }}
69
- .empty-box {{ background: #f8faff; border: 1px dashed #cfdcff; border-radius: 14px; padding: 24px; color: #7a89ad; line-height: 1.8; }}
70
- @media (max-width: 960px) {{ .layout {{ grid-template-columns: 1fr; }} iframe {{ height: 420px; }} }}
71
- </style>
72
- </head>
73
- <body>
74
- <div class="page">
75
- <section class="hero">
76
- <h1>{esc(title or '教师任务查看页')}</h1>
77
- <p>这是根据教师 JSON 自动生成的可视化查看页,左边快速扫读,右边直接看作品预览。</p>
78
- </section>
79
- <section class="layout">
80
- <div class="sidebar">
81
- <div class="card"><h2>基础信息</h2><div class="meta-grid"><div class="meta-item"><div class="label">主能力标签</div><div class="value">{esc(data.get('主能力标签', '—'))}</div></div><div class="meta-item"><div class="label">任务类型标签</div><div class="value">{esc(data.get('任务类型标签', '—'))}</div></div></div></div>
82
- <div class="card"><h2>适合学生类型</h2><div class="tags">{render_tags(data.get('适合学生类型', []))}</div></div>
83
- <div class="card"><h2>训练重点</h2><div class="list">{render_list(data.get('训练重点', []))}</div></div>
84
- <div class="card"><h2>卡点和解决方案</h2><div class="list">{render_issues(data.get('卡点和解决方案', []))}</div></div>
85
- <div class="card"><h2>可拓展方向</h2><div class="list">{render_list(data.get('可拓展方向', []))}</div></div>
86
- <div class="card"><h2>课后作业</h2><div class="list">{render_list(data.get('课后作业', []))}</div></div>
87
- </div>
88
- {iframe_html}
89
- </section>
90
- </div>
91
- </body>
92
- </html>'''
93
-
94
-
95
- def main():
96
- if len(sys.argv) < 2:
97
- print('用法: python3 render_teacher_view.py <输入json> [输出html]')
98
- sys.exit(1)
99
- input_path = Path(sys.argv[1]).expanduser().resolve()
100
- output_path = Path(sys.argv[2]).expanduser().resolve() if len(sys.argv) > 2 else input_path.parent / '__teacher-view__.html'
101
- with input_path.open('r', encoding='utf-8') as f:
102
- data = json.load(f)
103
- output_path.write_text(render_html(data, guess_preview_file(input_path)), encoding='utf-8')
104
- print(f'已生成: {output_path}')
105
-
106
-
107
- if __name__ == '__main__':
108
- main()