@harmonyos-arkts/opencode-plugin 0.0.14 → 0.0.16

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 (2) hide show
  1. package/dist/index.js +79 -20
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -31598,13 +31598,60 @@ var HM_BUILD = `
31598
31598
  3. Re-run the build to verify the fix
31599
31599
  4. Repeat at least 3 times
31600
31600
  5. If still failing after 3 attempts, report the remaining errors to the user and ask for guidance
31601
+ - If the build succeeds:
31602
+ 1. Guide the user to complete the quick signing in the **HarmonyBot \u63D2\u4EF6**
31603
+ 2. Path: **\u63D2\u4EF6** \u53F3\u4E0A\u89D2 ** \u2192\u300C\u8BBE\u7F6E \u2014\u2014 \u5173\u8054\u5E94\u7528 \u2014\u2014 \u5E94\u7528\u7B7E\u540D\u300D** \u2192 \u5B8C\u6210**\u5FEB\u901F\u7B7E\u540D**\u3002
31601
31604
  - Only after a successful build should the development cycle be considered complete
31602
31605
  `;
31603
- var HM_ONE2MANY = `
31604
- ### One-to-Many Adaptation Phase
31605
- - Use the \`harmonyos-one2many-adapt\` skill to adapt the HarmonyOS application for multiple device types (phone, tablet, foldable, 2-in-1, wearable, TV)
31606
- - After completing adaptation, you MUST proceed to the Build phase
31607
- - **NO EXCEPTIONS**: Code must be built successfully before marking adaptation as complete
31606
+ var HM_MULTI_DEVICE = `
31607
+ ## Role
31608
+
31609
+ You are an expert in HarmonyOS "Develop Once, Deploy Everywhere" (\u4E00\u591A) multi-device adaptation. Your job is to help developers adapt phone-first ArkTS applications to work correctly across phones, tablets, foldables, and PCs \u2014 and to diagnose and fix adaptation-related bugs in existing code.
31610
+
31611
+ You are **not** a general HarmonyOS assistant. Decline requests outside your domain (e.g., backend services, non-UI logic, Ability lifecycle unrelated to window management) and suggest the developer seek a broader assistant for those.
31612
+
31613
+ ---
31614
+
31615
+ ## Execution Workflow
31616
+
31617
+ At the start of every task, load and follow:
31618
+
31619
+ \`\`\`
31620
+ harmonyos-multi-device-adaptation/harmonyos-adaptation-workflow/SKILL.md
31621
+ \`\`\`
31622
+
31623
+ That skill defines the full execution flow for both new adaptation (Path A) and bug fixing (Path B), including project scanning, domain routing, build verification, and the mandatory implementation checklist. Do not proceed without loading it.
31624
+
31625
+ ---
31626
+
31627
+ ## Skill Files
31628
+
31629
+ Domain knowledge lives in skill files under \`harmonyos-multi-device-adaptation/\`. Each file's **Agent Interface** section contains:
31630
+
31631
+ - \`symptom_keywords\` \u2014 match against user-reported symptoms to identify the relevant domain
31632
+ - \`hard_constraints\` \u2014 verify every item before generating any code for that domain
31633
+ - \`diagnostic_checklist\` \u2014 walk through item-by-item when diagnosing a bug
31634
+
31635
+ When a new skill is added to the folder, it is automatically available \u2014 no changes to this prompt are needed.
31636
+
31637
+ ---
31638
+
31639
+ ## Universal Hard Constraints
31640
+
31641
+ These rules apply across all domains and all phases. Never deviate.
31642
+
31643
+ 1. **ArkTS only.** Never output Java, JavaScript, or Kotlin.
31644
+ 2. **No invented APIs.** If you are not certain an API exists, say so explicitly rather than guessing.
31645
+
31646
+ ---
31647
+
31648
+ ## Output Format
31649
+
31650
+ - **Lead with domain identification** \u2014 always name the domain(s) before proposing code.
31651
+ - **Use \u274C/\u2705 comparisons** for all code changes, with a one-line reason for each change.
31652
+ - **If uncertain about an API**, say: *"I'm not certain this API exists at the required level \u2014 please verify in the official HarmonyOS documentation."*
31653
+ - **If a request is outside your domains**, say: *"This falls outside multi-device adaptation. You may want to consult a general HarmonyOS assistant for this."*
31654
+ - **Never output a wall of code** without explaining what changed and why.
31608
31655
  `;
31609
31656
  var HM_PLAN = `
31610
31657
  ### Plan Phase
@@ -31720,8 +31767,8 @@ function buildPlanPrompt(type) {
31720
31767
  return HM_DESIGN;
31721
31768
  case "build":
31722
31769
  return HM_BUILD;
31723
- case "one2many":
31724
- return HM_ONE2MANY;
31770
+ case "multi-device":
31771
+ return HM_MULTI_DEVICE;
31725
31772
  case "plan":
31726
31773
  return HM_PLAN;
31727
31774
  case "all":
@@ -31866,6 +31913,13 @@ function createHmAgent() {
31866
31913
  doom_loop: "ask",
31867
31914
  external_directory: {
31868
31915
  "*": "ask"
31916
+ },
31917
+ "skillSearch": "allow",
31918
+ skill: {
31919
+ "*": "deny",
31920
+ "harmonyos-atomic-dev": "allow",
31921
+ "harmonyos-hvigor": "allow",
31922
+ "harmonyos-prd-design": "allow"
31869
31923
  }
31870
31924
  },
31871
31925
  metadata: void 0
@@ -31914,30 +31968,34 @@ function createHmDevelopmentAgent() {
31914
31968
  prompt: buildHmAgentPrompt("dev"),
31915
31969
  temperature: 0.3,
31916
31970
  permission: {
31917
- "skillSearch": "allow"
31971
+ "skillSearch": "allow",
31972
+ skill: {
31973
+ "*": "deny",
31974
+ "harmonyos-atomic-dev": "allow",
31975
+ "harmonyos-hvigor": "allow",
31976
+ "harmonyos-prd-design": "allow"
31977
+ }
31918
31978
  },
31919
31979
  metadata: void 0
31920
31980
  };
31921
31981
  return agent;
31922
31982
  }
31923
31983
 
31924
- // src/agents/one2many-agent.ts
31925
- function getHmOne2ManyDescription() {
31984
+ // src/agents/multi-device-agent.ts
31985
+ function getHmMultiDeviceDescription() {
31926
31986
  return `
31927
31987
  HarmonyOS One-to-Many Adaptation \u2014 adapts applications for multiple device types (phone, tablet, foldable, 2-in-1, wearable, TV)
31928
31988
  `;
31929
31989
  }
31930
- function createOne2ManyAgent() {
31990
+ function createMultiDeviceAgent() {
31931
31991
  const agent = {
31932
- id: "harmonyos-one2many",
31933
- name: "harmonyos-one2many",
31934
- description: getHmOne2ManyDescription(),
31992
+ id: "harmonyos-multi-device",
31993
+ name: "harmonyos-multi-device",
31994
+ description: getHmMultiDeviceDescription(),
31935
31995
  mode: "primary",
31936
- prompt: buildHmAgentPrompt("one2many"),
31996
+ prompt: buildHmAgentPrompt("multi-device"),
31937
31997
  temperature: 0.3,
31938
- permission: {
31939
- "skillSearch": "deny"
31940
- },
31998
+ permission: {},
31941
31999
  metadata: void 0
31942
32000
  };
31943
32001
  return agent;
@@ -31950,7 +32008,7 @@ var AgentRegistry = class {
31950
32008
  this.register(createHmAgent());
31951
32009
  this.register(createDesignAgent());
31952
32010
  this.register(createHmDevelopmentAgent());
31953
- this.register(createOne2ManyAgent());
32011
+ this.register(createMultiDeviceAgent());
31954
32012
  }
31955
32013
  register(agent) {
31956
32014
  this.agents.set(agent.id, agent);
@@ -47577,7 +47635,8 @@ function runEnvCheck() {
47577
47635
  try {
47578
47636
  const output = execSync(`${check3.cmd} 2>&1`, { timeout: 1e4, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
47579
47637
  const firstLine = output.split(/\r?\n/)[0]?.trim() || "";
47580
- lines.push(`[${check3.name}] ${firstLine}`);
47638
+ const suffix = check3.name === "Java" ? " (requires >= 17)" : "";
47639
+ lines.push(`[${check3.name}] ${firstLine}${suffix}`);
47581
47640
  } catch (err) {
47582
47641
  lines.push(`[${check3.name}] NOT FOUND`);
47583
47642
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@harmonyos-arkts/opencode-plugin",
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "description": "HarmonyOS Full-Lifecycle Development Assistant. Specialized in the complete development lifecycle of HarmonyOS applications, including project creation, UI development, state management, network requests, data storage, permission requests, performance optimization, testing, and release.",
6
6
  "type": "module",
7
7
  "license": "MIT",