agentlife 2.0.0 → 2.1.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/index.js +28 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2792,7 +2792,8 @@ function renderAgentWidget(state, runtime, agentId, log) {
|
|
|
2792
2792
|
function renderAllAgentWidgets(state, runtime, log) {
|
|
2793
2793
|
const ids = listSpecialistIds(runtime);
|
|
2794
2794
|
if (ids.length === 0) {
|
|
2795
|
-
log("[render-widgets] no user agents —
|
|
2795
|
+
log("[render-widgets] no user agents — rendering welcome widget");
|
|
2796
|
+
renderWelcomeWidget(state, log);
|
|
2796
2797
|
return;
|
|
2797
2798
|
}
|
|
2798
2799
|
for (const id of ids) {
|
|
@@ -2803,6 +2804,31 @@ function renderAllAgentWidgets(state, runtime, log) {
|
|
|
2803
2804
|
}
|
|
2804
2805
|
}
|
|
2805
2806
|
}
|
|
2807
|
+
var WELCOME_SURFACE_ID = "welcome";
|
|
2808
|
+
function renderWelcomeWidget(state, log) {
|
|
2809
|
+
const dsl = [
|
|
2810
|
+
`surface ${WELCOME_SURFACE_ID} size=m`,
|
|
2811
|
+
` card`,
|
|
2812
|
+
` column`,
|
|
2813
|
+
` text "\uD83D\uDC4B Welcome to Agent Life" h3`,
|
|
2814
|
+
` text "Type what you want to track or automate — one line, anything. Your first agent builds itself from that intent." body`,
|
|
2815
|
+
` divider`,
|
|
2816
|
+
` badge "Ready" color=#6366F1 outlined`,
|
|
2817
|
+
`goal: Welcome the user and guide them to create their first agent`,
|
|
2818
|
+
`followup: +24h "If the user still has no agents, push an encouraging widget inviting them to try again. If agents now exist, this widget will already be deleted."`,
|
|
2819
|
+
`context: {"phase":"welcome","autoRendered":true}`
|
|
2820
|
+
].join(`
|
|
2821
|
+
`);
|
|
2822
|
+
pluginPushSurface(state, { agentId: "agentlife", dsl });
|
|
2823
|
+
log(`[render-widgets] rendered ${WELCOME_SURFACE_ID}`);
|
|
2824
|
+
}
|
|
2825
|
+
function deleteWelcomeWidget(state, log) {
|
|
2826
|
+
if (!state.surfaceDb?.has(WELCOME_SURFACE_ID))
|
|
2827
|
+
return;
|
|
2828
|
+
state.surfaceDb.delete(WELCOME_SURFACE_ID);
|
|
2829
|
+
broadcastDelete(WELCOME_SURFACE_ID);
|
|
2830
|
+
log(`[render-widgets] deleted ${WELCOME_SURFACE_ID}`);
|
|
2831
|
+
}
|
|
2806
2832
|
|
|
2807
2833
|
// services/surfaces-init.ts
|
|
2808
2834
|
import * as path4 from "node:path";
|
|
@@ -6142,6 +6168,7 @@ function registerAgentGateway(api, state2) {
|
|
|
6142
6168
|
if (!provisionedIds.has(id)) {
|
|
6143
6169
|
try {
|
|
6144
6170
|
renderAgentWidget(state2, api.runtime, id, console.log);
|
|
6171
|
+
deleteWelcomeWidget(state2, console.log);
|
|
6145
6172
|
} catch (e) {
|
|
6146
6173
|
console.warn("[agentlife] renderAgentWidget failed for %s: %s", id, e?.message);
|
|
6147
6174
|
}
|