@tplog/pi-zendy 0.2.17 → 0.3.1

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.
@@ -1,146 +0,0 @@
1
- ---
2
- name: helm-watchdog
3
- description: "Query Dify Helm chart metadata — values.yaml, container images, validation results, and version info. Use when analyzing Helm-level configuration for a specific Dify Enterprise version."
4
- ---
5
-
6
- # Dify Helm Watchdog Skill
7
-
8
- Query the dify-helm-watchdog **HTTP API** to inspect Helm chart data for any cached Dify version.
9
-
10
- **IMPORTANT: This is a REST API, not a CLI tool. There is no `helm-watchdog` binary. Use `curl` to call the endpoints below.**
11
-
12
- ## Quick Reference — Copy-Paste Commands
13
-
14
- ```bash
15
- # Get values.yaml for a version
16
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/values"
17
-
18
- # Get version metadata (chart version → app version mapping)
19
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0" | jq .
20
-
21
- # List all container images with their paths and tags
22
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/images" | jq '.[] | {path, tag}'
23
-
24
- # Find a specific component's image (e.g., plugin-connector)
25
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/images" | jq '.[] | select(.path | test("plugin-connector"))'
26
-
27
- # Check image validation status
28
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/images?validate=true" | jq '.[] | {path, tag, status}'
29
-
30
- # Get latest version number
31
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/latest?versionOnly=true"
32
- ```
33
-
34
- ### Images API response structure
35
-
36
- The `/images` endpoint returns a JSON array. Each element has these fields:
37
- ```json
38
- {
39
- "path": "langgenius/dify-api", // image repository path
40
- "tag": "7a1f0e32...", // image tag
41
- "registry": "docker.io", // registry (may be absent)
42
- "valuesPath": "api.image" // location in values.yaml
43
- }
44
- ```
45
-
46
- Key: the field is `.path`, not `.name` or `.repository`.
47
-
48
- ## When to Use
49
-
50
- - Looking up `values.yaml` for a specific Dify chart version
51
- - Checking what container images a chart version uses
52
- - Finding the latest chart version
53
- - Validating chart image availability
54
- - Answering customer questions about Helm configuration, default values, or image tags
55
-
56
- ## When NOT to Use
57
-
58
- - Modifying chart values or deploying — this is read-only
59
- - Anything outside the Helm chart layer (application code, runtime behavior)
60
-
61
- ## Base URL
62
-
63
- ```
64
- https://dify-helm-watchdog.vercel.app/api/v1
65
- ```
66
-
67
- ## API Endpoints
68
-
69
- ### List cached versions
70
-
71
- ```bash
72
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions" | jq .
73
- ```
74
-
75
- ### Get latest version
76
-
77
- ```bash
78
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/latest"
79
- # Plain text version number only:
80
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/latest?versionOnly=true"
81
- ```
82
-
83
- ### Get version metadata
84
-
85
- ```bash
86
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0" | jq .
87
- ```
88
-
89
- Returns chart version, app version, creation date, and asset URLs.
90
-
91
- ### Get values.yaml
92
-
93
- ```bash
94
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/values"
95
- ```
96
-
97
- Returns the full `values.yaml` for the requested chart version. This is the most commonly used endpoint — use it to check default configuration, environment variables, image tags, and feature flags.
98
-
99
- ### Get container images
100
-
101
- ```bash
102
- # JSON output
103
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/images" | jq .
104
- # With validation status
105
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/images?validate=true" | jq .
106
- ```
107
-
108
- Lists all container image references from the chart's values. Useful for answering questions about image tags (`latest` vs pinned), base images, and vulnerability scoping.
109
-
110
- ### Get validation results
111
-
112
- ```bash
113
- # All validations
114
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/validation" | jq .
115
- # Only missing images
116
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/versions/3.8.0/validation?status=MISSING" | jq .
117
- ```
118
-
119
- ### Inspect cache metadata
120
-
121
- ```bash
122
- curl -s "https://dify-helm-watchdog.vercel.app/api/v1/cache" | jq .
123
- ```
124
-
125
- ## Practical Guidance
126
-
127
- 1. **Start with version metadata** to confirm the chart version exists and get the app version mapping (e.g., chart 3.8.0 → app 1.12.0).
128
- 2. **Use values.yaml** to answer configuration questions — most customer inquiries about Helm settings can be resolved here.
129
- 3. **Use images** endpoint when the question is about container images, tags, or vulnerability scope.
130
- 4. When a customer reports an issue on a specific version, always pull the values.yaml for **that exact version** — defaults change between releases.
131
- 5. Output is JSON unless otherwise noted (values endpoint returns raw YAML).
132
-
133
- ## Version Mapping
134
-
135
- Chart versions map to Dify app versions. Common mappings:
136
- - Chart 3.8.0 → App 1.12.0
137
- - Chart 3.7.5 → App 1.11.4
138
-
139
- Use the version metadata endpoint to confirm the mapping for any version.
140
-
141
- ## Notes for the Agent
142
-
143
- - All endpoints are public and read-only, no authentication needed for GET requests.
144
- - Use `curl -s` and pipe to `jq` for readable output.
145
- - The values.yaml can be large — if you only need a specific section, pipe through `grep` or use `yq` if available.
146
- - When comparing versions, pull values for both and diff them.
@@ -1,143 +0,0 @@
1
- ---
2
- name: source-check
3
- description: "Clone and analyze Dify source code to investigate customer issues. Knows the repo map: enterprise backend/frontend, open-source core, plugin daemon, sandbox. Human-triggered only."
4
- ---
5
-
6
- # Dify Source Analysis Skill
7
-
8
- Clone the correct Dify repository and analyze source code to investigate customer issues.
9
-
10
- ## When to Use
11
-
12
- - The user explicitly asks to look at the source code
13
- - A question cannot be answered from Helm chart values alone
14
-
15
- ## When NOT to Use
16
-
17
- - Do NOT proactively decide to clone source code — wait for the user to ask
18
- - Do NOT use for questions answerable from values.yaml or documentation
19
-
20
- ## Repository Map
21
-
22
- **First, determine which repo to clone based on the problem area:**
23
-
24
- **Clone destination:** always clone under `"$ZENDY_SRC_DIR"` (set by the `source-cleanup`
25
- extension at session start). The extension will wipe the whole directory when the
26
- session ends, so anything inside is guaranteed to be cleaned up — even if you forget.
27
- If for some reason `$ZENDY_SRC_DIR` is not set, fall back to `/tmp` but tell the user.
28
-
29
- | Problem area | Repo | Access | Language | Clone command |
30
- |---|---|---|---|---|
31
- | SSO, token, session, SCIM, license, audit, branding, MFA, password policy | `langgenius/dify-enterprise` | private | Go | `git clone --depth 1 --branch <tag> git@github.com:langgenius/dify-enterprise.git "$ZENDY_SRC_DIR/dify-enterprise-<tag>"` |
32
- | Enterprise Dashboard UI, admin console frontend | `langgenius/dify-enterprise-frontend` | private | TypeScript | `git clone --depth 1 --branch <tag> git@github.com:langgenius/dify-enterprise-frontend.git "$ZENDY_SRC_DIR/dify-enterprise-frontend-<tag>"` |
33
- | API, workflow, knowledge base, model provider, RAG, chat | `langgenius/dify` | public | Python | `git clone --depth 1 --branch <tag> git@github.com:langgenius/dify.git "$ZENDY_SRC_DIR/dify-<tag>"` |
34
- | Plugin runtime, plugin execution | `langgenius/dify-plugin-daemon` | public | Go/Python | `git clone --depth 1 --branch <tag> git@github.com:langgenius/dify-plugin-daemon.git "$ZENDY_SRC_DIR/dify-plugin-daemon-<tag>"` |
35
- | Code sandbox execution | `langgenius/dify-sandbox` | public | Go | `git clone --depth 1 --branch <tag> git@github.com:langgenius/dify-sandbox.git "$ZENDY_SRC_DIR/dify-sandbox-<tag>"` |
36
-
37
- Enterprise repos also contain these components (all in dify-enterprise):
38
- - **gateway** — enterprise API gateway (`cmd/gateway/`, `pkg/gateway/`)
39
- - **plugin-connector** — plugin pod orchestration on K8s (`cmd/plugin-connector/`, `pkg/connector/`)
40
- - **plugin-manager** — enterprise plugin management (`cmd/plugin-manager/`, `pkg/plugin-manager/`)
41
- - **plugin-crd** — K8s CRD controller for plugins (`cmd/plugin-crd/`, `pkg/plugincrd/`)
42
- - **audit** — audit logging (`cmd/audit/`, `pkg/audit/`)
43
-
44
- ## Version Mapping
45
-
46
- Customer's Dify version → correct git tag:
47
-
48
- 1. Get chart version from Zendesk ticket fields (e.g., `3.8.0`)
49
- 2. Use helm-watchdog to get the image tags from values.yaml:
50
- - `enterprise.image.tag` → tag for `dify-enterprise` and `dify-enterprise-frontend` (e.g., `0.15.0`)
51
- - `api.image.tag` → tag for `dify` (usually a commit hash, e.g., `7a1f0e32...`)
52
- - `pluginDaemon.image.tag` → tag for `dify-plugin-daemon`
53
- - `sandbox.image.tag` → tag for `dify-sandbox`
54
-
55
- ## dify-enterprise Directory Structure (Go)
56
-
57
- ```
58
- cmd/ # Entry points (one per component)
59
- ├── enterprise/ # Main enterprise backend
60
- ├── gateway/ # API gateway
61
- ├── audit/ # Audit service
62
- ├── plugin-connector/ # Plugin K8s orchestrator
63
- ├── plugin-manager/ # Plugin manager
64
- ├── plugin-crd/ # K8s CRD controller
65
- └── plugin-shader/ # Plugin image builder
66
-
67
- pkg/
68
- ├── enterprise/
69
- │ └── service/ # Core business logic
70
- │ ├── console-sso.go # Console SSO login (SAML/OIDC/OAuth2)
71
- │ ├── web-sso.go # WebApp SSO login
72
- │ ├── dashboard-sso.go # Dashboard SSO
73
- │ ├── cookie.go # Cookie/session management
74
- │ ├── ssoconfig.go # SSO configuration
75
- │ ├── member.go # User/member management
76
- │ ├── license.go # License validation
77
- │ ├── mfa.go # Multi-factor auth
78
- │ ├── password-policy.go # Password policy
79
- │ ├── scim.go # SCIM provisioning
80
- │ ├── scim-users.go # SCIM user sync
81
- │ ├── scim-groups.go # SCIM group sync
82
- │ ├── branding.go # Custom branding
83
- │ ├── workspace.go # Workspace management
84
- │ ├── admin-*.go # Admin operations
85
- │ └── webapp.go # WebApp config
86
- ├── sysconf/
87
- │ ├── keys.go # Configuration key definitions
88
- │ └── values.go # Default values
89
- ├── auth/ # Authentication
90
- ├── connector/ # Plugin connector logic
91
- ├── gateway/ # Gateway logic
92
- ├── plugin/ # Plugin management
93
- ├── plugin-manager/ # Plugin manager logic
94
- ├── plugincrd/ # K8s CRD logic
95
- ├── audit/ # Audit logic
96
- ├── kube/ # Kubernetes utilities
97
- └── data/ # Data layer
98
-
99
- ts/ # TypeScript code
100
- ├── connector/ # Plugin connector frontend
101
- ├── enterprise_client/ # Enterprise API client
102
- └── dify/ # Dify integrations
103
- ```
104
-
105
- ## dify (open-source) Directory Structure (Python)
106
-
107
- ```
108
- api/ # Backend API (Flask)
109
- ├── controllers/ # HTTP handlers
110
- ├── core/
111
- │ ├── workflow/ # Workflow engine
112
- │ ├── rag/ # RAG pipeline
113
- │ ├── model_runtime/ # Model provider integrations
114
- │ ├── app/ # App orchestration
115
- │ └── tools/ # Built-in tools
116
- ├── services/ # Business logic
117
- ├── models/ # Database models
118
- └── configs/ # Configuration
119
-
120
- web/ # Frontend (Next.js / TypeScript)
121
- ├── app/ # Pages
122
- ├── components/ # UI components
123
- └── service/ # API client
124
- ```
125
-
126
- ## Analysis Approach
127
-
128
- 1. **grep first** — find relevant files by keyword (feature name, config key, error message)
129
- 2. **Read identified files** — understand the logic
130
- 3. **Trace the flow** — API endpoint → handler → service → data layer
131
- 4. **Compare** with the customer's reported behavior
132
- 5. **Conclude** — bug, misconfiguration, or expected behavior
133
-
134
- ## Rules
135
-
136
- - Always shallow clone (`--depth 1`) for speed
137
- - State confidence level: "confirmed from code" vs "inferred from structure"
138
- - Read-only — never modify source code
139
- - Clone into `"$ZENDY_SRC_DIR"`. The `source-cleanup` extension wipes this directory
140
- on session shutdown, so manual `rm -rf` after analysis is no longer required.
141
- If the user asks for immediate cleanup mid-session, use the `/cleanup-src` slash
142
- command (wipes `/tmp/dify-*` and orphan session dirs).
143
- - If clone fails (permission denied), tell the user to configure SSH keys
@@ -1,37 +0,0 @@
1
- ---
2
- name: zendesk-cli
3
- description: "Zendesk ticket lookup via the zcli CLI. Provides ticket metadata, comment threads, and search — all as JSON."
4
- ---
5
-
6
- # zendesk-cli
7
-
8
- `zcli` is a Zendesk CLI that outputs JSON. Use it to fetch tickets, comments, and search results.
9
-
10
- ## Quick start
11
-
12
- Discover all commands and options:
13
-
14
- ```bash
15
- zcli --help
16
- zcli <command> --help
17
- ```
18
-
19
- ## Install (if missing)
20
-
21
- ```bash
22
- npm install -g @tplog/zendesk-cli
23
- zcli configure
24
- ```
25
-
26
- ## Key behaviors the agent must know
27
-
28
- - **`zcli <email>` is assignee lookup, not requester.** This is the most common mistake.
29
- - **`zcli follower <email>`** is a separate command — don't try to filter assignee results manually.
30
- - **Output is already JSON.** No `--json` flag needed. Summarize directly from stdout.
31
- - **When summarizing a ticket, always parallel-call both:**
32
- ```bash
33
- zcli <id> # ticket metadata
34
- zcli comments <id> # comment thread
35
- ```
36
- Ticket metadata alone is not enough for a complete summary.
37
- - **Errors are also JSON on stdout** with non-zero exit code. Check stdout, not just stderr.
@@ -1,120 +0,0 @@
1
- ---
2
- name: zendesk-kg
3
- description: "Search the Zendesk Knowledge Graph via the `zendesk-kg` CLI. Hybrid (vector + fulltext) retrieval over historical tickets — use for cross-ticket / semantic lookups that go beyond `zcli` single-ticket fetch."
4
- ---
5
-
6
- # zendesk-kg
7
-
8
- `zendesk-kg` is a CLI for the Zendesk Knowledge Graph retrieval API. It performs **hybrid search (vector + fulltext) with Reciprocal Rank Fusion** over an index of historical Dify Enterprise support tickets — each ticket pre-summarized into `quickSummary` / `issueSummary` / `solutionSummary`. Use it when you need to find **similar past issues, related conversations, or aggregated knowledge** that a single-ticket lookup can't surface.
9
-
10
- ## When to use this skill
11
-
12
- - The user is investigating a recurring symptom and you want to find **other tickets that show the same pattern**
13
- - You need cross-ticket evidence ("has anyone else hit this?") to support a hypothesis
14
- - You want to retrieve related KB-style ticket summaries before drafting a reply
15
-
16
- ## When NOT to use
17
-
18
- - The user gave you a specific ticket ID — use `zcli <id>` + `zcli comments <id>`. zendesk-kg returns curated *summaries*, not the raw ticket / comment thread.
19
- - The question is answerable from Helm chart values or source code — use `helm-watchdog` or `source-check` first.
20
-
21
- ## Quick start
22
-
23
- ```bash
24
- zendesk-kg --help
25
- zendesk-kg search --help # has the most options worth knowing
26
- ```
27
-
28
- ## Install (if missing)
29
-
30
- The standard `zendy` install handles this automatically. To install manually:
31
-
32
- ```bash
33
- curl -fsSL https://raw.githubusercontent.com/sorphwer/zendesk-kg-cli-release/main/install.sh | sh
34
- zendesk-kg init # paste your RETRIEVER_API_KEY
35
- ```
36
-
37
- Config lives in `~/.zendesk-kg/.env` (`RETRIEVER_API_KEY`, `RETRIEVER_API_URL`).
38
-
39
- ## Core commands
40
-
41
- | Command | Purpose |
42
- |---|---|
43
- | `zendesk-kg search "<query>" [flags]` | Hybrid search. Natural-language query. |
44
- | `zendesk-kg stats` | Show current index size / coverage. |
45
- | `zendesk-kg health` | Check API connectivity. **Currently unreliable — see Caveats below.** |
46
- | `zendesk-kg init` | Re-enter API key / URL. Setup only. |
47
- | `zendesk-kg set-env output json` | Set default output format. |
48
- | `zendesk-kg update` | Self-update the CLI binary. Don't run proactively. |
49
-
50
- ## `search` flags worth knowing
51
-
52
- ```
53
- -k, --top-k INTEGER Number of results to return (1-20, default 5)
54
- -s, --order-by TEXT rrfScore | createdAt | priority
55
- -o, --output FORMAT table | json | text
56
- --priority TEXT Filter: high / normal / low / urgent
57
- -v, --version TEXT Filter by Dify version mentioned in the ticket
58
- --created-after DATE
59
- --use-llm LLM-formatted summary instead of raw JSON
60
- ```
61
-
62
- For agent automation always use `-o json`. `table` is for humans, `text` is for terminal browsing.
63
-
64
- ## Output format (real shape, not pseudocode)
65
-
66
- `search -o json` returns:
67
-
68
- ```json
69
- {
70
- "results": [
71
- {
72
- "ticketId": "765",
73
- "subject": "<original ticket subject, often non-English>",
74
- "status": "closed | open | pending | ...",
75
- "priority": "low | normal | high | urgent",
76
- "quickSummary": "1-2 sentence summary in English",
77
- "issueSummary": "Multi-paragraph: Environment / Symptoms / User Questions / Timeline",
78
- "solutionSummary": "Multi-paragraph: Analysis / Actions / Recommendations / Resolution",
79
- "createdAt": "YYYY-MM-DD HH:MM:SS",
80
- "handledBy": ["agent_name", ...],
81
- "versions": ["3.8.0", ...],
82
- "keywords": ["sso", "oidc", ...],
83
- "referenceUrls": [...],
84
- "channels": { ... }
85
- },
86
- ...
87
- ]
88
- }
89
- ```
90
-
91
- **Always surface `ticketId`, `quickSummary`, and `solutionSummary`** when reporting back to the user. The FDE will follow up on the ticket via `zcli <ticketId>` for full context. Don't dump the whole JSON.
92
-
93
- ## Behavioral rules the agent must follow
94
-
95
- - **Use natural-language queries.** Describe the symptom in the user's words; the graph handles semantics. Don't manually OR a bunch of keywords.
96
- - **Cite ticket IDs.** When summarizing for the user, always include the ticket IDs the synthesis is drawn from — the FDE will want to read the originals.
97
- - **`search` returns curated summaries, not raw tickets.** For raw comment threads, follow up with `zcli <id>` + `zcli comments <id>`.
98
- - **Filter when you can.** If the user mentioned a Dify version (`-v 3.8.0`) or priority (`--priority high`), use the flag — don't filter post-hoc on the JSON.
99
- - **Don't assume coverage.** The KG is indexed over a snapshot, not live Zendesk. Empty result ≠ proof nothing exists. Fall back to `zcli search` for live data.
100
- - **Don't run `update` without explicit user request.** Self-update mutates the binary on disk.
101
-
102
- ## Typical retrieval flow
103
-
104
- ```bash
105
- # 1. Cast a wide semantic net for context (most-relevant first by default)
106
- zendesk-kg search "users intermittently logged out after SSO with MFA enabled" -k 5 -o json
107
-
108
- # 2. Inspect the most relevant ticket end-to-end via zcli
109
- zcli <ticketId>
110
- zcli comments <ticketId>
111
-
112
- # 3. Cross-check Helm config / source as needed
113
- # (helm-watchdog, source-check skills)
114
- ```
115
-
116
- ## Caveats
117
-
118
- - **`health` and `stats` may report `Redirecting...` / `unreachable` even when `search` works.** As of zendesk-kg 0.1.2 / retriever backend v0.1, those endpoints sit behind a 302 redirect to a login page while `/search` is API-key-authenticated directly. **Don't gate retries on `health`** — if `search` failed and you want to diagnose, retry `search` itself or surface the error verbatim to the user. Treat `health: ok` as a real signal, but `health: unreachable` as inconclusive.
119
- - **Errors come back in the JSON body, not via exit code.** All commands tend to exit 0 even when the API rejects the request. Always parse `stdout` for `"error"` / `"status": "unreachable"` instead of relying on `$?`.
120
- - **Index is a snapshot.** The catalog won't include tickets that opened today; for fresh tickets use `zcli search`.