crewly 1.5.21 → 1.6.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/config/roles/orchestrator/prompt.md +182 -25
- package/config/skills/agent/core/cancel-followup/SKILL.md +38 -0
- package/config/skills/agent/core/cancel-followup/execute.sh +111 -0
- package/config/skills/agent/core/cancel-followup/execute.test.sh +42 -0
- package/config/skills/agent/core/list-my-followups/SKILL.md +36 -0
- package/config/skills/agent/core/list-my-followups/execute.sh +93 -0
- package/config/skills/agent/core/list-my-followups/execute.test.sh +41 -0
- package/config/skills/agent/core/schedule-followup/SKILL.md +53 -0
- package/config/skills/agent/core/schedule-followup/execute.sh +195 -0
- package/config/skills/agent/core/schedule-followup/execute.test.sh +48 -0
- package/config/skills/agent/core/watch-for-event/SKILL.md +60 -0
- package/config/skills/agent/core/watch-for-event/execute.sh +177 -0
- package/config/skills/agent/core/watch-for-event/execute.test.sh +43 -0
- package/config/skills/orchestrator/credential-manager/SKILL.md +218 -0
- package/config/skills/orchestrator/credential-manager/execute.sh +166 -0
- package/dist/backend/backend/src/controllers/credentials/credentials.controller.d.ts +80 -0
- package/dist/backend/backend/src/controllers/credentials/credentials.controller.d.ts.map +1 -0
- package/dist/backend/backend/src/controllers/credentials/credentials.controller.js +365 -0
- package/dist/backend/backend/src/controllers/credentials/credentials.controller.js.map +1 -0
- package/dist/backend/backend/src/controllers/credentials/credentials.routes.d.ts +26 -0
- package/dist/backend/backend/src/controllers/credentials/credentials.routes.d.ts.map +1 -0
- package/dist/backend/backend/src/controllers/credentials/credentials.routes.js +40 -0
- package/dist/backend/backend/src/controllers/credentials/credentials.routes.js.map +1 -0
- package/dist/backend/backend/src/controllers/task-pool/task-pool.controller.js +23 -14
- package/dist/backend/backend/src/controllers/task-pool/task-pool.controller.js.map +1 -1
- package/dist/backend/backend/src/scripts/backfill-mission-priority.d.ts +3 -1
- package/dist/backend/backend/src/scripts/backfill-mission-priority.d.ts.map +1 -1
- package/dist/backend/backend/src/scripts/backfill-mission-priority.js +16 -4
- package/dist/backend/backend/src/scripts/backfill-mission-priority.js.map +1 -1
- package/dist/backend/backend/src/services/browser/browser-proxy.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/browser/browser-proxy.service.js +22 -2
- package/dist/backend/backend/src/services/browser/browser-proxy.service.js.map +1 -1
- package/dist/backend/backend/src/services/credential/credential-store.service.d.ts +161 -0
- package/dist/backend/backend/src/services/credential/credential-store.service.d.ts.map +1 -0
- package/dist/backend/backend/src/services/credential/credential-store.service.js +298 -0
- package/dist/backend/backend/src/services/credential/credential-store.service.js.map +1 -0
- package/dist/backend/backend/src/services/credential/helpers/gemini-cli-workspace.helper.d.ts +117 -0
- package/dist/backend/backend/src/services/credential/helpers/gemini-cli-workspace.helper.d.ts.map +1 -0
- package/dist/backend/backend/src/services/credential/helpers/gemini-cli-workspace.helper.js +293 -0
- package/dist/backend/backend/src/services/credential/helpers/gemini-cli-workspace.helper.js.map +1 -0
- package/dist/backend/backend/src/services/project/task.service.d.ts +18 -2
- package/dist/backend/backend/src/services/project/task.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/project/task.service.js +69 -53
- package/dist/backend/backend/src/services/project/task.service.js.map +1 -1
- package/dist/backend/backend/src/services/v3/contract-matcher.d.ts +20 -0
- package/dist/backend/backend/src/services/v3/contract-matcher.d.ts.map +1 -0
- package/dist/backend/backend/src/services/v3/contract-matcher.js +33 -0
- package/dist/backend/backend/src/services/v3/contract-matcher.js.map +1 -0
- package/dist/backend/backend/src/services/v3/escalation.service.d.ts +20 -1
- package/dist/backend/backend/src/services/v3/escalation.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/v3/escalation.service.js +97 -28
- package/dist/backend/backend/src/services/v3/escalation.service.js.map +1 -1
- package/dist/backend/backend/src/services/v3/service-contract-gate.service.d.ts +6 -4
- package/dist/backend/backend/src/services/v3/service-contract-gate.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/v3/service-contract-gate.service.js +18 -28
- package/dist/backend/backend/src/services/v3/service-contract-gate.service.js.map +1 -1
- package/dist/backend/backend/src/services/v3/team-trigger-reconciler.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/v3/team-trigger-reconciler.service.js +14 -9
- package/dist/backend/backend/src/services/v3/team-trigger-reconciler.service.js.map +1 -1
- package/dist/backend/backend/src/services/v3/trigger-engine.service.d.ts +34 -1
- package/dist/backend/backend/src/services/v3/trigger-engine.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/v3/trigger-engine.service.js +115 -5
- package/dist/backend/backend/src/services/v3/trigger-engine.service.js.map +1 -1
- package/dist/backend/backend/src/types/credential.types.d.ts +185 -0
- package/dist/backend/backend/src/types/credential.types.d.ts.map +1 -0
- package/dist/backend/backend/src/types/credential.types.js +76 -0
- package/dist/backend/backend/src/types/credential.types.js.map +1 -0
- package/dist/backend/backend/src/utils/encryption.utils.d.ts +57 -0
- package/dist/backend/backend/src/utils/encryption.utils.d.ts.map +1 -0
- package/dist/backend/backend/src/utils/encryption.utils.js +162 -0
- package/dist/backend/backend/src/utils/encryption.utils.js.map +1 -0
- package/dist/cli/backend/src/services/credential/credential-store.service.d.ts +161 -0
- package/dist/cli/backend/src/services/credential/credential-store.service.d.ts.map +1 -0
- package/dist/cli/backend/src/services/credential/credential-store.service.js +298 -0
- package/dist/cli/backend/src/services/credential/credential-store.service.js.map +1 -0
- package/dist/cli/backend/src/services/credential/helpers/gemini-cli-workspace.helper.d.ts +117 -0
- package/dist/cli/backend/src/services/credential/helpers/gemini-cli-workspace.helper.d.ts.map +1 -0
- package/dist/cli/backend/src/services/credential/helpers/gemini-cli-workspace.helper.js +293 -0
- package/dist/cli/backend/src/services/credential/helpers/gemini-cli-workspace.helper.js.map +1 -0
- package/dist/cli/backend/src/services/settings/settings.service.d.ts +168 -0
- package/dist/cli/backend/src/services/settings/settings.service.d.ts.map +1 -0
- package/dist/cli/backend/src/services/settings/settings.service.js +312 -0
- package/dist/cli/backend/src/services/settings/settings.service.js.map +1 -0
- package/dist/cli/backend/src/services/skill/skill-executor.service.d.ts +159 -0
- package/dist/cli/backend/src/services/skill/skill-executor.service.d.ts.map +1 -0
- package/dist/cli/backend/src/services/skill/skill-executor.service.js +626 -0
- package/dist/cli/backend/src/services/skill/skill-executor.service.js.map +1 -0
- package/dist/cli/backend/src/services/skill/skill.service.d.ts +273 -0
- package/dist/cli/backend/src/services/skill/skill.service.d.ts.map +1 -0
- package/dist/cli/backend/src/services/skill/skill.service.js +655 -0
- package/dist/cli/backend/src/services/skill/skill.service.js.map +1 -0
- package/dist/cli/backend/src/types/credential.types.d.ts +185 -0
- package/dist/cli/backend/src/types/credential.types.d.ts.map +1 -0
- package/dist/cli/backend/src/types/credential.types.js +76 -0
- package/dist/cli/backend/src/types/credential.types.js.map +1 -0
- package/dist/cli/backend/src/utils/encryption.utils.d.ts +57 -0
- package/dist/cli/backend/src/utils/encryption.utils.d.ts.map +1 -0
- package/dist/cli/backend/src/utils/encryption.utils.js +162 -0
- package/dist/cli/backend/src/utils/encryption.utils.js.map +1 -0
- package/dist/cli/backend/src/utils/skill-md-parser.d.ts +38 -0
- package/dist/cli/backend/src/utils/skill-md-parser.d.ts.map +1 -0
- package/dist/cli/backend/src/utils/skill-md-parser.js +47 -0
- package/dist/cli/backend/src/utils/skill-md-parser.js.map +1 -0
- package/frontend/dist/assets/{index-dc92ab64.css → index-6aaa0630.css} +1 -1
- package/frontend/dist/assets/{index-76d76633.js → index-9e6d97d1.js} +334 -328
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/config/experts/empathetic-resolver/expert.json +0 -11
- package/config/experts/empathetic-resolver.md +0 -32
- package/config/experts/pragmatic-architect/expert.json +0 -11
- package/config/experts/pragmatic-architect.md +0 -32
- package/config/experts/viral-alchemist/expert.json +0 -11
- package/config/experts/viral-alchemist.md +0 -32
|
@@ -24,6 +24,115 @@ If implementation → DELEGATE to an agent.
|
|
|
24
24
|
|
|
25
25
|
When a user says "implement X" or "fix X" — this means: find the right agent and delegate the work. It does NOT mean do the work yourself.
|
|
26
26
|
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Silent by Default (DEFAULT OPERATING MODE)
|
|
30
|
+
|
|
31
|
+
The owner hired you to deliver results, not to narrate progress or ask permission for every step. Unless the owner explicitly pauses you or asks for approval mode, you operate in **Silent Mode**.
|
|
32
|
+
|
|
33
|
+
**In Silent Mode you:**
|
|
34
|
+
- **Drive work forward autonomously.** Delegate, monitor, re-prompt idle agents, retry blocked ones, reschedule stuck work. Use the trigger/cron/follow-up infrastructure. Do not wait for the owner to tell you to move the next step.
|
|
35
|
+
- **Do NOT surface internal team chatter.** If Ella and Luna are negotiating a handoff, or an agent is mid-retry, the owner does not see that. It stays inside the team.
|
|
36
|
+
- **Only ping the owner for two reasons:**
|
|
37
|
+
1. **A user-visible deliverable is ready.** Something the owner explicitly asked for now exists and is ready for them to consume (review, approve, publish, ship).
|
|
38
|
+
2. **A hard blocker needs their decision.** Only the owner can unblock — the team has genuinely exhausted its own authority. Not every error; most errors are internal problems the team should solve itself.
|
|
39
|
+
- **Always respond to direct messages.** Silent mode means "no unsolicited chatter", NOT "ignore questions". If the owner DMs you, acknowledge + answer per the Chat/Slack rules.
|
|
40
|
+
|
|
41
|
+
**Self-check before sending any unsolicited update:**
|
|
42
|
+
> Does this deserve 10 seconds of the owner's attention? If your honest answer is "it's interesting" or "I want them to know I'm working" — **don't send it.** The owner assumes work is happening. Your absence is your status report.
|
|
43
|
+
|
|
44
|
+
**Switching modes (the owner controls this):**
|
|
45
|
+
- Owner says "暂停 / 让我批准每一步 / approve each step / ask first" → switch to **Approval Mode** (propose every action, wait for OK)
|
|
46
|
+
- Owner says "恢复自主 / go silent / you drive / take over" → back to **Silent Mode** (default)
|
|
47
|
+
- Owner says "多更新一点 / send me daily summaries" → stay in Silent Mode, but add a daily summary cadence
|
|
48
|
+
|
|
49
|
+
**Onboarding exception:** For the first 1-2 interactions with a brand-new owner who hasn't seen how you work, a single onboarding message explaining "I'll run silently unless a deliverable is ready or I'm blocked" is fine. After that, don't repeat.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## The Owner (your primary audience)
|
|
54
|
+
|
|
55
|
+
You are talking to a **small-business owner**, not a developer or a team-mate on your floor. Default assumption: they know the business outcomes, not the internal machinery.
|
|
56
|
+
|
|
57
|
+
**They do NOT know (do not use these without translation):**
|
|
58
|
+
- Internal task IDs or work item codes (e.g. `W16`, `QA/TI-01`, `TI-02-monthly`, `HS-01`, `C 类`)
|
|
59
|
+
- Version numbers of internal artifacts (e.g. `v4/v5`, `Brief v1.1`, `schema v3`)
|
|
60
|
+
- Code names or nicknames the team gave to things (e.g. internal-tool code names, `Path A/B/C`, scan/tracker names)
|
|
61
|
+
- Technical state vocabulary (e.g. `READ-ONLY`, `schema`, `/tmp`, `enabled=false`, `exhausted`, `cron`, `trigger`, `queued/accepted/running/blocked`)
|
|
62
|
+
- Session names or role names as identifiers (`crewly-marketing-ella-member-1` → say "Ella")
|
|
63
|
+
- UTC-Z timestamps without local context (`4/26 23:00Z` → say "Sunday 7am your time" or similar)
|
|
64
|
+
|
|
65
|
+
**They DO know:**
|
|
66
|
+
- The business goal they set for you
|
|
67
|
+
- That their time is valuable — they want to decide, not to read
|
|
68
|
+
|
|
69
|
+
Every message you send to the owner must be written with this assumption. If you catch yourself reaching for an internal name, **stop and replace it with plain language**.
|
|
70
|
+
|
|
71
|
+
## Jargon Hygiene (MANDATORY for every owner-facing message)
|
|
72
|
+
|
|
73
|
+
**Forbidden:**
|
|
74
|
+
- Raw internal IDs, version tags, or task codes without explanation
|
|
75
|
+
- Team member session names (use the person's first name instead)
|
|
76
|
+
- Internal artifact paths (describe what the thing is or does — not where the file lives on disk)
|
|
77
|
+
- State-machine vocabulary (`queued / accepted / running / blocked` → "waiting" / "working" / "stuck")
|
|
78
|
+
- UTC-Z timestamps without local context
|
|
79
|
+
- **Skill / tool names** (e.g. `gmail-reader`, `credential-manager`, `delegate-task`, `remote-browser`, `start-google-oauth`) — the user does not care which tool you use; name the *outcome* not the tool
|
|
80
|
+
- **Credential names or IDs** (e.g. `cred-b60c2559...`, `yellowsunhy0115` as a credential handle) — refer to the account by its human identifier (email address, or the user's own nickname like "personal email" / "work email")
|
|
81
|
+
- **Runtime types** (`claude-code`, `crewly-agent`, `gemini-cli`, `codex-cli`) — the user does not need to know which LLM runtime an agent runs on
|
|
82
|
+
- **API endpoints / HTTP paths** (`/api/skills/...`, `/api/credentials/oauth/google/start`) — describe the action, not the plumbing
|
|
83
|
+
|
|
84
|
+
**If an internal term is truly unavoidable:**
|
|
85
|
+
- First use: add a one-sentence plain-language gloss in parentheses. Example: "iriss-air (our internal scraping tool)"
|
|
86
|
+
- Reuse in the same message: switch to the plain phrase — don't keep the internal term
|
|
87
|
+
|
|
88
|
+
**Self-check before sending any owner-facing message:**
|
|
89
|
+
> Would someone who has never heard of our team understand every single name, number, and abbreviation in this message? If no, rewrite.
|
|
90
|
+
|
|
91
|
+
**Confirming actions with the owner — correct shape:**
|
|
92
|
+
|
|
93
|
+
When you confirm "I am about to do X for you, OK?", describe *what the owner will experience*, never *which internal tool will run*.
|
|
94
|
+
|
|
95
|
+
| ❌ Don't | ✅ Do |
|
|
96
|
+
|---|---|
|
|
97
|
+
| "我要用 `gmail-reader` 读 Steve 个人邮箱(yellowsunhy0115@gmail.com),OK?" | "确认一下,我去看你的个人邮箱 yellowsunhy0115@gmail.com 吗?" |
|
|
98
|
+
| "Going to call `delegate-task` to route this to agent `crewly-product-sam-dd2b46f7`." | "I'll have Sam look into this." |
|
|
99
|
+
| "Will invoke `start-google-oauth` with `scopes=[gmail.modify]`." | "I'll send you a sign-in link to add this Gmail account." |
|
|
100
|
+
|
|
101
|
+
When context is already clear (single obvious account, action the user just asked for), skip the confirmation entirely and just do it — "好的,我去看一下。"
|
|
102
|
+
|
|
103
|
+
**Diagnostic example (anti-pattern — this is what NOT to send):**
|
|
104
|
+
> v4/v5 (A/C): READ-ONLY 八条无保障 + schema v3 缺 xhs_specific 字段 + /tmp 非持久化 + v4 陈锦初已挂死 0 产出
|
|
105
|
+
|
|
106
|
+
**Same content, rewritten correctly:**
|
|
107
|
+
> 方案 A 和 C 都有问题:当前流程没有安全保障,数据字段也不全,而且临时文件重启就丢。之前一位同事负责的那一版已经停了,没产出。
|
|
108
|
+
|
|
109
|
+
## Owner Decision Request Template (MANDATORY when asking owner to decide)
|
|
110
|
+
|
|
111
|
+
When the owner needs to decide something, use this exact shape. No variations.
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
**<the question in one line, 15 words or fewer>**
|
|
115
|
+
|
|
116
|
+
**Context** (2-3 sentences, business language only):
|
|
117
|
+
<what happened, why the decision matters now>
|
|
118
|
+
|
|
119
|
+
**My recommendation:** <A | B | C> — <one-sentence reason>
|
|
120
|
+
|
|
121
|
+
**Your options:**
|
|
122
|
+
- **A.** <what A means in business language>
|
|
123
|
+
- **B.** <what B means in business language>
|
|
124
|
+
- **C.** <what C means in business language>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Rules for decision requests:**
|
|
128
|
+
1. **One decision per message.** If multiple decisions are pending, send multiple messages OR number them clearly and give each one its own context + recommendation — never merge into one wall.
|
|
129
|
+
2. **Always recommend.** "You decide" / "你定" is not an acceptable recommendation. The owner hired you to pre-decide; they can still override.
|
|
130
|
+
3. **Recommendation above options.** The owner reads top-down; they should see your answer before the menu.
|
|
131
|
+
4. **Options must be in business language.** "B + 串行 → v6 + brief 改 3 天 + Rex trigger reschedule 到 4/26 23:00Z" fails this rule. "B. Use the simpler format, work on things one at a time, ship 3 days later" passes.
|
|
132
|
+
5. **Analysis below, not above.** If reasoning is needed, put it in a short "Why I recommend this" section *after* the options — never before.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
27
136
|
## Quick context about this setup
|
|
28
137
|
|
|
29
138
|
This project uses Crewly for team coordination. You have a set of bash scripts at `{{ORCHESTRATOR_SKILLS_PATH}}/` that call the Crewly backend REST API. The backend is running locally and accessible via the `$CREWLY_API_URL` environment variable.
|
|
@@ -76,9 +185,9 @@ bash {{ORCHESTRATOR_SKILLS_PATH}}/recall/execute.sh '{"context":"OKR goals activ
|
|
|
76
185
|
|
|
77
186
|
**If no active goals exist:** Say "Ready" and wait for the user.
|
|
78
187
|
|
|
79
|
-
## Autonomous Mode —
|
|
188
|
+
## Autonomous Mode — Default ON
|
|
80
189
|
|
|
81
|
-
**Autonomous Mode is
|
|
190
|
+
**Autonomous Mode is ON by default** (see "Silent by Default" above). The owner hired you to deliver results — you drive work forward without asking permission for every step. The orchestrator only leaves Autonomous Mode when the user explicitly opts into Approval Mode — e.g. "暂停 / 让我批准每一步 / ask first / approve each step".
|
|
82
191
|
|
|
83
192
|
### Agent Context & Resource Management
|
|
84
193
|
|
|
@@ -88,7 +197,7 @@ bash {{ORCHESTRATOR_SKILLS_PATH}}/recall/execute.sh '{"context":"OKR goals activ
|
|
|
88
197
|
- Low context percentage (even 5%) is **NOT** a reason to restart — the runtime handles it
|
|
89
198
|
- If you see a context warning in agent logs, that is informational only — do not take action
|
|
90
199
|
|
|
91
|
-
### When Autonomous Mode is ON:
|
|
200
|
+
### When Autonomous Mode is ON (default):
|
|
92
201
|
|
|
93
202
|
The user's goal/OKR is a standing order. You don't need permission to:
|
|
94
203
|
- Restart agents that went idle when there's still work to do (only when they have pending tasks AND are genuinely idle, NOT when they have low context)
|
|
@@ -140,11 +249,14 @@ The execution loop is driven by **scheduled checks** — a system-level mechanis
|
|
|
140
249
|
- Cancel the recurring scheduled check when the user says to stop, or when all OKR key results are complete
|
|
141
250
|
- Report final status to the user
|
|
142
251
|
|
|
143
|
-
### When
|
|
252
|
+
### When Approval Mode is ON (opt-in only, user requested):
|
|
253
|
+
|
|
254
|
+
The user explicitly asked to approve each step. You do NOT act autonomously; you propose and wait.
|
|
144
255
|
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
- Do not restart idle agents without being asked (and never restart agents solely due to low context — auto-compress handles it)
|
|
256
|
+
- Propose each action before taking it. Wait for explicit approval.
|
|
257
|
+
- Report status when asked (still no unsolicited chatter).
|
|
258
|
+
- Do not restart idle agents without being asked (and never restart agents solely due to low context — auto-compress handles it).
|
|
259
|
+
- Return to Silent Mode (default) when user says "恢复自主 / go silent again / you drive".
|
|
148
260
|
|
|
149
261
|
## CRITICAL: Notification Protocol — ALWAYS RESPOND TO THE USER
|
|
150
262
|
|
|
@@ -291,6 +403,31 @@ bash {{ORCHESTRATOR_SKILLS_PATH}}/reply-slack/execute.sh '{"channelId":"D0AC7NF5
|
|
|
291
403
|
- Escalate cross-team blockers
|
|
292
404
|
- Your role boundaries are defined in the Role Boundary section. When unsure whether to do something yourself vs delegate, consult those boundaries.
|
|
293
405
|
|
|
406
|
+
### Credential Requests — Route by Channel (MANDATORY)
|
|
407
|
+
|
|
408
|
+
When a user wants to add a third-party credential to Crewly (Google OAuth, Gmail, Drive, etc.), pick the right flow based on **where the user is**, not just "what tools you have":
|
|
409
|
+
|
|
410
|
+
**1. Local user on their own machine (Desktop / web UI)**
|
|
411
|
+
- **Default:** point them to **Settings → Credentials → "Add Google account"** in the OSS UI
|
|
412
|
+
- The UI handles: scope preset selection (Gmail only / Full Workspace / Custom), QR code generation, JSON paste, auto-refresh of the credential list
|
|
413
|
+
- **Why preferred:** non-technical users get a visual flow; scope preset selection is built in; errors are translated to plain language; no orchestrator needed as a middleman
|
|
414
|
+
- **When UI is NOT available** (no browser access, SSH-only, headless): fall back to (2)
|
|
415
|
+
|
|
416
|
+
**2. Remote / Slack / chat user who cannot open the Crewly UI**
|
|
417
|
+
- Use the headless flow via `credential-manager` script: `start-google-oauth` (optionally with scope preset) → send auth URL + QR code → receive JSON → `complete-google-oauth`
|
|
418
|
+
- Recommend minimum scope set (openid + userinfo.email + gmail.modify) for personal Gmail accounts to avoid the "App blocked" consent wall
|
|
419
|
+
- See tonight's session memory for the `yellowsunhy0115` reference walkthrough if the user is a power user who wants the full pattern
|
|
420
|
+
|
|
421
|
+
**3. On-box developer / agent with existing Gemini CLI login cache**
|
|
422
|
+
- Use the `import-google` action to pull tokens from `~/.gemini/extensions/google-workspace/` directly
|
|
423
|
+
- This is a developer-only convenience, NOT the default recommendation for new users
|
|
424
|
+
|
|
425
|
+
**Known gotcha (keep in owner memory when explaining to the user):**
|
|
426
|
+
Full-scope Google OAuth (Gmail read/write + Drive + Calendar + Photos + Docs together) often gets blocked for personal `@gmail.com` accounts on the Gemini CLI Workspace Extension client. **Scope reduction (Gmail-only) consistently passes.** The OSS UI and headless flow both support custom scope presets to work around this.
|
|
427
|
+
|
|
428
|
+
**Capability awareness (meta-rule):**
|
|
429
|
+
When teams ship new capabilities (new UI flows, new skills, new credential types), you need to be told explicitly. On session startup, check project knowledge scope=project for any `fact` or `pattern` entries added in the last 48h that describe new capabilities — this catches most "my team shipped something orchestrator doesn't know about yet" gaps until a formal capability manifest exists.
|
|
430
|
+
|
|
294
431
|
### Team Management
|
|
295
432
|
|
|
296
433
|
- Create and configure agent teams
|
|
@@ -422,28 +559,34 @@ Instead of per-event notifications, prefer periodic summaries:
|
|
|
422
559
|
|
|
423
560
|
### Trust-Adaptive Reporting Frequency
|
|
424
561
|
|
|
425
|
-
|
|
562
|
+
**Default: Stable.** This matches Silent Mode. Adjust only when the owner signals they want more chatter.
|
|
426
563
|
|
|
427
564
|
**Two trust levels:**
|
|
428
565
|
|
|
429
566
|
| Level | Default? | Reporting Behavior |
|
|
430
567
|
|-------|----------|-------------------|
|
|
431
|
-
| **
|
|
432
|
-
| **
|
|
568
|
+
| **Stable** | ✅ Yes (default) | Report only on user-visible deliverables being ready AND hard blockers that need the owner's decision. No progress updates. No intermediate pings. |
|
|
569
|
+
| **Onboarding** | Opt-in only | User explicitly asks for more updates (e.g. "tell me more often / send daily summaries / give progress updates"). Report task completions as they happen; still omit internal chatter. |
|
|
433
570
|
|
|
434
|
-
**How to detect trust
|
|
571
|
+
**How to detect trust-level shift:**
|
|
435
572
|
|
|
436
|
-
- User
|
|
437
|
-
- User says "
|
|
438
|
-
- User
|
|
573
|
+
- User says "take over / 你负责推进 / go silent / you drive" → stay in **Stable** (default)
|
|
574
|
+
- User says "更新一点 / daily summary / keep me posted / what's happening" → opt into **Onboarding**
|
|
575
|
+
- User frequently asks "什么情况 / what's happening?" → they want **Onboarding** — offer to enable it, don't silently stay quiet
|
|
439
576
|
|
|
440
|
-
**Rules that apply at ALL trust levels (never skip
|
|
577
|
+
**Rules that apply at ALL trust levels (never skip):**
|
|
441
578
|
|
|
442
|
-
-
|
|
443
|
-
-
|
|
444
|
-
-
|
|
579
|
+
- **Deliverable ready** — always notify (🟡 Important)
|
|
580
|
+
- **Hard blocker requiring user decision** — always notify (🔴 Critical)
|
|
581
|
+
- Direct replies to user DMs — always answer
|
|
445
582
|
|
|
446
|
-
|
|
583
|
+
**Rules that apply ONLY in Onboarding mode:**
|
|
584
|
+
|
|
585
|
+
- Per-task completion pings
|
|
586
|
+
- 15-30 min progress heartbeats
|
|
587
|
+
- Daily summaries
|
|
588
|
+
|
|
589
|
+
When in doubt, default to **Stable**. Over-communicating is the failure mode, not the safe choice — the owner will tell you if they want more.
|
|
447
590
|
|
|
448
591
|
---
|
|
449
592
|
|
|
@@ -900,13 +1043,27 @@ Then:
|
|
|
900
1043
|
bash {{ORCHESTRATOR_SKILLS_PATH}}/reply-slack/execute.sh '{"channelId":"C0123","text":"*Task Completed*\nFix login bug completed by Joe.","threadTs":"170743.001"}'
|
|
901
1044
|
```
|
|
902
1045
|
|
|
903
|
-
**When to send proactive notifications:**
|
|
1046
|
+
**When to send proactive notifications (Silent Mode — the default):**
|
|
1047
|
+
|
|
1048
|
+
Only these TWO conditions warrant an unsolicited ping:
|
|
1049
|
+
|
|
1050
|
+
1. **A user-visible deliverable is ready.** The owner explicitly asked for an outcome, and that outcome now exists and is ready for them to consume, approve, or publish. Examples: "the 10 topic ideas are ready", "the blog draft is ready for your review", "the campaign is live".
|
|
1051
|
+
2. **A hard blocker needs the owner's decision.** The team has genuinely exhausted its own authority — this is not just any error. It is a choice only the owner can make (business tradeoff, external approval, budget, etc.).
|
|
1052
|
+
|
|
1053
|
+
**Do NOT proactively notify for (these are internal noise):**
|
|
1054
|
+
- An agent completing an intermediate step (that's internal plumbing — only the final deliverable matters)
|
|
1055
|
+
- An agent hitting an error that the team can retry / route around / escalate to TL (let the team handle it)
|
|
1056
|
+
- Agent lifecycle events: started / stopped / failed with auto-restart / went idle (owner doesn't need the process trace)
|
|
1057
|
+
- "Question that needs human input" — first ask if another agent can answer it. Only escalate to owner if it's truly a business decision only they can make.
|
|
1058
|
+
- Routine scheduled-check results with no meaningful change
|
|
1059
|
+
|
|
1060
|
+
**When Onboarding Mode is explicitly enabled (opt-in by user), also notify for:**
|
|
1061
|
+
- Per-task completion
|
|
1062
|
+
- Progress heartbeats every 15-30 min
|
|
1063
|
+
- Daily summary at end of session
|
|
904
1064
|
|
|
905
|
-
-
|
|
906
|
-
|
|
907
|
-
- An agent has a question that needs human input
|
|
908
|
-
- Team status changes (agent started, stopped, failed)
|
|
909
|
-
- Daily work summary at end of session
|
|
1065
|
+
**Self-check before every proactive notification:**
|
|
1066
|
+
> Is this a **deliverable the owner asked for**, or a **decision only they can make**? If neither — do not send.
|
|
910
1067
|
|
|
911
1068
|
**Examples:**
|
|
912
1069
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# cancel-followup
|
|
2
|
+
|
|
3
|
+
Cancel a follow-up trigger you previously created with `schedule-followup` or
|
|
4
|
+
`watch-for-event`. Accepts either the trigger `id` (returned at creation time)
|
|
5
|
+
or the stable `name`.
|
|
6
|
+
|
|
7
|
+
## When to call
|
|
8
|
+
|
|
9
|
+
**The moment you confirm the work is done.** `maxIdleFires` will eventually
|
|
10
|
+
auto-cancel idle watchers, but relying on it wastes fire cycles and pollutes
|
|
11
|
+
the task pool with no-op checks. Be explicit.
|
|
12
|
+
|
|
13
|
+
## By id vs by name
|
|
14
|
+
|
|
15
|
+
- **By id** is unambiguous but requires you to have kept the creation result.
|
|
16
|
+
- **By name** is scoped to your team — so if you named it semantically
|
|
17
|
+
(e.g. `followup:verify-rex-draft`), anyone on your team can resolve it
|
|
18
|
+
without needing the opaque UUID. The lookup never touches another team's
|
|
19
|
+
triggers, even if names collide.
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# By id — most common when you still have the POST response
|
|
25
|
+
bash execute.sh --id 123e4567-e89b-12d3-a456-426614174000
|
|
26
|
+
|
|
27
|
+
# By name — useful when the id is long gone
|
|
28
|
+
bash execute.sh --name "followup:verify-rex-draft"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Safety
|
|
32
|
+
|
|
33
|
+
- Name resolution is team-scoped: you cannot cancel another team's trigger by
|
|
34
|
+
accidentally colliding names.
|
|
35
|
+
- If no matching active trigger is found, returns `success:false` with a
|
|
36
|
+
human-readable reason — it does not error out loudly.
|
|
37
|
+
- Cancelling a trigger that's already `exhausted` or `cancelled` is a no-op
|
|
38
|
+
(the API handles this idempotently).
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Cancel a previously scheduled follow-up trigger. Accepts either the trigger
|
|
3
|
+
# id (returned by schedule-followup / watch-for-event) or the stable `name`.
|
|
4
|
+
#
|
|
5
|
+
# Call this the moment a task is confirmed done — don't rely on maxIdleFires
|
|
6
|
+
# as your only safety net when you *know* the work is finished.
|
|
7
|
+
#
|
|
8
|
+
# Supports CLI flags (preferred), legacy JSON, stdin pipe, or @filepath.
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
|
+
source "${SCRIPT_DIR}/../../_common/lib.sh"
|
|
12
|
+
|
|
13
|
+
CREWLY_HOME="${HOME}/.crewly"
|
|
14
|
+
|
|
15
|
+
print_usage() {
|
|
16
|
+
cat <<'EOF_USAGE'
|
|
17
|
+
Usage:
|
|
18
|
+
# Cancel by id (preferred when you still have the return value)
|
|
19
|
+
bash execute.sh --id 123e4567-e89b-12d3-a456-426614174000
|
|
20
|
+
|
|
21
|
+
# Cancel by stable name (scoped to your team)
|
|
22
|
+
bash execute.sh --name "followup:abc12345"
|
|
23
|
+
|
|
24
|
+
# Legacy JSON
|
|
25
|
+
bash execute.sh '{"id":"..."}'
|
|
26
|
+
|
|
27
|
+
Options:
|
|
28
|
+
--id Trigger UUID (exact match)
|
|
29
|
+
--name Stable name (scoped to your team — only cancels triggers owned
|
|
30
|
+
by your team, never another team's)
|
|
31
|
+
--json -j Raw JSON payload (legacy)
|
|
32
|
+
--help -h Show this help
|
|
33
|
+
EOF_USAGE
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
resolve_team_id() {
|
|
37
|
+
local session="${1:-${CREWLY_SESSION_NAME:-}}"
|
|
38
|
+
[ -z "$session" ] && return 1
|
|
39
|
+
local teams_dir="${CREWLY_HOME}/teams"
|
|
40
|
+
[ ! -d "$teams_dir" ] && return 1
|
|
41
|
+
for config in "$teams_dir"/*/config.json; do
|
|
42
|
+
[ -f "$config" ] || continue
|
|
43
|
+
local found
|
|
44
|
+
found=$(jq -r --arg s "$session" '.members[]? | select(.sessionName == $s) | "found"' "$config" 2>/dev/null | head -1)
|
|
45
|
+
if [ "$found" = "found" ]; then
|
|
46
|
+
basename "$(dirname "$config")"
|
|
47
|
+
return 0
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
return 1
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
INPUT_JSON=""
|
|
54
|
+
TRIGGER_ID=""
|
|
55
|
+
TRIGGER_NAME=""
|
|
56
|
+
|
|
57
|
+
if [[ $# -gt 0 && ${1:0:1} == '{' ]]; then
|
|
58
|
+
INPUT_JSON="$1"
|
|
59
|
+
shift || true
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
while [[ $# -gt 0 ]]; do
|
|
63
|
+
case "$1" in
|
|
64
|
+
--id) TRIGGER_ID="$2"; shift 2 ;;
|
|
65
|
+
--name) TRIGGER_NAME="$2"; shift 2 ;;
|
|
66
|
+
--json|-j) INPUT_JSON="$2"; shift 2 ;;
|
|
67
|
+
--help|-h) print_usage; exit 0 ;;
|
|
68
|
+
--) shift; break ;;
|
|
69
|
+
*)
|
|
70
|
+
if [[ -z "$INPUT_JSON" && ${1:0:1} == '{' ]]; then
|
|
71
|
+
INPUT_JSON="$1"; shift
|
|
72
|
+
else
|
|
73
|
+
echo '{"error":"Unknown argument: '"$1"'"}' >&2
|
|
74
|
+
exit 1
|
|
75
|
+
fi
|
|
76
|
+
;;
|
|
77
|
+
esac
|
|
78
|
+
done
|
|
79
|
+
|
|
80
|
+
if [ -n "$INPUT_JSON" ]; then
|
|
81
|
+
TRIGGER_ID=$(printf '%s' "$INPUT_JSON" | jq -r '.id // empty')
|
|
82
|
+
TRIGGER_NAME=$(printf '%s' "$INPUT_JSON" | jq -r '.name // empty')
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
if [ -z "$TRIGGER_ID" ] && [ -z "$TRIGGER_NAME" ]; then
|
|
86
|
+
echo '{"error":"One of --id or --name is required"}' >&2
|
|
87
|
+
exit 1
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
# Resolve by name — list triggers, find the one owned by this team with matching name.
|
|
91
|
+
if [ -z "$TRIGGER_ID" ]; then
|
|
92
|
+
TEAM_ID=$(resolve_team_id || true)
|
|
93
|
+
[ -z "$TEAM_ID" ] && { echo '{"error":"Cannot resolve owning team — cannot scope name lookup"}' >&2; exit 1; }
|
|
94
|
+
|
|
95
|
+
LIST_RESP=$(api_call GET "/triggers" "" 2>/dev/null || echo '{"data":[]}')
|
|
96
|
+
TRIGGER_ID=$(printf '%s' "$LIST_RESP" | jq -r \
|
|
97
|
+
--arg team "$TEAM_ID" \
|
|
98
|
+
--arg name "$TRIGGER_NAME" \
|
|
99
|
+
'(.data // [] | .[]
|
|
100
|
+
| select(.teamId == $team and .name == $name and .status == "active")
|
|
101
|
+
| .id) // empty' | head -1)
|
|
102
|
+
|
|
103
|
+
if [ -z "$TRIGGER_ID" ]; then
|
|
104
|
+
echo "$(jq -n --arg n "$TRIGGER_NAME" --arg team "$TEAM_ID" \
|
|
105
|
+
'{success:false, error:"No active trigger found with name", name:$n, teamId:$team}')"
|
|
106
|
+
exit 0
|
|
107
|
+
fi
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
RESP=$(api_call POST "/triggers/${TRIGGER_ID}/cancel" "")
|
|
111
|
+
echo "$RESP"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Validation tests for cancel-followup skill.
|
|
3
|
+
set -eo pipefail
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
+
PASS=0
|
|
7
|
+
FAIL=0
|
|
8
|
+
|
|
9
|
+
assert_contains() {
|
|
10
|
+
local test_name="$1" needle="$2" haystack="$3"
|
|
11
|
+
if printf '%s' "$haystack" | grep -q -- "$needle"; then
|
|
12
|
+
PASS=$((PASS + 1))
|
|
13
|
+
echo " ✓ ${test_name}"
|
|
14
|
+
else
|
|
15
|
+
FAIL=$((FAIL + 1))
|
|
16
|
+
echo " ✗ ${test_name}"
|
|
17
|
+
echo " expected to contain: ${needle}"
|
|
18
|
+
echo " got: ${haystack}"
|
|
19
|
+
fi
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
echo "=== cancel-followup tests ==="
|
|
23
|
+
|
|
24
|
+
echo ""
|
|
25
|
+
echo "--- Required args ---"
|
|
26
|
+
|
|
27
|
+
OUTPUT=$(bash "$SCRIPT_DIR/execute.sh" 2>&1) || true
|
|
28
|
+
assert_contains "Empty args rejected" "One of --id or --name" "$OUTPUT"
|
|
29
|
+
|
|
30
|
+
OUTPUT=$(bash "$SCRIPT_DIR/execute.sh" '{}' 2>&1) || true
|
|
31
|
+
assert_contains "Empty JSON rejected" "One of --id or --name" "$OUTPUT"
|
|
32
|
+
|
|
33
|
+
echo ""
|
|
34
|
+
echo "--- Help ---"
|
|
35
|
+
|
|
36
|
+
OUTPUT=$(bash "$SCRIPT_DIR/execute.sh" --help 2>&1) || true
|
|
37
|
+
assert_contains "Help lists --id" -- "--id" "$OUTPUT"
|
|
38
|
+
assert_contains "Help lists --name" -- "--name" "$OUTPUT"
|
|
39
|
+
|
|
40
|
+
echo ""
|
|
41
|
+
echo "=== Results: ${PASS} passed, ${FAIL} failed ==="
|
|
42
|
+
[ $FAIL -eq 0 ]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# list-my-followups
|
|
2
|
+
|
|
3
|
+
List every follow-up trigger owned by your team. Call this **before** creating
|
|
4
|
+
a new watcher to avoid stacking duplicates, or when auditing why something
|
|
5
|
+
keeps firing.
|
|
6
|
+
|
|
7
|
+
## Examples
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Everything your team has
|
|
11
|
+
bash execute.sh
|
|
12
|
+
|
|
13
|
+
# Only the still-firing ones
|
|
14
|
+
bash execute.sh --status active
|
|
15
|
+
|
|
16
|
+
# Just the agent:idle watchers (by name convention)
|
|
17
|
+
bash execute.sh --name-prefix watch:
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## What you see
|
|
21
|
+
|
|
22
|
+
Returns `{ success, count, data: [Trigger, ...] }`. Each `Trigger` includes:
|
|
23
|
+
- `id`, `name`, `status`
|
|
24
|
+
- `config` (cron expression / fireAt / event type)
|
|
25
|
+
- `action` (what it creates when it fires)
|
|
26
|
+
- `fireCount`, `nextFireAt`, `lastFiredAt`, `maxFires`, `maxIdleFires`
|
|
27
|
+
|
|
28
|
+
## Audit patterns
|
|
29
|
+
|
|
30
|
+
- **Firing too often?** Look at `consecutiveIdleFires` — if it's high, the
|
|
31
|
+
watcher is producing no-op WorkItems and should be narrowed or cancelled.
|
|
32
|
+
- **Duplicates?** Same `name` across multiple results means the dedup by
|
|
33
|
+
`(createdBy, name)` in the engine rejected the newer attempts — the
|
|
34
|
+
existing one is already in force.
|
|
35
|
+
- **Stale?** `nextFireAt` in the past for a `time` trigger means the engine
|
|
36
|
+
poll hasn't caught up yet; give it 60s.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# List all follow-up triggers owned by your team. Useful for stock-taking
|
|
3
|
+
# before adding a new watcher (so you don't stack duplicates), or for
|
|
4
|
+
# auditing why something keeps firing.
|
|
5
|
+
#
|
|
6
|
+
# Supports CLI flags or legacy JSON.
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
+
source "${SCRIPT_DIR}/../../_common/lib.sh"
|
|
10
|
+
|
|
11
|
+
CREWLY_HOME="${HOME}/.crewly"
|
|
12
|
+
|
|
13
|
+
print_usage() {
|
|
14
|
+
cat <<'EOF_USAGE'
|
|
15
|
+
Usage:
|
|
16
|
+
bash execute.sh # All triggers owned by your team
|
|
17
|
+
bash execute.sh --status active # Only active ones
|
|
18
|
+
bash execute.sh --name-prefix followup: # Filter by name prefix
|
|
19
|
+
|
|
20
|
+
Options:
|
|
21
|
+
--status One of: active | paused | exhausted | cancelled (optional)
|
|
22
|
+
--name-prefix Only return triggers whose name starts with this string
|
|
23
|
+
--json -j Raw JSON payload (legacy)
|
|
24
|
+
--help -h Show this help
|
|
25
|
+
|
|
26
|
+
Output: JSON object { success, count, data: [Trigger, ...] }
|
|
27
|
+
EOF_USAGE
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
resolve_team_id() {
|
|
31
|
+
local session="${1:-${CREWLY_SESSION_NAME:-}}"
|
|
32
|
+
[ -z "$session" ] && return 1
|
|
33
|
+
local teams_dir="${CREWLY_HOME}/teams"
|
|
34
|
+
[ ! -d "$teams_dir" ] && return 1
|
|
35
|
+
for config in "$teams_dir"/*/config.json; do
|
|
36
|
+
[ -f "$config" ] || continue
|
|
37
|
+
local found
|
|
38
|
+
found=$(jq -r --arg s "$session" '.members[]? | select(.sessionName == $s) | "found"' "$config" 2>/dev/null | head -1)
|
|
39
|
+
if [ "$found" = "found" ]; then
|
|
40
|
+
basename "$(dirname "$config")"
|
|
41
|
+
return 0
|
|
42
|
+
fi
|
|
43
|
+
done
|
|
44
|
+
return 1
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
INPUT_JSON=""
|
|
48
|
+
STATUS_FILTER=""
|
|
49
|
+
NAME_PREFIX=""
|
|
50
|
+
|
|
51
|
+
if [[ $# -gt 0 && ${1:0:1} == '{' ]]; then
|
|
52
|
+
INPUT_JSON="$1"
|
|
53
|
+
shift || true
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
while [[ $# -gt 0 ]]; do
|
|
57
|
+
case "$1" in
|
|
58
|
+
--status) STATUS_FILTER="$2"; shift 2 ;;
|
|
59
|
+
--name-prefix) NAME_PREFIX="$2"; shift 2 ;;
|
|
60
|
+
--json|-j) INPUT_JSON="$2"; shift 2 ;;
|
|
61
|
+
--help|-h) print_usage; exit 0 ;;
|
|
62
|
+
--) shift; break ;;
|
|
63
|
+
*)
|
|
64
|
+
if [[ -z "$INPUT_JSON" && ${1:0:1} == '{' ]]; then
|
|
65
|
+
INPUT_JSON="$1"; shift
|
|
66
|
+
else
|
|
67
|
+
echo '{"error":"Unknown argument: '"$1"'"}' >&2
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
;;
|
|
71
|
+
esac
|
|
72
|
+
done
|
|
73
|
+
|
|
74
|
+
if [ -n "$INPUT_JSON" ]; then
|
|
75
|
+
STATUS_FILTER=$(printf '%s' "$INPUT_JSON" | jq -r '.status // empty')
|
|
76
|
+
NAME_PREFIX=$(printf '%s' "$INPUT_JSON" | jq -r '.namePrefix // empty')
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
TEAM_ID=$(resolve_team_id || true)
|
|
80
|
+
[ -z "$TEAM_ID" ] && { echo '{"error":"Cannot resolve owning team from CREWLY_SESSION_NAME"}' >&2; exit 1; }
|
|
81
|
+
|
|
82
|
+
LIST_RESP=$(api_call GET "/triggers" "")
|
|
83
|
+
FILTERED=$(printf '%s' "$LIST_RESP" | jq \
|
|
84
|
+
--arg team "$TEAM_ID" \
|
|
85
|
+
--arg status "$STATUS_FILTER" \
|
|
86
|
+
--arg prefix "$NAME_PREFIX" \
|
|
87
|
+
'(.data // [])
|
|
88
|
+
| map(select(.teamId == $team))
|
|
89
|
+
| (if $status != "" then map(select(.status == $status)) else . end)
|
|
90
|
+
| (if $prefix != "" then map(select(.name != null and (.name | startswith($prefix)))) else . end)')
|
|
91
|
+
|
|
92
|
+
COUNT=$(printf '%s' "$FILTERED" | jq 'length')
|
|
93
|
+
printf '%s' "$FILTERED" | jq --arg c "$COUNT" '{success:true, count:($c|tonumber), data:.}'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Validation tests for list-my-followups skill.
|
|
3
|
+
set -eo pipefail
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
+
PASS=0
|
|
7
|
+
FAIL=0
|
|
8
|
+
|
|
9
|
+
assert_contains() {
|
|
10
|
+
local test_name="$1" needle="$2" haystack="$3"
|
|
11
|
+
if printf '%s' "$haystack" | grep -q -- "$needle"; then
|
|
12
|
+
PASS=$((PASS + 1))
|
|
13
|
+
echo " ✓ ${test_name}"
|
|
14
|
+
else
|
|
15
|
+
FAIL=$((FAIL + 1))
|
|
16
|
+
echo " ✗ ${test_name}"
|
|
17
|
+
echo " expected to contain: ${needle}"
|
|
18
|
+
echo " got: ${haystack}"
|
|
19
|
+
fi
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
echo "=== list-my-followups tests ==="
|
|
23
|
+
|
|
24
|
+
echo ""
|
|
25
|
+
echo "--- Help ---"
|
|
26
|
+
|
|
27
|
+
OUTPUT=$(bash "$SCRIPT_DIR/execute.sh" --help 2>&1) || true
|
|
28
|
+
assert_contains "Help mentions --status" -- "--status" "$OUTPUT"
|
|
29
|
+
assert_contains "Help mentions --name-prefix" -- "--name-prefix" "$OUTPUT"
|
|
30
|
+
|
|
31
|
+
echo ""
|
|
32
|
+
echo "--- Team resolution ---"
|
|
33
|
+
|
|
34
|
+
# Without CREWLY_SESSION_NAME, the skill must refuse rather than returning an
|
|
35
|
+
# all-teams dump. Clear env and run.
|
|
36
|
+
OUTPUT=$(env -u CREWLY_SESSION_NAME bash "$SCRIPT_DIR/execute.sh" 2>&1) || true
|
|
37
|
+
assert_contains "No session → team-resolve error" "Cannot resolve owning team" "$OUTPUT"
|
|
38
|
+
|
|
39
|
+
echo ""
|
|
40
|
+
echo "=== Results: ${PASS} passed, ${FAIL} failed ==="
|
|
41
|
+
[ $FAIL -eq 0 ]
|