@harmonyos-arkts/opencode-plugin 0.0.5 → 0.0.6-beta
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/dist/index.js +25 -39
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14864,7 +14864,7 @@ var HM_DEVELOP = `
|
|
|
14864
14864
|
- Use the \`.harmonyos/\` file (*.md\u3001*.html) as references to generate
|
|
14865
14865
|
- After completing development, you MUST proceed to the Build phase
|
|
14866
14866
|
- **NO EXCEPTIONS**: Code must be built successfully before marking development as complete
|
|
14867
|
-
- **
|
|
14867
|
+
- **THINKING PROSESS**: Only include internal thoughts, analysis, reasoning and solution planning in the thinking stage. No code shall be generated in the thinking process at all.
|
|
14868
14868
|
When generating ETS (ArkTS) code, follow these rules:
|
|
14869
14869
|
- **ArkTS Type System**: Stricter than TypeScript \u2014 forbid any/unknown/as/for..in/dynamic property access; all types must be explicitly declared.
|
|
14870
14870
|
- **V2 State Management**: Use @ComponentV2 + @Local/@Param for components, @ObservedV2 + @Trace for ViewModels. These are built-in decorators requiring no import.
|
|
@@ -15210,7 +15210,7 @@ function createAscfAgent() {
|
|
|
15210
15210
|
"*": "deny",
|
|
15211
15211
|
"harmonyos-atomic-ascf-convert": "allow",
|
|
15212
15212
|
"harmonyos-ascf-knowledge": "allow",
|
|
15213
|
-
"huawei-payment-integration
|
|
15213
|
+
"huawei-payment-integration": "allow",
|
|
15214
15214
|
"harmonyos-atomic-service-filing": "allow",
|
|
15215
15215
|
"harmony-emulator-debugging": "allow",
|
|
15216
15216
|
"harmonyos-atomic-ascf-release": "allow"
|
|
@@ -15222,6 +15222,28 @@ function createAscfAgent() {
|
|
|
15222
15222
|
return agent;
|
|
15223
15223
|
}
|
|
15224
15224
|
|
|
15225
|
+
// src/agents/one2many-agent.ts
|
|
15226
|
+
function getHmOne2ManyDescription() {
|
|
15227
|
+
return `
|
|
15228
|
+
HarmonyOS One-to-Many Adaptation \u2014 adapts applications for multiple device types (phone, tablet, foldable, 2-in-1, wearable, TV)
|
|
15229
|
+
`;
|
|
15230
|
+
}
|
|
15231
|
+
function createOne2ManyAgent() {
|
|
15232
|
+
const agent = {
|
|
15233
|
+
id: "harmonyos-one2many",
|
|
15234
|
+
name: "harmonyos-one2many",
|
|
15235
|
+
description: getHmOne2ManyDescription(),
|
|
15236
|
+
mode: "primary",
|
|
15237
|
+
prompt: buildHmAgentPrompt("one2many"),
|
|
15238
|
+
temperature: 0.3,
|
|
15239
|
+
permission: {
|
|
15240
|
+
"skillSearch": "deny"
|
|
15241
|
+
},
|
|
15242
|
+
metadata: void 0
|
|
15243
|
+
};
|
|
15244
|
+
return agent;
|
|
15245
|
+
}
|
|
15246
|
+
|
|
15225
15247
|
// src/agents/registry.ts
|
|
15226
15248
|
var AgentRegistry = class {
|
|
15227
15249
|
agents = /* @__PURE__ */ new Map();
|
|
@@ -15230,6 +15252,7 @@ var AgentRegistry = class {
|
|
|
15230
15252
|
this.register(createDesignAgent());
|
|
15231
15253
|
this.register(createHmDevelopmentAgent());
|
|
15232
15254
|
this.register(createAscfAgent());
|
|
15255
|
+
this.register(createOne2ManyAgent());
|
|
15233
15256
|
this.register(createHmExploreSubAgent());
|
|
15234
15257
|
}
|
|
15235
15258
|
register(agent) {
|
|
@@ -15365,43 +15388,8 @@ var AgentManager = class {
|
|
|
15365
15388
|
// src/shared/ets-counter.ts
|
|
15366
15389
|
import { readdir, readFile as readFile2, stat } from "fs/promises";
|
|
15367
15390
|
import { join as join2, extname } from "path";
|
|
15368
|
-
var SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
15369
|
-
"node_modules",
|
|
15370
|
-
".preview",
|
|
15371
|
-
"build",
|
|
15372
|
-
".cxx",
|
|
15373
|
-
".gradle",
|
|
15374
|
-
"oh_modules",
|
|
15375
|
-
".hvigor",
|
|
15376
|
-
"entry/build"
|
|
15377
|
-
]);
|
|
15378
|
-
async function collectEtsFiles(dir, results) {
|
|
15379
|
-
let entries;
|
|
15380
|
-
try {
|
|
15381
|
-
entries = await readdir(dir, { withFileTypes: true });
|
|
15382
|
-
} catch {
|
|
15383
|
-
return;
|
|
15384
|
-
}
|
|
15385
|
-
for (const entry of entries) {
|
|
15386
|
-
if (entry.isDirectory()) {
|
|
15387
|
-
if (SKIP_DIRS.has(entry.name)) continue;
|
|
15388
|
-
if (entry.name.startsWith(".") && entry.name !== ".ets") continue;
|
|
15389
|
-
await collectEtsFiles(join2(dir, entry.name), results);
|
|
15390
|
-
} else if (extname(entry.name) === ".ets") {
|
|
15391
|
-
const filePath = join2(dir, entry.name);
|
|
15392
|
-
try {
|
|
15393
|
-
const content = await readFile2(filePath, "utf-8");
|
|
15394
|
-
const lines = content.split("\n").length;
|
|
15395
|
-
results.push({ path: filePath, lines });
|
|
15396
|
-
} catch {
|
|
15397
|
-
log("Failed to read .ets file", { path: filePath });
|
|
15398
|
-
}
|
|
15399
|
-
}
|
|
15400
|
-
}
|
|
15401
|
-
}
|
|
15402
15391
|
async function countEtsLines(projectDir) {
|
|
15403
15392
|
const files = [];
|
|
15404
|
-
await collectEtsFiles(projectDir, files);
|
|
15405
15393
|
const totalLines = files.reduce((sum, f) => sum + f.lines, 0);
|
|
15406
15394
|
return {
|
|
15407
15395
|
fileCount: files.length,
|
|
@@ -15461,8 +15449,6 @@ function createConfigHandler(_pluginConfig, agent, projectDir) {
|
|
|
15461
15449
|
config3.agent[id] = pluginAgentConfig;
|
|
15462
15450
|
}
|
|
15463
15451
|
}
|
|
15464
|
-
config3.agent.build = { "disable": true };
|
|
15465
|
-
config3.agent.plan = { "disable": true };
|
|
15466
15452
|
config3.default_agent = "harmonyos-plugin";
|
|
15467
15453
|
}
|
|
15468
15454
|
config3.command = config3.command || {};
|
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.
|
|
4
|
+
"version": "0.0.6-beta",
|
|
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",
|