create-principles-disciple 1.73.0 → 1.74.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/LICENSE +21 -21
- package/README.md +24 -0
- package/console/dist/server/index.js +13 -1
- package/console/dist/server/routes/agents.js +3 -118
- package/console/dist/server/routes/update-history.d.ts +12 -0
- package/console/dist/server/routes/update-history.js +52 -0
- package/console/dist/server/routes/update.d.ts +10 -0
- package/console/dist/server/routes/update.js +435 -0
- package/console/dist/ui/App.js +2 -1
- package/console/dist/ui/components/UpdateBanner.d.ts +1 -0
- package/console/dist/ui/components/UpdateBanner.js +41 -0
- package/console/dist/ui/components/UpdateProgressDialog.d.ts +12 -0
- package/console/dist/ui/components/UpdateProgressDialog.js +28 -0
- package/console/dist/ui/i18n/en.json +0 -1
- package/console/dist/ui/i18n/zh-CN.json +0 -1
- package/console/dist/ui/pages/AgentsPage.js +3 -17
- package/console/dist/ui/pages/TasksPage.js +0 -1
- package/console/dist/ui/pages/UpdatePage.d.ts +1 -0
- package/console/dist/ui/pages/UpdatePage.js +142 -0
- package/console/dist/web/assets/app.css +7 -0
- package/console/dist/web/assets/app.js +456 -173
- package/console/package.json +2 -0
- package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.d.ts +2 -0
- package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js +270 -0
- package/core/dist/runtime-v2/adapter/__tests__/schema-prompt-adapter.test.js.map +1 -0
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts +1 -1
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +4 -3
- package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
- package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts +13 -0
- package/core/dist/runtime-v2/adapter/schema-prompt-adapter.d.ts.map +1 -0
- package/core/dist/runtime-v2/adapter/schema-prompt-adapter.js +266 -0
- package/core/dist/runtime-v2/adapter/schema-prompt-adapter.js.map +1 -0
- package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts +3 -7
- package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.js +7 -19
- package/core/dist/runtime-v2/adapter/tools/diagnostician-tool.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js +97 -15
- package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician-output.d.ts +0 -10
- package/core/dist/runtime-v2/diagnostician-output.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician-output.js +5 -10
- package/core/dist/runtime-v2/diagnostician-output.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +6 -1
- package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician-prompt-builder.js +23 -15
- package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/installer.d.ts.map +1 -1
- package/dist/installer.js +67 -0
- package/dist/installer.js.map +1 -1
- package/dist/uninstaller.d.ts +0 -5
- package/dist/uninstaller.d.ts.map +1 -1
- package/dist/uninstaller.js +53 -8
- package/dist/uninstaller.js.map +1 -1
- package/dist/updater.d.ts +45 -0
- package/dist/updater.d.ts.map +1 -0
- package/dist/updater.js +333 -0
- package/dist/updater.js.map +1 -0
- package/dist/utils/env.d.ts +6 -0
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +54 -0
- package/dist/utils/env.js.map +1 -1
- package/package.json +6 -2
- package/pd-cli/dist/index.js +4 -1
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/package.json +2 -2
- package/plugin/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +2 -2
- package/plugin/templates/langs/zh/skills/ai-sprint-orchestration/runtime/.gitignore +2 -2
- package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.d.ts +0 -2
- package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.d.ts.map +0 -1
- package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.js +0 -215
- package/core/dist/runtime-v2/__tests__/nocturnal-compliance-trust-boundary.test.js.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.d.ts +0 -2
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.d.ts.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.js +0 -92
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-config-resolve.test.js.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.d.ts +0 -2
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.d.ts.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.js +0 -134
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-decision.test.js.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.d.ts +0 -2
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.d.ts.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.js +0 -226
- package/core/dist/runtime-v2/idle-trigger/__tests__/idle-trigger-edge-cases.test.js.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.d.ts +0 -3
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.d.ts.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.js +0 -5
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-decision.js.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.d.ts +0 -4
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.d.ts.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.js +0 -81
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-policy.js.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.d.ts +0 -29
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.d.ts.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.js +0 -15
- package/core/dist/runtime-v2/idle-trigger/idle-trigger-types.js.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/index.d.ts +0 -5
- package/core/dist/runtime-v2/idle-trigger/index.d.ts.map +0 -1
- package/core/dist/runtime-v2/idle-trigger/index.js +0 -4
- package/core/dist/runtime-v2/idle-trigger/index.js.map +0 -1
- package/core/dist/runtime-v2/nocturnal/candidate-scoring.d.ts +0 -486
- package/core/dist/runtime-v2/nocturnal/candidate-scoring.d.ts.map +0 -1
- package/core/dist/runtime-v2/nocturnal/candidate-scoring.js +0 -493
- package/core/dist/runtime-v2/nocturnal/candidate-scoring.js.map +0 -1
- package/core/dist/runtime-v2/nocturnal/index.d.ts +0 -9
- package/core/dist/runtime-v2/nocturnal/index.d.ts.map +0 -1
- package/core/dist/runtime-v2/nocturnal/index.js +0 -5
- package/core/dist/runtime-v2/nocturnal/index.js.map +0 -1
- package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.d.ts +0 -185
- package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.d.ts.map +0 -1
- package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.js +0 -912
- package/core/dist/runtime-v2/nocturnal/nocturnal-compliance.js.map +0 -1
- package/core/dist/runtime-v2/nocturnal/snapshot-contract.d.ts +0 -192
- package/core/dist/runtime-v2/nocturnal/snapshot-contract.d.ts.map +0 -1
- package/core/dist/runtime-v2/nocturnal/snapshot-contract.js +0 -185
- package/core/dist/runtime-v2/nocturnal/snapshot-contract.js.map +0 -1
- package/core/dist/runtime-v2/nocturnal/trinity-types.d.ts +0 -421
- package/core/dist/runtime-v2/nocturnal/trinity-types.d.ts.map +0 -1
- package/core/dist/runtime-v2/nocturnal/trinity-types.js +0 -182
- package/core/dist/runtime-v2/nocturnal/trinity-types.js.map +0 -1
- package/pd-cli/dist/commands/runtime-idle-trigger.d.ts +0 -12
- package/pd-cli/dist/commands/runtime-idle-trigger.d.ts.map +0 -1
- package/pd-cli/dist/commands/runtime-idle-trigger.js +0 -102
- package/pd-cli/dist/commands/runtime-idle-trigger.js.map +0 -1
- package/plugin/dist/bundle.js +0 -2424
- package/plugin/dist/core/trajectory/index.js +0 -1804
- package/plugin/dist/openclaw.plugin.json +0 -65
- package/plugin/dist/templates/langs/en/core/AGENTS.md +0 -205
- package/plugin/dist/templates/langs/en/core/BOOT.md +0 -60
- package/plugin/dist/templates/langs/en/core/BOOTSTRAP.md +0 -273
- package/plugin/dist/templates/langs/en/core/HEARTBEAT.md +0 -74
- package/plugin/dist/templates/langs/en/core/IDENTITY.md +0 -8
- package/plugin/dist/templates/langs/en/core/PRINCIPLES.md +0 -10
- package/plugin/dist/templates/langs/en/core/SOUL.md +0 -46
- package/plugin/dist/templates/langs/en/core/TOOLS.md +0 -15
- package/plugin/dist/templates/langs/en/core/USER.md +0 -10
- package/plugin/dist/templates/langs/en/pain/00_seed_samples.md +0 -23
- package/plugin/dist/templates/langs/en/pain_dictionary.json +0 -22
- package/plugin/dist/templates/langs/en/principles/THINKING_OS.md +0 -64
- package/plugin/dist/templates/langs/en/skills/admin/SKILL.md +0 -39
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/EXAMPLES.md +0 -63
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/REFERENCE.md +0 -136
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/SKILL.md +0 -67
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/agent-registry.json +0 -143
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/bugfix-complex-template.json +0 -107
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/feature-complex-template.json +0 -107
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal-verify.json +0 -95
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal.json +0 -98
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/workflow-v1-acceptance-checklist.md +0 -58
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/references/workflow-v1.4-work-unit-handoff.md +0 -190
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/runtime/.gitignore +0 -2
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/archive.mjs +0 -310
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/contract-enforcement.mjs +0 -683
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/decision.mjs +0 -604
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/state-store.mjs +0 -32
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/lib/task-specs.mjs +0 -707
- package/plugin/dist/templates/langs/en/skills/ai-sprint-orchestration/scripts/run.mjs +0 -3455
- package/plugin/dist/templates/langs/en/skills/bootstrap-tools/SKILL.md +0 -53
- package/plugin/dist/templates/langs/en/skills/deductive-audit/SKILL.md +0 -36
- package/plugin/dist/templates/langs/en/skills/evolution-framework-update/SKILL.md +0 -31
- package/plugin/dist/templates/langs/en/skills/evolve-system/SKILL.md +0 -46
- package/plugin/dist/templates/langs/en/skills/evolve-task/SKILL.md +0 -83
- package/plugin/dist/templates/langs/en/skills/feedback/SKILL.md +0 -51
- package/plugin/dist/templates/langs/en/skills/init-strategy/SKILL.md +0 -54
- package/plugin/dist/templates/langs/en/skills/inject-rule/SKILL.md +0 -19
- package/plugin/dist/templates/langs/en/skills/manage-okr/SKILL.md +0 -96
- package/plugin/dist/templates/langs/en/skills/pd-auditor/SKILL.md +0 -61
- package/plugin/dist/templates/langs/en/skills/pd-cli-operator/SKILL.md +0 -67
- package/plugin/dist/templates/langs/en/skills/pd-daily/SKILL.md +0 -199
- package/plugin/dist/templates/langs/en/skills/pd-diagnostician/SKILL.md +0 -466
- package/plugin/dist/templates/langs/en/skills/pd-explorer/SKILL.md +0 -65
- package/plugin/dist/templates/langs/en/skills/pd-grooming/SKILL.md +0 -46
- package/plugin/dist/templates/langs/en/skills/pd-implementer/SKILL.md +0 -68
- package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +0 -230
- package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +0 -30
- package/plugin/dist/templates/langs/en/skills/pd-planner/SKILL.md +0 -65
- package/plugin/dist/templates/langs/en/skills/pd-runtime-v2/SKILL.md +0 -61
- package/plugin/dist/templates/langs/en/skills/plan-script/SKILL.md +0 -32
- package/plugin/dist/templates/langs/en/skills/profile/SKILL.md +0 -24
- package/plugin/dist/templates/langs/en/skills/reflection/SKILL.md +0 -40
- package/plugin/dist/templates/langs/en/skills/reflection-log/SKILL.md +0 -37
- package/plugin/dist/templates/langs/en/skills/report/SKILL.md +0 -13
- package/plugin/dist/templates/langs/en/skills/root-cause/SKILL.md +0 -33
- package/plugin/dist/templates/langs/en/skills/triage/SKILL.md +0 -29
- package/plugin/dist/templates/langs/en/skills/watch-evolution/SKILL.md +0 -33
- package/plugin/dist/templates/langs/zh/core/AGENTS.md +0 -197
- package/plugin/dist/templates/langs/zh/core/BOOT.md +0 -60
- package/plugin/dist/templates/langs/zh/core/BOOTSTRAP.md +0 -273
- package/plugin/dist/templates/langs/zh/core/HEARTBEAT.md +0 -98
- package/plugin/dist/templates/langs/zh/core/IDENTITY.md +0 -8
- package/plugin/dist/templates/langs/zh/core/PRINCIPLES.md +0 -7
- package/plugin/dist/templates/langs/zh/core/SOUL.md +0 -46
- package/plugin/dist/templates/langs/zh/core/TOOLS.md +0 -15
- package/plugin/dist/templates/langs/zh/core/USER.md +0 -10
- package/plugin/dist/templates/langs/zh/pain/00_seed_samples.md +0 -24
- package/plugin/dist/templates/langs/zh/pain_dictionary.json +0 -18
- package/plugin/dist/templates/langs/zh/principles/THINKING_OS.md +0 -64
- package/plugin/dist/templates/langs/zh/skills/admin/SKILL.md +0 -41
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/EXAMPLES.md +0 -63
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/REFERENCE.md +0 -136
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/SKILL.md +0 -67
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/agent-registry.json +0 -143
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/bugfix-complex-template.json +0 -107
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/feature-complex-template.json +0 -107
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/nocturnal-trinity-quality-enhancement.json +0 -111
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal-verify.json +0 -95
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/specs/workflow-validation-minimal.json +0 -98
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/workflow-v1-acceptance-checklist.md +0 -58
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/references/workflow-v1.4-work-unit-handoff.md +0 -190
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/runtime/.gitignore +0 -2
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/archive.mjs +0 -310
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/contract-enforcement.mjs +0 -683
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/decision.mjs +0 -604
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/state-store.mjs +0 -32
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/lib/task-specs.mjs +0 -707
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/scripts/run.mjs +0 -3455
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/archive.test.mjs +0 -230
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/contract-enforcement.test.mjs +0 -672
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/decision.test.mjs +0 -1321
- package/plugin/dist/templates/langs/zh/skills/ai-sprint-orchestration/test/run.test.mjs +0 -1435
- package/plugin/dist/templates/langs/zh/skills/bootstrap-tools/SKILL.md +0 -52
- package/plugin/dist/templates/langs/zh/skills/deductive-audit/SKILL.md +0 -36
- package/plugin/dist/templates/langs/zh/skills/evolution-framework-update/SKILL.md +0 -31
- package/plugin/dist/templates/langs/zh/skills/evolve-system/SKILL.md +0 -46
- package/plugin/dist/templates/langs/zh/skills/evolve-task/SKILL.md +0 -83
- package/plugin/dist/templates/langs/zh/skills/feedback/SKILL.md +0 -53
- package/plugin/dist/templates/langs/zh/skills/init-strategy/SKILL.md +0 -54
- package/plugin/dist/templates/langs/zh/skills/inject-rule/SKILL.md +0 -19
- package/plugin/dist/templates/langs/zh/skills/manage-okr/SKILL.md +0 -109
- package/plugin/dist/templates/langs/zh/skills/pd-auditor/SKILL.md +0 -61
- package/plugin/dist/templates/langs/zh/skills/pd-cli-operator/SKILL.md +0 -67
- package/plugin/dist/templates/langs/zh/skills/pd-daily/SKILL.md +0 -283
- package/plugin/dist/templates/langs/zh/skills/pd-diagnostician/SKILL.md +0 -391
- package/plugin/dist/templates/langs/zh/skills/pd-explorer/SKILL.md +0 -65
- package/plugin/dist/templates/langs/zh/skills/pd-grooming/SKILL.md +0 -46
- package/plugin/dist/templates/langs/zh/skills/pd-implementer/SKILL.md +0 -68
- package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +0 -230
- package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +0 -30
- package/plugin/dist/templates/langs/zh/skills/pd-planner/SKILL.md +0 -65
- package/plugin/dist/templates/langs/zh/skills/pd-runtime-v2/SKILL.md +0 -61
- package/plugin/dist/templates/langs/zh/skills/plan-script/SKILL.md +0 -32
- package/plugin/dist/templates/langs/zh/skills/profile/SKILL.md +0 -24
- package/plugin/dist/templates/langs/zh/skills/reflection/SKILL.md +0 -40
- package/plugin/dist/templates/langs/zh/skills/reflection-log/SKILL.md +0 -37
- package/plugin/dist/templates/langs/zh/skills/report/SKILL.md +0 -13
- package/plugin/dist/templates/langs/zh/skills/root-cause/SKILL.md +0 -33
- package/plugin/dist/templates/langs/zh/skills/triage/SKILL.md +0 -29
- package/plugin/dist/templates/langs/zh/skills/watch-evolution/SKILL.md +0 -33
- package/plugin/dist/templates/pain_dictionary.json +0 -36
- package/plugin/dist/templates/pain_settings.json +0 -103
- package/plugin/dist/templates/workspace/.principles/DECISION_POLICY.json +0 -44
- package/plugin/dist/templates/workspace/.principles/PRINCIPLES.md +0 -20
- package/plugin/dist/templates/workspace/.principles/PROFILE.json +0 -54
- package/plugin/dist/templates/workspace/.principles/PROFILE.schema.json +0 -56
- package/plugin/dist/templates/workspace/.principles/THINKING_OS.md +0 -64
- package/plugin/dist/templates/workspace/.principles/THINKING_OS_ARCHIVE.md +0 -7
- package/plugin/dist/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +0 -9
- package/plugin/dist/templates/workspace/.principles/models/_INDEX.md +0 -27
- package/plugin/dist/templates/workspace/.principles/models/first_principles.md +0 -62
- package/plugin/dist/templates/workspace/.principles/models/marketing_4p.md +0 -52
- package/plugin/dist/templates/workspace/.principles/models/porter_five.md +0 -63
- package/plugin/dist/templates/workspace/.principles/models/swot.md +0 -60
- package/plugin/dist/templates/workspace/.principles/models/user_story_map.md +0 -63
- package/plugin/dist/templates/workspace/.state/WORKBOARD.json +0 -4
- package/plugin/dist/templates/workspace/AUDIT.md +0 -15
- package/plugin/dist/templates/workspace/PLAN.md +0 -2
- package/plugin/dist/templates/workspace/okr/CURRENT_FOCUS.md +0 -57
- package/plugin/dist/templates/workspace/okr/RECOVERY_PROTOCOL.md +0 -56
- package/plugin/dist/templates/workspace/okr/TASK_CHANGES.jsonl +0 -6
- package/plugin/dist/templates/workspace/okr/WEEK_TASKS.json +0 -6
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { PageHeader } from "../components/page-header.js";
|
|
5
|
+
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "../components/ui/card.js";
|
|
6
|
+
import { Button } from "../components/ui/button.js";
|
|
7
|
+
import { Badge } from "../components/ui/badge.js";
|
|
8
|
+
import { Separator } from "../components/ui/separator.js";
|
|
9
|
+
import { UpdateProgressDialog } from "../components/UpdateProgressDialog.js";
|
|
10
|
+
import { RefreshCw, Download, Shield, CheckCircle2 } from "lucide-react";
|
|
11
|
+
function isValidUpdateInfo(data) {
|
|
12
|
+
if (typeof data !== "object" || data === null)
|
|
13
|
+
return false;
|
|
14
|
+
const obj = data;
|
|
15
|
+
return typeof obj.hasUpdate === "boolean" && typeof obj.currentVersion === "string";
|
|
16
|
+
}
|
|
17
|
+
function isApiResponse(value) {
|
|
18
|
+
if (typeof value !== "object" || value === null)
|
|
19
|
+
return false;
|
|
20
|
+
const obj = value;
|
|
21
|
+
return typeof obj.success === "boolean";
|
|
22
|
+
}
|
|
23
|
+
const MERGE_STRATEGY_DESCRIPTIONS = {
|
|
24
|
+
smart: "生成 .update 文件供手动合并",
|
|
25
|
+
overwrite: "直接覆盖用户文件",
|
|
26
|
+
keep: "保留用户文件不变",
|
|
27
|
+
};
|
|
28
|
+
export function UpdatePage() {
|
|
29
|
+
const { t } = useTranslation();
|
|
30
|
+
const [updateInfo, setUpdateInfo] = useState(null);
|
|
31
|
+
const [checking, setChecking] = useState(false);
|
|
32
|
+
const [mergeStrategy, setMergeStrategy] = useState("smart");
|
|
33
|
+
const [createBackup, setCreateBackup] = useState(true);
|
|
34
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
35
|
+
const [dialogStatus, setDialogStatus] = useState("checking");
|
|
36
|
+
const [dialogError, setDialogError] = useState();
|
|
37
|
+
const [updateCompleted, setUpdateCompleted] = useState(false);
|
|
38
|
+
const [lastBackupPath, setLastBackupPath] = useState();
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
checkForUpdates();
|
|
41
|
+
}, []);
|
|
42
|
+
async function checkForUpdates() {
|
|
43
|
+
setChecking(true);
|
|
44
|
+
try {
|
|
45
|
+
const response = await fetch("/api/update/check");
|
|
46
|
+
const result = await response.json();
|
|
47
|
+
if (!isApiResponse(result)) {
|
|
48
|
+
console.error("[UpdatePage] Invalid response shape from /api/update/check:", result);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (result.success && isValidUpdateInfo(result.data)) {
|
|
52
|
+
setUpdateInfo(result.data);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
console.error("[UpdatePage] Failed to check for updates:", err);
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
setChecking(false);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async function handleUpdate() {
|
|
63
|
+
setDialogError(undefined);
|
|
64
|
+
setUpdateCompleted(false);
|
|
65
|
+
setDialogOpen(true);
|
|
66
|
+
setDialogStatus("checking");
|
|
67
|
+
// Brief checking phase
|
|
68
|
+
await new Promise((r) => setTimeout(r, 800));
|
|
69
|
+
setDialogStatus("downloading");
|
|
70
|
+
try {
|
|
71
|
+
const response = await fetch("/api/update/apply", {
|
|
72
|
+
method: "POST",
|
|
73
|
+
headers: { "Content-Type": "application/json" },
|
|
74
|
+
body: JSON.stringify({
|
|
75
|
+
mergeStrategy,
|
|
76
|
+
createBackup,
|
|
77
|
+
}),
|
|
78
|
+
});
|
|
79
|
+
const result = await response.json();
|
|
80
|
+
if (!isApiResponse(result)) {
|
|
81
|
+
setDialogStatus("failed");
|
|
82
|
+
setDialogError("Invalid response from server");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const data = result.data;
|
|
86
|
+
if (result.success && data && data.success === true) {
|
|
87
|
+
if (typeof data.backupPath === "string") {
|
|
88
|
+
setLastBackupPath(data.backupPath);
|
|
89
|
+
}
|
|
90
|
+
setDialogStatus("applying");
|
|
91
|
+
await new Promise((r) => setTimeout(r, 600));
|
|
92
|
+
setDialogStatus("completed");
|
|
93
|
+
setUpdateCompleted(true);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
setDialogStatus("failed");
|
|
97
|
+
const message = (data && typeof data.message === "string") ? data.message
|
|
98
|
+
: (typeof result.error === "string" ? result.error : "Unknown error");
|
|
99
|
+
setDialogError(message);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
setDialogStatus("failed");
|
|
104
|
+
setDialogError(err instanceof Error ? err.message : "Network error");
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function handleRollback() {
|
|
108
|
+
try {
|
|
109
|
+
const response = await fetch("/api/update/rollback", {
|
|
110
|
+
method: "POST",
|
|
111
|
+
headers: { "Content-Type": "application/json" },
|
|
112
|
+
body: JSON.stringify({
|
|
113
|
+
backupDir: lastBackupPath || "",
|
|
114
|
+
}),
|
|
115
|
+
});
|
|
116
|
+
const result = await response.json();
|
|
117
|
+
if (isApiResponse(result) && result.success) {
|
|
118
|
+
setDialogOpen(false);
|
|
119
|
+
setUpdateCompleted(false);
|
|
120
|
+
checkForUpdates();
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
const msg = (result && typeof result === "object" && Object.hasOwn(result, "error"))
|
|
124
|
+
? result.error : "Rollback failed";
|
|
125
|
+
setDialogError(typeof msg === "string" ? msg : "Rollback failed");
|
|
126
|
+
setDialogStatus("failed");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
console.error("[UpdatePage] Rollback failed:", err);
|
|
131
|
+
setDialogError(err instanceof Error ? err.message : "Rollback network error");
|
|
132
|
+
setDialogStatus("failed");
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return (_jsxs(_Fragment, { children: [_jsx(PageHeader, { title: t("pages:update.title", { defaultValue: "更新" }) }), updateCompleted && (_jsx(Card, { className: "mb-6 border-green-200 bg-green-50", children: _jsxs(CardContent, { className: "flex items-center gap-3 pt-6", children: [_jsx(CheckCircle2, { className: "h-5 w-5 text-green-600" }), _jsx("span", { className: "text-sm text-green-800", children: t("pages:update.success", { defaultValue: "更新已成功应用!请重启 Gateway 以使更改生效。" }) })] }) })), _jsxs("div", { className: "grid gap-6 max-w-2xl", children: [_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs(CardTitle, { className: "flex items-center gap-2", children: [_jsx(RefreshCw, { className: "h-4 w-4" }), t("pages:update.versionInfo", { defaultValue: "版本信息" })] }) }), _jsxs(CardContent, { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-sm text-muted-foreground", children: t("pages:update.currentVersion", { defaultValue: "当前版本" }) }), _jsx(Badge, { variant: "outline", children: updateInfo?.currentVersion ?? "—" })] }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-sm text-muted-foreground", children: t("pages:update.latestVersion", { defaultValue: "最新版本" }) }), _jsx(Badge, { variant: updateInfo?.hasUpdate ? "default" : "outline", children: updateInfo?.latestVersion ?? "—" })] }), updateInfo?.hasUpdate && (_jsx("div", { className: "rounded-md bg-primary/5 p-3 text-sm text-primary", children: t("pages:update.updateAvailable", { defaultValue: "有新版本可用!" }) })), _jsxs(Button, { variant: "outline", size: "sm", onClick: checkForUpdates, disabled: checking, children: [_jsx(RefreshCw, { className: `mr-2 h-3 w-3 ${checking ? "animate-spin" : ""}` }), checking
|
|
136
|
+
? t("pages:update.checking", { defaultValue: "检查中..." })
|
|
137
|
+
: t("pages:update.checkForUpdates", { defaultValue: "检查更新" })] })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs(CardTitle, { className: "flex items-center gap-2", children: [_jsx(Shield, { className: "h-4 w-4" }), t("pages:update.settings", { defaultValue: "更新设置" })] }), _jsx(CardDescription, { children: t("pages:update.settingsDescription", { defaultValue: "配置更新行为和文件处理策略" }) })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("label", { className: "flex items-center gap-3 cursor-pointer", children: [_jsx("input", { type: "checkbox", checked: createBackup, onChange: (e) => setCreateBackup(e.target.checked), className: "h-4 w-4 rounded border-input" }), _jsxs("div", { children: [_jsx("span", { className: "text-sm font-medium", children: t("pages:update.createBackup", { defaultValue: "更新前创建备份" }) }), _jsx("p", { className: "text-xs text-muted-foreground", children: t("pages:update.createBackupHint", { defaultValue: "允许在更新失败时回滚" }) })] })] }), _jsx(Separator, {}), _jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium mb-3", children: t("pages:update.workspaceFileHandling", { defaultValue: "工作区文件处理" }) }), _jsx("div", { className: "space-y-2", children: Object.entries(MERGE_STRATEGY_DESCRIPTIONS).map(([strategy, description]) => (_jsxs("label", { className: `flex items-start gap-3 p-3 rounded-md border cursor-pointer transition-colors ${mergeStrategy === strategy
|
|
138
|
+
? "border-primary bg-primary/5"
|
|
139
|
+
: "border-border hover:bg-muted/50"}`, children: [_jsx("input", { type: "radio", name: "mergeStrategy", value: strategy, checked: mergeStrategy === strategy, onChange: () => setMergeStrategy(strategy), className: "mt-0.5" }), _jsxs("div", { children: [_jsx("span", { className: "text-sm font-medium capitalize", children: strategy }), _jsx("p", { className: "text-xs text-muted-foreground", children: t(`pages:update.merge.${strategy}`, { defaultValue: description }) })] })] }, strategy))) })] })] })] }), _jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs(Button, { className: "w-full", size: "lg", disabled: !updateInfo?.hasUpdate || checking, onClick: handleUpdate, children: [_jsx(Download, { className: "mr-2 h-4 w-4" }), updateInfo?.hasUpdate
|
|
140
|
+
? t("pages:update.updateTo", { version: updateInfo.latestVersion, defaultValue: `更新到 v${updateInfo.latestVersion}` })
|
|
141
|
+
: t("pages:update.upToDate", { defaultValue: "已是最新版本" })] }) }) })] }), _jsx(UpdateProgressDialog, { open: dialogOpen, onOpenChange: setDialogOpen, status: dialogStatus, currentVersion: updateInfo?.currentVersion ?? "", targetVersion: updateInfo?.latestVersion ?? "", errorMessage: dialogError, onRollback: handleRollback })] }));
|
|
142
|
+
}
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
--color-yellow-950: oklch(28.6% 0.066 53.813);
|
|
41
41
|
--color-green-50: oklch(98.2% 0.018 155.826);
|
|
42
42
|
--color-green-100: oklch(96.2% 0.044 156.743);
|
|
43
|
+
--color-green-200: oklch(92.5% 0.084 155.995);
|
|
43
44
|
--color-green-300: oklch(87.1% 0.15 154.449);
|
|
44
45
|
--color-green-400: oklch(79.2% 0.209 151.711);
|
|
45
46
|
--color-green-500: oklch(72.3% 0.219 149.579);
|
|
@@ -1021,6 +1022,9 @@
|
|
|
1021
1022
|
border-color: color-mix(in oklab, var(--color-destructive) 50%, transparent);
|
|
1022
1023
|
}
|
|
1023
1024
|
}
|
|
1025
|
+
.border-green-200 {
|
|
1026
|
+
border-color: var(--color-green-200);
|
|
1027
|
+
}
|
|
1024
1028
|
.border-green-300 {
|
|
1025
1029
|
border-color: var(--color-green-300);
|
|
1026
1030
|
}
|
|
@@ -1374,6 +1378,9 @@
|
|
|
1374
1378
|
.pt-4 {
|
|
1375
1379
|
padding-top: calc(var(--spacing) * 4);
|
|
1376
1380
|
}
|
|
1381
|
+
.pt-6 {
|
|
1382
|
+
padding-top: calc(var(--spacing) * 6);
|
|
1383
|
+
}
|
|
1377
1384
|
.pr-2 {
|
|
1378
1385
|
padding-right: calc(var(--spacing) * 2);
|
|
1379
1386
|
}
|