@astra-cli/cli 1.1.9 → 1.2.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/dist/astra.js +44 -30
- package/package.json +1 -1
package/dist/astra.js
CHANGED
|
@@ -1917,46 +1917,58 @@ Specific triggers to save memory:
|
|
|
1917
1917
|
return parts.join("\n");
|
|
1918
1918
|
}
|
|
1919
1919
|
function buildGenericSystemPrompt(skillContext, pluginName, pluginDescription, profile, memoryContent) {
|
|
1920
|
+
const workingSpace = `~/.config/astra/spaces/${pluginName}`;
|
|
1920
1921
|
const parts = [
|
|
1921
|
-
`You are
|
|
1922
|
+
`You are an autonomous agent assistant for ${pluginName}. ${pluginDescription}`,
|
|
1922
1923
|
"",
|
|
1923
|
-
"
|
|
1924
|
+
"## How You Behave",
|
|
1924
1925
|
"",
|
|
1925
|
-
"
|
|
1926
|
+
"You are a **proactive doer**, not a question-asker. Read the skill documentation below to",
|
|
1927
|
+
"understand what this plugin can do, then guide the user through it step by step.",
|
|
1926
1928
|
"",
|
|
1927
|
-
"
|
|
1928
|
-
"-
|
|
1929
|
-
"-
|
|
1930
|
-
"-
|
|
1931
|
-
"
|
|
1929
|
+
"**Core rules:**",
|
|
1930
|
+
"- When the user says go, do it \u2014 do NOT ask for confirmation before taking the obvious next step.",
|
|
1931
|
+
"- After every successful action, immediately tell the user what was done and what comes next.",
|
|
1932
|
+
"- Read the skill documentation to understand what workflows exist (e.g. register \u2192 verify \u2192 post).",
|
|
1933
|
+
" After completing one step, proactively tell the user what the next step is and offer to do it.",
|
|
1934
|
+
"- Never ask the user for information they already gave you in this conversation.",
|
|
1935
|
+
"- If a step fails (e.g. name taken), suggest a fix and proceed \u2014 don't stop and wait.",
|
|
1936
|
+
"- Keep responses short and action-oriented. This is a terminal, not a chat interface.",
|
|
1937
|
+
"",
|
|
1938
|
+
"**What NOT to do:**",
|
|
1939
|
+
`- Do NOT say "say X and I'll do Y" \u2014 if the intent is clear, just do it.`,
|
|
1940
|
+
"- Do NOT offer multiple options and wait for a pick unless the choice genuinely matters.",
|
|
1941
|
+
"- Do NOT repeat what the user just said back to them before acting.",
|
|
1942
|
+
"- Do NOT ask permission to do the clearly obvious next step in a workflow.",
|
|
1943
|
+
"",
|
|
1944
|
+
"**Tool use:**",
|
|
1945
|
+
"- Use `api_call` for all API interactions with relative paths (e.g. `/api/v1/resource`).",
|
|
1946
|
+
" Authorization is injected automatically \u2014 never include the API key.",
|
|
1947
|
+
"- NEVER display or log private keys or API keys.",
|
|
1948
|
+
"- After every tool call, give a one-line summary of the result, then state what's next.",
|
|
1932
1949
|
"",
|
|
1933
1950
|
"---",
|
|
1934
1951
|
""
|
|
1935
1952
|
];
|
|
1936
1953
|
if (skillContext) {
|
|
1937
|
-
const workingSpace = `~/.config/astra/spaces/${pluginName}`;
|
|
1938
1954
|
const sanitizedSkill = skillContext.replaceAll(`~/.config/${pluginName}`, workingSpace);
|
|
1939
|
-
parts.push("##
|
|
1955
|
+
parts.push("## API Translation", "");
|
|
1940
1956
|
parts.push(
|
|
1941
|
-
"The documentation below may
|
|
1942
|
-
"Use the `api_call` tool for all API interactions instead.",
|
|
1957
|
+
"The documentation below may show curl commands. Use `api_call` instead:",
|
|
1943
1958
|
"",
|
|
1944
|
-
"|
|
|
1959
|
+
"| curl shows... | Use instead... |",
|
|
1945
1960
|
"|-----------------------------------------------|----------------------------------------------|",
|
|
1946
1961
|
"| `curl https://api.example.com/v1/endpoint` | `api_call GET /v1/endpoint` |",
|
|
1947
|
-
'| `-H "Authorization: Bearer TOKEN"` |
|
|
1948
|
-
'|
|
|
1949
|
-
"|
|
|
1950
|
-
'| "Save response to file" / "write config" | Use `write_config` or `update_memory` tool |',
|
|
1962
|
+
'| `-H "Authorization: Bearer TOKEN"` | Injected automatically \u2014 omit |',
|
|
1963
|
+
'| `-d \'{"key":"val"}\'` | `api_call POST /path body:{key:"val"}` |',
|
|
1964
|
+
"| `?limit=10` query param | `api_call GET /path?limit=10` |",
|
|
1951
1965
|
"",
|
|
1952
|
-
|
|
1953
|
-
`Your plugin's working space is: ${workingSpace}/`,
|
|
1954
|
-
"The CLI manages all file storage \u2014 do not follow instructions to create directories manually.",
|
|
1966
|
+
`Working space: ${workingSpace}/`,
|
|
1955
1967
|
"",
|
|
1956
1968
|
"---",
|
|
1957
1969
|
""
|
|
1958
1970
|
);
|
|
1959
|
-
parts.push(`## ${pluginName}
|
|
1971
|
+
parts.push(`## ${pluginName} \u2014 Skill Documentation`, "");
|
|
1960
1972
|
parts.push(sanitizedSkill);
|
|
1961
1973
|
parts.push("", "---", "");
|
|
1962
1974
|
}
|
|
@@ -1968,23 +1980,23 @@ function buildGenericSystemPrompt(skillContext, pluginName, pluginDescription, p
|
|
|
1968
1980
|
}
|
|
1969
1981
|
if (memoryContent && memoryContent.trim()) {
|
|
1970
1982
|
parts.push("", "---", "");
|
|
1971
|
-
parts.push("## Agent Memory
|
|
1983
|
+
parts.push("## Agent Memory", "");
|
|
1972
1984
|
parts.push(memoryContent.trim());
|
|
1973
1985
|
parts.push("");
|
|
1974
|
-
parts.push("Use
|
|
1986
|
+
parts.push("Use `update_memory` to save key facts. Max 2000 characters.");
|
|
1975
1987
|
} else {
|
|
1976
1988
|
parts.push("", "---", "");
|
|
1977
1989
|
parts.push("## Agent Memory", "");
|
|
1978
|
-
parts.push("
|
|
1990
|
+
parts.push("Empty. Use `update_memory` to save key facts about the user. Max 2000 characters.");
|
|
1979
1991
|
}
|
|
1980
1992
|
if (profile.isNewAgent) {
|
|
1981
1993
|
parts.push("", "---", "");
|
|
1982
1994
|
parts.push("## First Launch", "");
|
|
1983
1995
|
parts.push(
|
|
1984
|
-
`This is the user's first session with
|
|
1985
|
-
"
|
|
1986
|
-
"
|
|
1987
|
-
"
|
|
1996
|
+
`This is the user's first session with ${pluginName}.`,
|
|
1997
|
+
"Give a one-paragraph welcome that explains what this plugin does and what the user can accomplish.",
|
|
1998
|
+
"Then immediately identify the first step from the skill documentation (e.g. registration, setup)",
|
|
1999
|
+
"and offer to do it now \u2014 don't wait for the user to ask."
|
|
1988
2000
|
);
|
|
1989
2001
|
}
|
|
1990
2002
|
return parts.join("\n");
|
|
@@ -4368,6 +4380,7 @@ var POLL_INTERVAL_MS = 6e4;
|
|
|
4368
4380
|
var StatusBar = React.memo(function StatusBar2({
|
|
4369
4381
|
agentName,
|
|
4370
4382
|
pluginName,
|
|
4383
|
+
isAstraNova,
|
|
4371
4384
|
journeyStage,
|
|
4372
4385
|
autopilotMode = "off",
|
|
4373
4386
|
autopilotIntervalMs = 3e5,
|
|
@@ -4375,7 +4388,7 @@ var StatusBar = React.memo(function StatusBar2({
|
|
|
4375
4388
|
}) {
|
|
4376
4389
|
const [data, setData] = useState({ market: null, portfolio: null });
|
|
4377
4390
|
const mounted = useRef(true);
|
|
4378
|
-
const canFetchData = journeyStage !== "fresh" && journeyStage !== "pending";
|
|
4391
|
+
const canFetchData = isAstraNova && journeyStage !== "fresh" && journeyStage !== "pending";
|
|
4379
4392
|
const poll = useCallback(async () => {
|
|
4380
4393
|
const [marketRes, portfolioRes] = await Promise.all([
|
|
4381
4394
|
fetchMarket(agentName),
|
|
@@ -4445,7 +4458,7 @@ var StatusBar = React.memo(function StatusBar2({
|
|
|
4445
4458
|
formatNum(portfolio.portfolioValue)
|
|
4446
4459
|
] })
|
|
4447
4460
|
] }),
|
|
4448
|
-
!canFetchData && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4461
|
+
isAstraNova && !canFetchData && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4449
4462
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " \u2502 " }),
|
|
4450
4463
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: "pending verification" })
|
|
4451
4464
|
] }),
|
|
@@ -5397,6 +5410,7 @@ ${stack}
|
|
|
5397
5410
|
{
|
|
5398
5411
|
agentName,
|
|
5399
5412
|
pluginName: manifest.name,
|
|
5413
|
+
isAstraNova: hasJourneyStages,
|
|
5400
5414
|
journeyStage: profile.journeyStage ?? "full",
|
|
5401
5415
|
autopilotMode,
|
|
5402
5416
|
autopilotIntervalMs,
|