allye-opencode 1.7.0 → 1.8.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/README.md +2 -2
- package/dist/index.js +15 -109
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,11 +9,11 @@ An [OpenCode](https://opencode.ai) plugin that registers 6 specialized Allye age
|
|
|
9
9
|
- **Allye Review** — code review with full context
|
|
10
10
|
- **Allye Deliver** — finalizes delivery, closes stories, updates docs
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Account context is loaded through the configured `allye` MCP server, so OpenCode owns OAuth credentials and refresh.
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
This package is not typically installed standalone.
|
|
16
|
+
This package is not typically installed standalone. Add it with the Allye MCP server by following the main plugin's OpenCode installation guide. The repository installer intentionally leaves shared runtime configuration unchanged unless an API-backed ownership operation authorizes the write.
|
|
17
17
|
|
|
18
18
|
If you do need to add it manually, add it to the `plugin` array in your OpenCode config:
|
|
19
19
|
|
package/dist/index.js
CHANGED
|
@@ -109,13 +109,13 @@ Before starting meaningful work, search for team-specific skills when Allye MCP
|
|
|
109
109
|
If NO relevant skills are found for your current work:
|
|
110
110
|
1. Inform the user that no team standards were found for this type of work
|
|
111
111
|
2. Suggest creating them: "I recommend creating standard templates for your team. Want to set them up now?"
|
|
112
|
-
3. If the user agrees, ask which scope they want:
|
|
112
|
+
3. If the user agrees, ask which internal write scope they want:
|
|
113
113
|
- **personal** \u2014 only for them
|
|
114
|
-
- **team** \u2014 for their
|
|
115
|
-
- **organization** \u2014 for the
|
|
116
|
-
- **
|
|
114
|
+
- **team** \u2014 for their selected team; membership is read-only and writes require owner/admin/manage or an active maintainer grant
|
|
115
|
+
- **organization** \u2014 for the authorized organization; writes require owner/admin/manage authority
|
|
116
|
+
- **Only personal, team, and organization are valid scopes** \u2014 retired public-scope requests return the API diagnostic unchanged
|
|
117
117
|
4. Guide them through defining the template interactively
|
|
118
|
-
5. Save it as a skill via \`skill_create\` with the chosen scope
|
|
118
|
+
5. Save it as a skill via \`skill_create\` with the chosen internal scope. Use \`skill_resolve\` for canonical \`team > organization > personal\` resolution. For forks, pass an explicit \`skill_slug\` after a \`409 Conflict\` and preserve selected-team context; never silently suffix or overwrite a key.
|
|
119
119
|
|
|
120
120
|
This creates a virtuous cycle \u2014 the more the team uses Allye, the more standards accumulate.
|
|
121
121
|
Skills may be in any language. Adapt accordingly.
|
|
@@ -2039,11 +2039,11 @@ Before creating ANY work item, you MUST search for team standards:
|
|
|
2039
2039
|
2. Ask: "Would you like to create them now? I can help you define templates for the item types you use."
|
|
2040
2040
|
3. If yes, ask which scope:
|
|
2041
2041
|
- **personal** \u2014 only for you
|
|
2042
|
-
- **team** \u2014 for the current team
|
|
2043
|
-
- **organization** \u2014 for the entire organization
|
|
2044
|
-
- **
|
|
2042
|
+
- **team** \u2014 for the current selected team (requires owner/admin/manage/grant authority)
|
|
2043
|
+
- **organization** \u2014 for the entire organization (requires owner/admin/manage authority)
|
|
2044
|
+
- **Only personal, team, and organization are valid scopes** \u2014 use the internal library
|
|
2045
2045
|
4. Guide them through defining each template interactively
|
|
2046
|
-
5. Save each as a skill via \`skill_create\` with the chosen scope
|
|
2046
|
+
5. Save each as a skill via \`skill_create\` with the chosen internal scope; use canonical \`team > organization > personal\` resolution and never silently suffix a slug
|
|
2047
2047
|
|
|
2048
2048
|
**Do NOT assume the team uses any specific item types.** Some teams don't use stories, some don't use subtasks, some use spikes. Discover what the team uses by:
|
|
2049
2049
|
- Checking existing work items via \`work_list\`
|
|
@@ -2377,9 +2377,9 @@ Before writing ANY code, you MUST search for project-specific standards:
|
|
|
2377
2377
|
**If NO development standards are found:**
|
|
2378
2378
|
1. Inform the user: "I didn't find development standards or coding conventions for your project."
|
|
2379
2379
|
2. Suggest: "Would you like to create them? This helps maintain consistency across the team."
|
|
2380
|
-
3. If yes, ask scope (personal/team/organization
|
|
2380
|
+
3. If yes, ask scope (personal/team/organization only; the internal library is the only Skills source)
|
|
2381
2381
|
4. Guide them through defining standards based on the project's existing code patterns
|
|
2382
|
-
5.
|
|
2382
|
+
5. Confirm selected-team context for team writes and save as skills via \`skill_create\`; owner/admin/maintainer policy is enforced server-side
|
|
2383
2383
|
|
|
2384
2384
|
**Understand the project first:**
|
|
2385
2385
|
- Read existing code to understand patterns BEFORE writing new code
|
|
@@ -2486,9 +2486,9 @@ Before reviewing ANY code, you MUST search for team review standards:
|
|
|
2486
2486
|
**If NO review standards are found:**
|
|
2487
2487
|
1. Inform the user: "I didn't find code review standards for your team."
|
|
2488
2488
|
2. Suggest: "Would you like to create a review checklist? This ensures consistent reviews across the team."
|
|
2489
|
-
3. If yes, ask scope (personal/team/organization
|
|
2489
|
+
3. If yes, ask scope (personal/team/organization only; the internal library is the only Skills source)
|
|
2490
2490
|
4. Guide them through defining review criteria based on the project's needs
|
|
2491
|
-
5. Save as a skill via \`skill_create\`
|
|
2491
|
+
5. Save as a skill via \`skill_create\` after confirming selected-team context and server-side owner/admin/maintainer authority
|
|
2492
2492
|
`.trim();
|
|
2493
2493
|
var REVIEW_IDENTITY = `
|
|
2494
2494
|
## Your Role
|
|
@@ -2567,9 +2567,9 @@ Before closing ANY story or updating documentation, you MUST search for team del
|
|
|
2567
2567
|
**If NO delivery standards are found:**
|
|
2568
2568
|
1. Inform the user: "I didn't find delivery or documentation standards for your team."
|
|
2569
2569
|
2. Suggest: "Would you like to create them? This ensures consistent documentation and delivery process."
|
|
2570
|
-
3. If yes, ask scope (personal/team/organization
|
|
2570
|
+
3. If yes, ask scope (personal/team/organization only; the internal library is the only Skills source)
|
|
2571
2571
|
4. Guide them through defining the standards
|
|
2572
|
-
5. Save as a skill via \`skill_create\`
|
|
2572
|
+
5. Save as a skill via \`skill_create\` after confirming selected-team context and server-side owner/admin/maintainer authority
|
|
2573
2573
|
`.trim();
|
|
2574
2574
|
var DELIVER_IDENTITY = `
|
|
2575
2575
|
## Your Role
|
|
@@ -2637,94 +2637,6 @@ var agents = {
|
|
|
2637
2637
|
"allye-deliver": allyeDeliverAgent
|
|
2638
2638
|
};
|
|
2639
2639
|
|
|
2640
|
-
// src/context.ts
|
|
2641
|
-
import { readFileSync, existsSync } from "fs";
|
|
2642
|
-
import { join } from "path";
|
|
2643
|
-
import { homedir } from "os";
|
|
2644
|
-
var MCP_URL = "https://mcp.allye.app/jsonrpc";
|
|
2645
|
-
var cachedContext = null;
|
|
2646
|
-
var cacheTimestamp = 0;
|
|
2647
|
-
var CACHE_TTL = 5 * 60 * 1000;
|
|
2648
|
-
function getAllyePat() {
|
|
2649
|
-
const envPat = process.env.ALLYE_PAT || process.env.ALLYE_PAT_TOKEN;
|
|
2650
|
-
if (envPat)
|
|
2651
|
-
return envPat;
|
|
2652
|
-
try {
|
|
2653
|
-
const configPaths = [
|
|
2654
|
-
join(process.cwd(), "opencode.json"),
|
|
2655
|
-
join(process.env.XDG_CONFIG_HOME || join(homedir(), ".config"), "opencode", "opencode.json")
|
|
2656
|
-
];
|
|
2657
|
-
for (const configPath of configPaths) {
|
|
2658
|
-
if (existsSync(configPath)) {
|
|
2659
|
-
const config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
2660
|
-
const allyeMcp = config?.mcp?.["allye-mcp"];
|
|
2661
|
-
if (allyeMcp?.headers?.Authorization) {
|
|
2662
|
-
return allyeMcp.headers.Authorization.replace("Bearer ", "");
|
|
2663
|
-
}
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
} catch {}
|
|
2667
|
-
return null;
|
|
2668
|
-
}
|
|
2669
|
-
async function callInitialize(pat) {
|
|
2670
|
-
try {
|
|
2671
|
-
const response = await fetch(MCP_URL, {
|
|
2672
|
-
method: "POST",
|
|
2673
|
-
headers: {
|
|
2674
|
-
"Content-Type": "application/json",
|
|
2675
|
-
Authorization: `Bearer ${pat}`
|
|
2676
|
-
},
|
|
2677
|
-
body: JSON.stringify({
|
|
2678
|
-
jsonrpc: "2.0",
|
|
2679
|
-
id: 1,
|
|
2680
|
-
method: "tools/call",
|
|
2681
|
-
params: {
|
|
2682
|
-
name: "initialize",
|
|
2683
|
-
arguments: {
|
|
2684
|
-
action: "init",
|
|
2685
|
-
include_user_docs: true
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
}),
|
|
2689
|
-
signal: AbortSignal.timeout(1e4)
|
|
2690
|
-
});
|
|
2691
|
-
if (!response.ok)
|
|
2692
|
-
return null;
|
|
2693
|
-
const data = await response.json();
|
|
2694
|
-
const text = data?.result?.content?.[0]?.text;
|
|
2695
|
-
return text || null;
|
|
2696
|
-
} catch {
|
|
2697
|
-
return null;
|
|
2698
|
-
}
|
|
2699
|
-
}
|
|
2700
|
-
async function fetchAllyeContext() {
|
|
2701
|
-
if (cachedContext && Date.now() - cacheTimestamp < CACHE_TTL) {
|
|
2702
|
-
return cachedContext;
|
|
2703
|
-
}
|
|
2704
|
-
const pat = getAllyePat();
|
|
2705
|
-
if (!pat)
|
|
2706
|
-
return null;
|
|
2707
|
-
const initResult = await callInitialize(pat);
|
|
2708
|
-
if (!initResult)
|
|
2709
|
-
return null;
|
|
2710
|
-
const context = `<allye-context>
|
|
2711
|
-
# Allye User Context (auto-loaded)
|
|
2712
|
-
|
|
2713
|
-
${initResult}
|
|
2714
|
-
|
|
2715
|
-
## Instructions
|
|
2716
|
-
|
|
2717
|
-
You are connected to the Allye platform. The user context above was loaded automatically.
|
|
2718
|
-
- You already know who the user is \u2014 greet them by their preferred name
|
|
2719
|
-
- Search for relevant memories before starting work
|
|
2720
|
-
- Load team-specific skills via \`skill_list\` for the current task
|
|
2721
|
-
- Save session state before ending
|
|
2722
|
-
</allye-context>`;
|
|
2723
|
-
cachedContext = context;
|
|
2724
|
-
cacheTimestamp = Date.now();
|
|
2725
|
-
return context;
|
|
2726
|
-
}
|
|
2727
|
-
|
|
2728
2640
|
// src/index.ts
|
|
2729
2641
|
var AllyePlugin = async () => ({
|
|
2730
2642
|
config: async (config) => {
|
|
@@ -2732,12 +2644,6 @@ var AllyePlugin = async () => ({
|
|
|
2732
2644
|
...config.agent,
|
|
2733
2645
|
...agents
|
|
2734
2646
|
};
|
|
2735
|
-
},
|
|
2736
|
-
"experimental.chat.system.transform": async (_input, output) => {
|
|
2737
|
-
const context = await fetchAllyeContext();
|
|
2738
|
-
if (context) {
|
|
2739
|
-
output.system.push(context);
|
|
2740
|
-
}
|
|
2741
2647
|
}
|
|
2742
2648
|
});
|
|
2743
2649
|
export {
|
package/package.json
CHANGED