skillscript-runtime 0.4.4 → 0.7.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 +36 -32
- package/dist/compile.js +33 -2
- package/dist/compile.js.map +1 -1
- package/dist/filters.d.ts +19 -1
- package/dist/filters.d.ts.map +1 -1
- package/dist/filters.js +42 -1
- package/dist/filters.js.map +1 -1
- package/dist/help-content.d.ts.map +1 -1
- package/dist/help-content.js +31 -1
- package/dist/help-content.js.map +1 -1
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +236 -18
- package/dist/lint.js.map +1 -1
- package/dist/parser.d.ts +26 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +258 -24
- package/dist/parser.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +168 -61
- package/dist/runtime.js.map +1 -1
- package/examples/classify-support-ticket.skill.md +13 -13
- package/examples/cut-release-tag.skill.md +14 -14
- package/examples/doc-qa-with-citations.skill.md +3 -3
- package/examples/feedback-sentiment-scan.skill.md +13 -13
- package/examples/hello.skill.md +2 -2
- package/examples/hello.skill.provenance.json +1 -1
- package/examples/morning-brief.skill.md +6 -6
- package/examples/queue-length-monitor.skill.md +4 -4
- package/examples/service-health-watch.skill.md +7 -7
- package/examples/youtrack-morning-sweep.skill.md +4 -4
- package/package.json +1 -1
|
@@ -5,36 +5,36 @@
|
|
|
5
5
|
# Output: text
|
|
6
6
|
|
|
7
7
|
last_tag:
|
|
8
|
-
|
|
8
|
+
shell(command="git describe --tags --abbrev=0") -> PREV_TAG
|
|
9
9
|
else:
|
|
10
10
|
$set PREV_TAG = "(no prior tags)"
|
|
11
|
-
|
|
11
|
+
emit(text="no previous tag found; treating this as the first release")
|
|
12
12
|
|
|
13
13
|
commits_since:
|
|
14
14
|
needs: last_tag
|
|
15
|
-
|
|
15
|
+
shell(command="git log --oneline ${PREV_TAG}..HEAD") -> COMMITS
|
|
16
16
|
else:
|
|
17
17
|
$set COMMITS = "(unable to read commit log; proceeding without preview)"
|
|
18
18
|
|
|
19
19
|
propose:
|
|
20
20
|
needs: commits_since
|
|
21
|
-
|
|
21
|
+
$ llm prompt="Propose the next semver tag given prev tag '${PREV_TAG}', bump kind '${BUMP_KIND}', and commits below. Return ONLY the new tag string (e.g. v1.4.3). No commentary.\n\nCommits:\n${COMMITS}" model=qwen maxTokens=30 -> PROPOSED_TAG
|
|
22
22
|
|
|
23
23
|
confirm:
|
|
24
24
|
needs: propose
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
emit(text="Previous tag: ${PREV_TAG}")
|
|
26
|
+
emit(text="Commits since:")
|
|
27
|
+
emit(text="${COMMITS}")
|
|
28
|
+
emit(text="Proposed new tag: ${PROPOSED_TAG|trim}")
|
|
29
|
+
ask(prompt="Cut tag ${PROPOSED_TAG|trim}?") -> APPROVED
|
|
30
30
|
|
|
31
31
|
apply:
|
|
32
32
|
needs: confirm
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
shell(command="git tag ${PROPOSED_TAG|trim}") -> TAG_OUT
|
|
34
|
+
shell(command="git push origin ${PROPOSED_TAG|trim}") -> PUSH_OUT
|
|
35
|
+
emit(text="Tagged and pushed ${PROPOSED_TAG|trim}")
|
|
36
36
|
else:
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
emit(text="Tag/push failed; rolling back local tag")
|
|
38
|
+
shell(command="git tag -d ${PROPOSED_TAG|trim}") -> ROLLBACK
|
|
39
39
|
|
|
40
40
|
default: apply
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
# Output: text
|
|
6
6
|
|
|
7
7
|
answer:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
$ memory mode=rerank query="${QUESTION}" limit=${K} -> HITS (fallback: [])
|
|
9
|
+
$ llm prompt="Answer the question using ONLY the supplied passages. Cite each claim inline as [id:<memory-id>]. Question: ${QUESTION}. Passages: ${HITS|json}" maxTokens=900 -> RESPONSE
|
|
10
|
+
emit(text="${RESPONSE}")
|
|
11
11
|
|
|
12
12
|
default: answer
|
|
@@ -7,23 +7,23 @@
|
|
|
7
7
|
# Output: prompt-context: support-lead
|
|
8
8
|
|
|
9
9
|
fetch_new:
|
|
10
|
-
|
|
10
|
+
$ memory mode=fts query="customer feedback" limit=${SCAN_LIMIT} created_after=${EVENT.fired_at_unix} -> FEEDBACK
|
|
11
11
|
|
|
12
12
|
fetch_seen:
|
|
13
|
-
|
|
13
|
+
$ memory mode=fts query="sentiment-scan seen marker" limit=200 domain_tags=["sentiment-scan-seen"] -> SEEN_MARKERS
|
|
14
14
|
|
|
15
15
|
classify_and_emit:
|
|
16
16
|
needs: fetch_new, fetch_seen
|
|
17
|
-
|
|
18
|
-
foreach F in $
|
|
19
|
-
if $
|
|
20
|
-
|
|
21
|
-
elif $
|
|
22
|
-
|
|
23
|
-
if $
|
|
24
|
-
|
|
25
|
-
elif $
|
|
26
|
-
|
|
27
|
-
$ memorystore.write summary="sentiment-scan seen $
|
|
17
|
+
emit(text="Sentiment scan results for ${NOW}:")
|
|
18
|
+
foreach F in ${FEEDBACK}:
|
|
19
|
+
if ${F.id|trim} in ${SEEN_MARKERS}:
|
|
20
|
+
emit(text="- skipped (already classified): ${F.id|trim}")
|
|
21
|
+
elif ${F.id|trim} not in ${SEEN_MARKERS}:
|
|
22
|
+
$ llm prompt="Classify the sentiment of this customer feedback. Respond with ONE word: 'frustrated', 'blocking', 'satisfied', 'neutral'. No explanation.\n\nFeedback: ${F.summary}\nDetail: ${F.detail}" model=gemma2 maxTokens=10 -> VERDICT
|
|
23
|
+
if ${VERDICT|trim} == "frustrated":
|
|
24
|
+
emit(text="- FRUSTRATED [${F.id|trim}] ${F.summary}")
|
|
25
|
+
elif ${VERDICT|trim} == "blocking":
|
|
26
|
+
emit(text="- BLOCKING [${F.id|trim}] ${F.summary}")
|
|
27
|
+
$ memorystore.write summary="sentiment-scan seen ${F.id|trim}" detail="verdict=${VERDICT|trim} on ${EVENT.fired_at_unix}" knowledge_type=common vault=private domain_tags=["sentiment-scan-seen"] expires_at=${EVENT.fired_at_plus_7d_unix}
|
|
28
28
|
|
|
29
29
|
default: classify_and_emit
|
package/examples/hello.skill.md
CHANGED
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
# Requires: user-var:morning-brief-channel -> CHANNEL (fallback: dev-null)
|
|
6
6
|
# Triggers: cron: 0 7 * * *
|
|
7
7
|
# OnError: morning-brief-degraded
|
|
8
|
-
# Output: slack: $
|
|
8
|
+
# Output: slack: ${CHANNEL}
|
|
9
9
|
# Output: prompt-context: perry
|
|
10
10
|
|
|
11
11
|
calendar:
|
|
12
|
-
$ calendar.list_events horizon_hours=$
|
|
12
|
+
$ calendar.list_events horizon_hours=${BRIEF_HORIZON_HOURS} -> EVENTS
|
|
13
13
|
|
|
14
14
|
mailbox:
|
|
15
|
-
|
|
15
|
+
$ memory mode=fts query="addressed:${AGENT} created_after:${EVENT.fired_at_unix}" limit=10 -> MAIL
|
|
16
16
|
|
|
17
17
|
overnight:
|
|
18
|
-
|
|
18
|
+
$ memory mode=rerank query="overnight writes since:${EVENT.fired_at_plus_1d_unix}" limit=15 -> NOTES
|
|
19
19
|
|
|
20
20
|
compose: needs: calendar, mailbox, overnight
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
$ llm prompt="Compose a concise morning brief. Calendar: ${EVENTS|json}. Mailbox: ${MAIL|json}. Overnight notes: ${NOTES|json}. Three sections, six bullets max each." model=qwen maxTokens=1200 -> BRIEF
|
|
22
|
+
emit(text="${BRIEF}")
|
|
23
23
|
|
|
24
24
|
default: compose
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
# needed for the count — the filter is deterministic + free.
|
|
11
11
|
|
|
12
12
|
fetch:
|
|
13
|
-
|
|
13
|
+
shell(command="cat ${QUEUE_PATH}") -> ITEMS (fallback: "[]")
|
|
14
14
|
|
|
15
15
|
evaluate:
|
|
16
16
|
needs: fetch
|
|
17
|
-
if $
|
|
18
|
-
|
|
17
|
+
if ${ITEMS|length} > ${THRESHOLD}:
|
|
18
|
+
emit(text="Queue backlog: ${ITEMS|length} items pending (threshold ${THRESHOLD}). Action required.")
|
|
19
19
|
else:
|
|
20
|
-
|
|
20
|
+
emit(text="Queue healthy: ${ITEMS|length} items pending (under ${THRESHOLD}).")
|
|
21
21
|
|
|
22
22
|
default: evaluate
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
# Output: none
|
|
7
7
|
|
|
8
8
|
probe:
|
|
9
|
-
foreach SVC in $
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if $
|
|
13
|
-
$ memorystore.write summary="service degradation: $
|
|
14
|
-
|
|
9
|
+
foreach SVC in ${SERVICES}:
|
|
10
|
+
shell(command="curl -s -o /dev/null -w \"%{http_code} %{time_total}\" https://status.internal/${SVC|url}") -> RAW
|
|
11
|
+
$ llm prompt="From the line '${RAW|trim}' (http_code time_seconds), and budget ${LATENCY_BUDGET_MS} ms, answer ok or degraded only." -> STATUS
|
|
12
|
+
if ${STATUS|trim} == "degraded":
|
|
13
|
+
$ memorystore.write summary="service degradation: ${SVC}" detail="probe at ${NOW}: ${RAW|trim}" domain_tags=[ops, service-health, degraded:${SVC}] vault=private knowledge_type=common expires_at=${EVENT.fired_at_plus_1d_unix} -> ACK
|
|
14
|
+
emit(text="${SVC} degraded — wrote signal")
|
|
15
15
|
else:
|
|
16
|
-
|
|
16
|
+
emit(text="${SVC} ok")
|
|
17
17
|
|
|
18
18
|
default: probe
|
|
@@ -9,9 +9,9 @@ fetch_issues: fetch_me
|
|
|
9
9
|
$ youtrack.search_issues query="for: me" limit=5 -> RAW
|
|
10
10
|
|
|
11
11
|
report: fetch_issues
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
foreach I in $
|
|
15
|
-
|
|
12
|
+
emit(text="Morning sweep for ${ME.login}:")
|
|
13
|
+
emit(text="Open issues assigned: ${RAW.issuesPage|length}")
|
|
14
|
+
foreach I in ${RAW.issuesPage}:
|
|
15
|
+
emit(text="- ${I.id}: ${I.summary}")
|
|
16
16
|
|
|
17
17
|
default: report
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skillscript-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Runtime, compiler, lint, CLI, and dashboard for Skillscript — a small declarative language for authoring agent workflows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Scott Shwarts <scotts@pobox.com>",
|